Updating shared singleton dependencies with webpack module federation

Viewed 306

I’ve done a good deal of research on this plugin, but I still don’t understand this part.

What does a production rollout of a new breaking major version of let’s say React look like, when you’re using module federation and continuous deployment (and multiple modules use React)? Things to consider, is there a pattern for releasing all related modules with the updated dependency in an atomic way? Ideally you wouldn’t need to. What does and how should this look? Production ready examples only please, ty!! I haven’t seen this described anywhere.

1 Answers

Things shared with a singleton can cause issues between major versions. In the case of react, 17 and 18 have the same internal api so i can use v18 components in v17 hosts.

However in other cases, like say redux - theres no good solution.

In cases like react, i have a demo called different-react-versions which shows an example of importing another version of react and rendering component on a ref.

Related