Closed jimmywarting closed 4 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
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.
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/
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.
Fixed by #143
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)