Our great sponsors
-
mitosis
Write components once, run everywhere. Compiles to React, Vue, Qwik, Solid, Angular, Svelte, and more.
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I have a monorepo: - code sharing: I thought to have a core "JS" package where others depends on, but I found out I can share very little between React and Vue, so I'm look for some advice here. - UI sharing: Since there's some UI markup involved, is there a trick to have some sort of common UI and only make per-framework binding and logic? - publishing: how manage release/publishing, one common version or independent? Some workflow to follow?
Depending on your needs, check out Mitosis that let you write components and compile them to svelte, angular, react. https://github.com/BuilderIO/mitosis
You could wrap each component as a Web Component and then import them for each repo. Web Components are not native to frameworks, so the support for them could vary when passing props. Or you could wrap the render method of each framework as a function and then use the receiving frameworks life cycle method and inject it onto the page. If you use frameworks like Svelte or Lit that are "Web Component" based, then you'd need to see if the receiving framework supports Web Components inorder to import the seamlessly.