How do you make a Plugin/Addons for a Core Electron App?


#1

I was having difficulty seeing if anyone has done an add-on and add-on system for their electron app.

If this doesn’t exist, does one just make a desperate electron app, build an asar and import the asar(s) in the core app?


#2

Atom has a package system, as well as a package manager that builds on npm functionality.


#3

We are actually working on a proposal for that… we have an Electron boilerplate using React & React-MDL (look here: https://github.com/appelgriebsch/electron-boilerplate/tree/reactjs) and integrated some module/plugin system on it (HelloWorld example: https://github.com/appelgriebsch/HelloWorldModule).

Actually the boilerplate / shell bundles some services (PouchDB, Lovefield, …) and offers a settings panel in which you can maintain your plugins / addons.

Addons itself are bundled as ASAR files and can be dropped into the boilerplate/shell to get registered. We come to a blocking point actually,

  • we bundle the fundamental libraries such as React, React-MDL, React-Router, … with the boilerplate/shell itself,
  • and just strip them out of the modules to reduce the load and size of them (devDependencies in module, npm prune --production during build of module)

but: if we load and require the module in the shell, we got an exeption triggered that the dependencies are not there. This only happens when loading the module via an ASAR file. When doing the same via an unpacked folder everything works fine (the dependencies were taken from the shell itself).

Why does the loading / requiring of components from the ASAR archive behave differently? Is there a way in which we can specify additional “lookup folders” for the dependencies when loading ASAR archives?


#4

I have the same needs. Do you have any results now?


#5

I have a project around that, but I need to complete other projects first to get back to Extensible.js. Stay tuned if you want to get news about that.


#6

I have written some analysis, do you have any comments? Let’s talk together


#7

Very looking forward to!


#8

Do you still have some code? Because the links return a 404 and I would like to create/get some ideas for a plugin system.


#9

Do you have some idea how to implement your theory? After the electron app being distributed?


#10

For the time being I have a very simple implementation, I am currently using electron-vue, so I want to use Async-Components to load the plugin. But it will rely too much on Vue. . .