After a careful review of the editor codebase, I find that migrating is to be used on the web is a very HUGE task that not only means moving files to a shared location between desktop and web, but complete rewrite of some parts of it.
I will try to layout some of the issues I see needs to be done to completely migrate the editor:
Move the code to its own package: Is either move the editor code to the UI package, or as a separate package. Maybe moving it to the UI package sounds easier, but it make sense to move it to its separate package for the long run. this task is hard enough to even think of doing "the simple thing" now and kick the same job to the future
The comments editor is tide-coupled with the desktop middle-end: The part we want to migrate to the web is the comment editor. this editor store values in the middle end, which means we need to either rewrite the whole thing to make it work on the web or refactor it so we can use it in both places.
The embed plugin use the desktop models code heavily: the embed and mentions plugins need access to the backend data in order to work properly. right now we are importing this code inside each plugin and using some nasty techniques in order to make the editor aware of this data. To make this work we need to extract this code into a "Editor context" so it can be passed to the editor no matter is rendered.
The image component uses the middle-end to upload files to IPFS: this plugin uses a function that is executed in the middle end that we need to replicate on the web. This means rewrite this part of the editor.
Links need a way to open URLs, HM URLs and external URLs: In Electron, the way to open web URLs is with a special function, this needs to work also on the web, so we need to enable those functions inside a new Editor Context (mentioned above).
This are some of the big tasks that needs to be done in order to really migrate the editor code so it can be used in both web and desktop.
Proposal: Minimal Editor on the web
My proposal on how to tackle this task, is to create a new editor package that only have the minimal features needed to make comments possible on the web.
After we have a minimal version of the editor ready working on the web, we can start working on migrating each plugin/extension one by one. This way we can give our users value very quickly.
What is the minimal version of the editor for comments to work?
This is a tricky question, but I believe it should have just paragraphs, block hierarchy and links work.
What's next after the minimal version of the editor is ready and functional?
We can start migrating other features like headings, list types, embeds, images and so on. When everything is migrated to this new package, then we can refactor the desktop app and use this new editor. Maybe we can try to use it from the get-go, but I don't want this to delay Comment on a Site from a Web Browser.