Built-in plugins: Should it be possible to switch to a non-built-in version?
The latest development version of Joplin bundles @JackGruber's Simple Backup plugin.
Should it be possible to switch from a built-in version of a default plugin to a non-built-in version? If so, what should the UI for this look like?
How do updates to built-in plugins currently work?
For now, built-in plugins are bundled with Joplin and loaded from the app bundle. This means that
- Built-in plugins can't be updated or deleted by the user (no "upgrade" button in settings).
- Upgrading Joplin also upgrades built-in plugins.
Built-in plugins are built from a specific commit during Joplin's build process so that
- The Joplin team can review the code for the built-in plugin
- The Joplin team can ensure that if the maintainer of a built-in plugin's account is compromised, updating a plugin on NPM won't suggest that Joplin users update the plugin.
Summary of the current build process
Currently, when building Joplin, we
checkout
a specific commit from the plugin's GitHub repository- Apply a patch.
- In the case of Simple Backup, this patch causes the plugin to use a version of 7Zip bundled with Joplin, rather than a version included in the
jpl
file — this should fix the issue mentioned here.
- In the case of Simple Backup, this patch causes the plugin to use a version of 7Zip bundled with Joplin, rather than a version included in the
- Include the plugin with the application (with
electron-builder
'sextraResources
option)
As a result, a built-in plugin looks like this in the settings screen:
How does Joplin handle user-installed versions of built-in plugins?
Many users already have a version of Simple Backup installed. When this is the case, the user-installed version of Simple Backup is loaded.
Update behavior acts like it did in previous versions of Joplin: The plugin can be updated from Joplin's plugin repository from settings.
Deletion is a bit different: Deleting the user-installed version leaves the built-in version of the plugin enabled and installed.
Current implementation: Switching to a non-built-in version of the plugin
To switch to a non-built-in version of the plugin, a user can currently:
- Use the "Install from file" option:
- Load the plugin as a development plugin
At present, this can't be done through the plugin search screen. Built-in plugins are marked as "installed" and can't be upgraded:
Question
Should we allow switching to a non-built-in version of the plugin from "Settings > Plugins" (aside from loading a development version of a plugin)? If so, what should this UI look like?
Related notes
Screenshots from an implementation that allows switching to a non-built-in version from search:
Notes:
- Implementation reverted here pending discussion.