Package Exports
- innet
- innet/index.es6.js
- innet/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (innet) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
innet
CANT inc. application build ecosystem.
Overview
innet is designed to simplify and standardize application development with a flexible and modern ecosystem.
It combines the best features from popular libraries and frameworks, offering a familiar yet uniquely powerful experience.
innet is a JavaScript ecosystem built around a single function-based core, offering an out-of-the-box solution for a variety of application types:
- API Server
- Website
- Browser plugin (planned)
- Native application (in work)
JSX Everywhere
innet comes with built-in support for JSX, providing a smooth developer experience for writing components.
You can use JSX not only on the client side but also on the server side.
Check out @innet/jsx for more details.
JSX works seamlessly on both client and server!
Modular Plugin Architecture
innet's functionality is split across modular plugins. Include only what you need:
- Frontend plugins: refs, portals, context, lifecycle, state management
- Server-side plugins: api, components, proxy, async, endpoints
- Shared plugins usable on both sides
You can use the same plugins on client and server!
Component-Based Approach
innet fully supports components as a powerful way to build reusable parts of your application.
Same components can be used on server and client!
Explore the many features below to get started!
Installation
Using npm:
npm i innetUsing yarn:
yarn add innetGetting Started
You can start working with innet using @innet/dom for frontend apps, @innet/server for backend apps, or @innet/native for native mobile development.
The main innet function accepts one required parameter and two optional:
- The first parameter is a task represented by a function that will be executed within the task queue.
- The second (optional) parameter sets the task priority, with a default value of 0.
- The third (optional) parameter determines the queue order, where LIFO is used if true; otherwise, FIFO by default.
If innet is executed outside the context of another innet call, the code is executed immediately during the call.
import innet from 'innet'
const log: any[] = []
innet(() => log.push(42))
// log: [42]Task Priority
Control the execution priority of innet tasks with the second and the third optional argument.
- The third argument, when true, switches the order of the queue from the default FIFO to LIFO.
- Lower priority values are executed before higher priority values.
- Tasks with the same priority are ordered based on FIFO or LIFO, depending on the third parameter.
import innet from 'innet'
const log: any[] = []
const logger = (value: any) => () => {
log.push(value)
}
innet(() => {
innet(logger('Mounted'), 2)
innet(logger('Mounting'), 1)
innet(logger('Rendering'), 0)
innet(logger('WillMount'), 1, true)
})
// log: ['Rendering', 'WillMount', 'Mounting', 'Mounted']In the example, 'Rendering' (priority 0) executes first, followed by 'WillMount' (priority 1, LIFO), then 'Mounting' (priority 1, FIFO), and finally 'Mounted' (priority 2).
Runs from the left to the right
[true, ..., false] > [true, ..., false] > ...
^ 0 ^ ^ 1 ^
Explore more general plugins and utilities in @innet/utils
Issues & Contributions
If you find bugs or want to suggest features, please open an issue on GitHub.