This demo showcases optional plugins developed by Synergy Codes for Workflow Builder - a frontend-first platform for building sophisticated workflow editors.
- Allows users to create plugins in the plugin directory and remove them without breaking the app
- Vite serves stubs for removed plugins (there is a log in the console when it is served)
- ESLint warns users that they cannot import files directly from @/plugins and must use adapters
- Plugins can modify the base code, alter function inputs and outputs, add hooks, localization strings and customize prompts
- Plugins have an additional parameter
priority, allowing the user to define which plugin should be applied first
./src/plugins/->@/plugins- directory with removable content./src/features/plugins-core->@/features/plugins-core- is a core functionalitysrc/features/plugins-core/components.ts,src/features/plugins-core/functions.tsandsrc/features/plugins-core/i18n.tsare places where plugins are added to the app
- Create your plugin directory, for example:
plugins/example. - Add your
<ExampleComponent />tosrc/plugins/example/components/example-component.tsx. - In
src/plugins/example/plugin-componentimport dependencies and add:
registerComponentDecorator("OptionalBuildingCards", {
content: ExampleComponent,
place: "after",
});- Import your plugin to
src/app/features/plugins-core/components.tswith lineimport '@/plugins/example/plugin-components'; - Refresh the page.
Your component should now be displayed in <PlanetInfrastructure /> list.
Simply remove the folder of your plugin and restart the application. It will still work with empty stubs instead of registration.