3 ms·
Why did CodeMirror v6 become so complicated?
- bob1029 3y agoI've seen so many javascript libraries go down this path. The one I always go back to as the #1 example of this is RiotJS. The very first release of that was like a breath of fresh air - it was the new, simple, no-nonsense way to build SPAs, etc. You can see it plain as day in their migration guide. Old: <my-component> <p class={ active: isActive, disabled: isDisabled }>hello</p> </my-component> New: function classNames(classes) { return Object.entries(classes).reduce((acc, item) => { const [key, value] = item if (value) return [...acc, key] return acc }, []).join(' ') } // install the classNames plugin riot.install(function(component) { // add the classNames helper to all the riot components component.classNames = classNames return component }) <my-component> <p class={ classNames({ active: isActive, disabled: isDisabled }) }>hello</p> </my-component> https://riot.js.org/migration-guide/ https://riot.js.org/migration-guide/ This stuff is absolutely insane to me.
- drschwabe 3y agoOne theory: TypeScript Maybe tangential, but I have seen a pattern of projects that go all-in on TypeScript only to become overly complex & lose development steam. I'm not saying that is or will be the case with Codemirror but I do think there is some merit to the idea that JavaScript helps developers code effectively at the high-level whereas TypeScript has a way of taxing that process; detracting from what made the original project come together in the first place. Of course, there are plenty of projects that have done exceptionally well after going all-in on TypeScript (or from the get-go) so take this with a grain of salt.