Rete.js is a robust JavaScript framework for building visual programming interfaces and workflows, allowing developers to create node-based editors for dataflow, control flow, or mixed processing. It provides out-of-the-box solutions for visualization with various UI libraries (React, Vue, Angular, Svelte, Lit) and offers different types of engines for graph processing. The current stable version is 2.0.6, with recent minor updates addressing bug fixes and performance improvements. Rete.js v2 represents a significant architectural shift from v1, adopting a TypeScript-first approach, a flexible plugin system, and enhanced customization capabilities. Its modular ecosystem allows developers to pick and choose necessary packages, avoiding unnecessary dependencies and supporting custom builds.
npm install reteVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up a basic Rete.js editor with a custom node, two instances of that node, and a connection between them using the React renderer. It highlights the use of `NodeEditor`, `AreaPlugin`, `ConnectionPlugin`, and `ReactPlugin` with `ClassicPreset` for defining schemes and components.
Consult the official Rete.js v2 Migration guide and documentation. The `Component` abstraction from v1 is replaced with more flexible node creation. Plugins are now classes and connected differently.
Always treat arrays returned by `getNodes()` and `getConnections()` as immutable. If modifications are needed, perform them on a copied array or use the editor's API for adding/removing elements.
For optimal development experience, use TypeScript (version 4.7 or higher is recommended) with Rete.js.
Optimize by connecting plugins only when needed, simplifying node rendering at low zoom levels (Level of Detail - LOD), and being mindful of expensive operations within node components. Implement `OnPush` change detection for Angular-based renderers where applicable.
Upgrade TypeScript to version 4.7 or higher. If not possible, use `@ts-ignore` for the `use` method as a temporary workaround.
Ensure `rete` and its necessary plugins are installed via `npm install rete rete-area-plugin rete-connection-plugin rete-react-plugin ...`. For CJS, ensure your bundler (Webpack, Rollup) or Node.js environment is configured to handle ESM imports correctly, or explicitly use `require()` if the package provides a CJS entry point. Modern Rete.js is ESM-first.
Wrap the editor/area initialization in a `setTimeout` with a small delay (e.g., 0ms or 10ms) to ensure the DOM has settled. Alternatively, manually call `area.resize()` after initialization if the container's dimensions are known.
No dependency data recorded yet.