Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desktop: Move CodeMirror 6 editor out of beta #9450

Closed
8 of 16 tasks
personalizedrefrigerator opened this issue Dec 5, 2023 · 2 comments
Closed
8 of 16 tasks

Desktop: Move CodeMirror 6 editor out of beta #9450

personalizedrefrigerator opened this issue Dec 5, 2023 · 2 comments
Labels
beta-editor About the desktop beta editor desktop All desktop platforms enhancement Feature requests and code enhancements medium Medium priority issues

Comments

@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented Dec 5, 2023

The CodeMirror 6 beta editor on desktop still has a number of issues that need to be addressed before it can be considered stable:

List of known broken plugins

@personalizedrefrigerator personalizedrefrigerator added bug It's a bug medium Medium priority issues beta-editor About the desktop beta editor enhancement Feature requests and code enhancements labels Dec 5, 2023
@personalizedrefrigerator personalizedrefrigerator changed the title CodeMirror 6 beta editor metaissue Desktop: CodeMirror 6 beta editor metaissue Dec 5, 2023
@personalizedrefrigerator personalizedrefrigerator added desktop All desktop platforms and removed enhancement Feature requests and code enhancements labels Dec 5, 2023
@personalizedrefrigerator personalizedrefrigerator changed the title Desktop: CodeMirror 6 beta editor metaissue Desktop: Move CodeMirror 6 editor out of beta Dec 5, 2023
@personalizedrefrigerator personalizedrefrigerator added enhancement Feature requests and code enhancements and removed bug It's a bug labels Dec 5, 2023
@laurent22
Copy link
Owner

Thanks for creating this plan!

How many active CodeMirror plugins are there? I wonder if it really makes sense to spend a lot of time on this compatibility layer if we could simply fix the few that are out there?

Also once we make this editor the default, I think we should restrict access to the compatibility layer to existing plugins only. New plugins should not use it at all. Maybe like it's been done here, or similar solution:

const registerSettingAllowedPluginIds: string[] = [

@personalizedrefrigerator
Copy link
Collaborator Author

personalizedrefrigerator commented Dec 5, 2023

How many active CodeMirror plugins are there?

Based on a GitHub code search, I estimate 20-50 (code search).

Also once we make this editor the default, I think we should restrict access to the compatibility layer to existing plugins only. New plugins should not use it at all.

This makes sense.

Perhaps we could have a separate method for registering content scripts. For example,

joplin.contentScripts.register(
            ContentScriptType.CodeMirror6Plugin,
            ...
)

In this case, CodeMirror6 plugins could export a CodeMirror 6 extension.

Notes:

  • Our CodeMirror compatibility layer extends CodeMirror-vim's compatibility layer, so we aren't maintaining all of it.
  • CodeMirror 6's extension system is very different from CodeMirror 5's.
  • If I recall correctly, one of the biggest issues we have when updating CodeMirror is multiple copies of global objects (e.g. facets) such that equality checks fail (copy1 !== copy2). For this reason, it may be necessary for us to export these static objects to plugins.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-editor About the desktop beta editor desktop All desktop platforms enhancement Feature requests and code enhancements medium Medium priority issues
Projects
None yet
Development

No branches or pull requests

2 participants