Remove CodeMirror dependencies#18911
Conversation
|
The diff is unfortunately spammed by all the file removals. There is only one actual file change in |
|
|
1 and 2: It magically appears to work, but you are right there may be race conditions. I guess I will just make it sequentially load. The plugin itself accesses 3: CodeMirror's only purpose is to make EasyMDE work, I don't think we want to extend it further. |
789ea2f to
b37e930
Compare
|
I ended up just removing the direct CodeMirror dependency altogether. EasyMDE already loads all the modes and plugins it needs, so there is no reason for neither the webpack dependency nor the vendored copy: Syntax highlighting in EasyMDE still works as expected. I suspect the reason why we left CodeMirror in was because it was previously in direct use by the code editor, which was replaced by monaco. |
wxiaoguang
left a comment
There was a problem hiding this comment.
That's what we are glad to see
|
Did anyone check if this breaks the Git Hooks editor? looks fine. |
* giteaofficial/main: Fix page and missing return on unadopted repos API (go-gitea#18848) [skip ci] Updated licenses and gitignores Allow adminstrator teams members to see other teams (go-gitea#18918) Update nginx reverse proxy docs (go-gitea#18922) Don't treat BOM escape sequence as hidden character. (go-gitea#18909) Remove CodeMirror dependencies (go-gitea#18911) Uncapitalize errors (go-gitea#18915) Disable service worker by default (go-gitea#18914) Set is_empty in fixtures (go-gitea#18869) Don't update email for organisation (go-gitea#18905) Correctly link URLs to users/repos with dashes, dots or underscores (go-gitea#18890) Set is_private in fixtures. (go-gitea#18868) Fix team management UI (go-gitea#18886) Update JS dependencies (go-gitea#18898) Fix migration v210 (go-gitea#18892) migrations: add test for importing pull requests in gitea uploader (go-gitea#18752)
EasyMDE already loads all the modes and plugins it needs, so there is no reason for neither the webpack dependency nor the vendored copy
Use webpack dynamic import to load the markdown mode for easymde, eliminating the need to ship the outdated vendored version of codemirror we had, while at the same time updating the markdown mode to the latest version too.
This should also bring a reduction in memory usage because we no long need to include all these unnecessary files in the bindata.
Solution is based on codemirror/codemirror5#5484.