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.45k stars 319 forks source link

spell checker #52

Closed jimmywarting closed 4 years ago

jimmywarting commented 5 years ago

is codemirror-spell-checker really necessary? it brings in lots of other dependencies i don't want/need (it seems to only be english wish my website don't use).

I think it should be an optional dependency. Also, isn't possible to use the native spell checker somehow?

(related: https://github.com/cfinke/Typo.js/issues/68, cross-js#dont-use-buffer)

jimmywarting commented 5 years ago

if i want codemirror-spell-checker i probably would want to do something like

const EasyMDE = require('easy-markdown-editor')
const speller = require('easy-markdown-editor/speller')

const easyMDE = new EasyMDE({ speller })

or manually have to install it myself and your lib only use it if it exist

Ionaru commented 5 years ago

It wasn't my choice to implement it but I think it's a nice feature that provides added value to the editor. Removing the spell checker actually only saves less than 30kb in the final package.

If you don't want to use the spell checker, just put spellChecker: false in the options.

jimmywarting commented 5 years ago

If you don't want to use the spell checker, just put spellChecker: false in the options.

That won't help reduce the bundle size.


For me 30kb is quite much when you have a budget to follow. if i can get rid of it i take it! mather of fact when i removed one unnecessary line of code in typo-js (new Buffer()) i saved 20kb by not including Buffer in a minified bundle

sure we both think 30kb don't sound like much this days but that is not the size what is making the page slow. it's what it needs to do with it also.

I'm trying to follow lighthouse audit and get a better score, a better score means better search result. a smaller bundle equals faster first-paint, ppl leave the page if something takes more then 3-7s to load

https://github.com/GoogleChrome/lighthouse/issues/1902 https://infrequently.org/2017/10/can-you-afford-it-real-world-web-performance-budgets/

Ionaru commented 5 years ago

I see your point.

A modular setup would be really useful in certain situations, but I am not sure how to implement that in the package. It must not compromise any existing functionality or platform support.

Ionaru commented 4 years ago

Fixed by #143