4 ms·
I wish people build _native_ JS library first and then framework library wrapper over that, so at least their library can be used in non-framework environments.
by kklisura 4y ago
I wish people build _native_ JS library first and then framework library wrapper over that, so at least their library can be used in non-framework environments.
There are lot of great react libraries which I would like to use in non-react applications and it would be great to have that same library in some X framework by just building a wrapper over it.
- benbristow 4y agoYou could just render a single component using ReactDOM if you wanted to use React libraries within a non-framework environment. You don't have to go full-SPA with React, you can use it piecemeal.
- Aeolun 4y agoBuilding a native JS library for something that I only want in React sounds like it’d bring me no benefit for a lot of extra effort.
- jbverschoor 4y agoIf someone else has done this, you’d only have to create the react layer. That’s one of the benefits
- kklisura 4y agoYes - if you're building just for yourself, but if you're building an OSS library your _audience_ is now larger than just React one and you have potential benefit of writing a thin wrapper around it in some new framework (if React stops being _mainstream_). Writing a wrapper around it sounds better than rewriting a whole library.
- jacobr 4y agoThis is built on the Lexical framework, which is exactly what you suggest - vanilla JS with optional React bindings. OP's project is an additional React-specific layer on top of Lexical, and since it's concerned with rendering the editor UI it makes sense that it's UI rendering library specific.