Ionaru / easy-markdown-editor

EasyMDE: A simple, beautiful, and embeddable JavaScript Markdown editor. Delightful editing for beginners and experts alike. Features built-in autosaving and spell checking.
https://stackblitz.com/edit/easymde
MIT License
2.38k stars 314 forks source link

3.0 rewrite #447

Open Ionaru opened 2 years ago

Ionaru commented 2 years ago

Is your feature request related to a problem? Please describe. Current codebase of the editor contains a lot of legacy code, is difficult to maintain and depends on a toolchain that is no longer optimal anno 2022.

This is basically my wish list for v3.0.

Describe the solution you'd like A complete rewrite of the codebase, split code over multiple files, written in TypeScript and SCSS.

Describe alternatives you've considered

Additional context

Progress

You can follow progress on the https://github.com/Ionaru/easy-markdown-editor/tree/v3 branch.

vanillajonathan commented 2 years ago

Part of the modern toolchain could also be Vite.

npm create vite@latest easy-markdown-editor -- --template vanilla-ts
cd easy-markdown-editor
npm install
npm run dev

This makes it easy to develop with hot reload.

Ionaru commented 2 years ago

I agree and is something I'm considering, it does seem to be more focused on web applications and less on packages like easymde. Also it uses Rollup under the hood anyway.

A build command that bundles your code with Rollup, pre-configured to output highly optimized static assets for production. https://vitejs.dev/guide/

Ionaru commented 2 years ago

Maybe the new version of the editor should be a custom Web Component? The editor could be built using Vue and exported to run anywhere.

Edit 2022-11-16: I've looked into this, if the editor were a Web Component, providing options and other JavaScript API features would be difficult for any user of the editor.

Vintagewally commented 1 year ago

would be nice to have the possibility to toggle the spell-checker on and off while writing

vanillajonathan commented 1 year ago

would be nice to have the possibility to toggle the spell-checker on and off while writing

I think the spellchecker should be removed since browsers already come with built-in spellcheckers anyways.

Ionaru commented 1 year ago

would be nice to have the possibility to toggle the spell-checker on and off while writing

I think the spellchecker should be removed since browsers already come with built-in spellcheckers anyways.

I can still see some use for it with for forms in languages that a browser would not be set to. But maybe off by default?

vanillajonathan commented 1 year ago

I can still see some use for it with for forms in languages that a browser would not be set to. But maybe off by default?

In that case it is arguably useful. On the other hand it would arguably be nice to drop the dependency too tho which would result in less code, reduced bundle size and a smaller API.

ThatXliner commented 1 year ago
image
umajho commented 1 year ago

Hello. I tried to migrate the current codebase to rollup, and managed to pass all the tests.

Although the changes are not extensive, since this involves replacing a build system, it requires careful planning. I think my causal work is not sufficient to make a pull request. Instead, I think it is better to put what I have done here, which may provide some useful insights.

Ionaru commented 1 year ago

I've now pushed the https://github.com/Ionaru/easy-markdown-editor/tree/v3 branch with the current (incomplete) state of the rewrite.

dwjohnston commented 1 year ago

Can I recommend documentation for how to test as a first class concern?

I'm currently facing an issue where due to our various customisations, the keyboard shortcuts have broken, so I'm currently going through and writing tests. But writing tests for this library is difficult with React Testing Library as JSDOM doesn't behave particularly well (eg https://github.com/jsdom/jsdom/issues/3002 https://github.com/jsdom/jsdom/issues/1937).

So basically, the ask is for documentation that advises about how to test code that uses this library.

I'm happy to help, this is something I'm passionate about.

velezh commented 5 months ago

I've now pushed the https://github.com/Ionaru/easy-markdown-editor/tree/v3 branch with the current (incomplete) state of the rewrite.

Hello @Ionaru ! You doing great work. Could you please share any updates on it? Any status or progress of 3.0

Thanks a lot

Viktor-Ivliev commented 2 months ago

I've now pushed the https://github.com/Ionaru/easy-markdown-editor/tree/v3 branch with the current (incomplete) state of the rewrite.

Hello @Ionaru ! You doing great work. Could you please share any updates on it? Any status or progress of 3.0

Thanks a lot

It's starting to look like another abandoned library =(

Ionaru commented 2 months ago

Not abandoned.