4 ms·
Component approach is good, but why force everyone to use React or any particular framework? Wouldn't it be better to implement this as vanilla js component? Ei
by ergo14 8y ago
Component approach is good, but why force everyone to use React or any particular framework? Wouldn't it be better to implement this as vanilla js component? Either via web component or just plain custom element.
Nowdays there are some really good solutions like quillJS or prosemirror that are not tied to particular solutions.
- smt88 8y agoReact is a library and can be used as a thin layer over plain JS. It's just often not used that way. As with all libraries, you still have to be good at organizing your code for it to help you in the long-run. That's a lot of the appeal (and problem) of full frameworks: it decides how to organize your code for you.
- Raphmedia 8y agoIt's the WYSIWYG in the admin and you can still opt out to use TinyMCE. AFAIK, the front-end of Wordpress isn't using React.
- smacktoward 8y agoYet.
- Raphmedia 8y agoEven if they were to make the default theme based on React, nobody is using it. Everyone switch to something else right after install. Should they change the entire stack to use React, they would lose a lot of their community. A lot of their users are code novices that make do with simple HTML and some PHP snippets.
- scarecrowbob 8y ago"Wouldn't it be better to implement this as vanilla js component?" I have not yet done this, but as I understand it... it's possible to use whatever JS you want as long as it works with the GB api. Basically, I did the hello world react Gutenberg thing, then took a look at a11y and saw that none of the 8K or so institutional user I support could probably legally use it, and then got back to whatever Vue map searching for CPTs or whatever BS I was building based on ACF and plain old CPTs. So I dunno for sure, but as I understand it you can build your Gutenberg components in any JS-based system without a lot of overhead. But of course, probably best to just use React as that is what all the core components will be written with.