I'm developing a Electron/React app which uses Webpack and Asar technologies. It's designed to be a host app providing a common platform for some plugins. These plugins are downloaded and plugged into the host app by users at runtime. Each "plugin" may have code to run in the main process (i.e. full Node.js access) and in the renderer process (React components for its UI).

What's the best architecture / design pattern to engineer my "host app" and "plugins"? Similar to VSCode (which it's an Electron app and loads plugins at runtime).

Can I dynamically load an .asar file? Can React.lazy() help me?

  • Are those plugins only delivering their own code or also assets and views to display? Also is that plugin design just for licensing models? Mar 16, 2020 at 12:14
  • @Superlokkus Their own code + assets. just like VSCode. Also plugins should be able to access the host API to do some common stuff e.g. message box, snack bar.
    – frogatto
    Mar 16, 2020 at 13:26
  • Damn in the other case I would just have said, make another node module. That's gonna be tricky due to all the webpack/Asar magic. Mar 16, 2020 at 13:30


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy