0

I am trying to implement micro-frontends but my company is using React as the only front-end technology. I was hoping if I can do it by serving React components on a URL just as suggested in https://micro-frontends.org/ but it uses web components. Since all the ecosystem is on React can I serve a React component (and only that bundle code on a URL) like, https://my-website/components/table?theme="black".

Purpose of trying this:

  1. Main repo will have most of the major dependencies already loaded. (no need of repeated code like react/react-dom etc)
  2. Shadow DOM is creating event bubbling issues.
  3. There are multiple repos for each team and all of them use same component library.
Nathaniel Flick
  • 2,902
  • 2
  • 22
  • 31
  • Maybe take a look at https://bit.dev/. It's a component repo that allows you and your team to easily reuse the same components. – Shawn Yap Mar 12 '20 at 20:28
  • It is adding additional complexity to base layer of our application, which we do not want, moreover maintaining each component version is a difficult task. – rachit srivastava Mar 15 '20 at 06:36
  • Basically what you're trying to achieve by serving components with an URL is even harder to maintain in both the base source and the component source, not to mention sacrificing readability. Just my two cents, hope you find a good way to achieve this. – Shawn Yap Mar 16 '20 at 14:59
  • this seems to be achievable in webpack 5 https://medium.com/@ScriptedAlchemy/webpack-5-module-federation-a-game-changer-to-javascript-architecture-bcdd30e02669 – rachit srivastava Mar 17 '20 at 15:57
  • I think Piral may be what you want. https://github.com/smapiot/piral – Florian Rappl Apr 02 '20 at 23:25

0 Answers0