Open himself65 opened 1 year ago
actually there are many concept like plugin
, extension
, add-on
, widget
. But I think they are fundamentally same thing and I will use plugin always
There are some trade-off in the plugin system. One side is let developers do anything they want, like Atom. In the other side is just limited API and context, like Figma plugin/addon, even sometimes they have code review before you publish the code (sounds like AppStore).
For my thinking, If I'm doing on a plugin system, for example in AFFiNE. I would like to allow fully Web environment support, which means I think developer should do anything they want but also limited.
This will leads to two topics: code sandbox and permission control.
Code sandbox is let plugin code to run under a monitored environment and permission control is let end-user to enable/disable the permission(like turn on turn off the Wifi)
FIgma already talked about the sandbox. The noticeable thing is Realm API, it allow to run third-party code in the same runtime(thread) and with limited context.
https://www.figma.com/blog/how-we-built-the-figma-plugin-system/
This thread is continue updating
I have thought about the implantation of the plugin system for few years(yes, few years, not few months). And had fews small demos. Like when I was CTO in Textea, I was trying to support customize column type(imaging you can do some rich cell in google sheet or excel). And tried, read many source code and design like from Figma, VSCode, Atom. Also got some idea from one internship in Mask.io, jack works told me some idea of the way of doing such stuff. I tried to write down some stuff from my experience time to time, but always give up to collect all my thinking because of getting stuck of writing article, then realized play game is better choice.
Anyway, this thread is for me to really write down something about the plugin system design, the things here are not always correct, even mostly wrong. But good for the future when I look back.