DEV Community

[Comment from a deleted post]
Collapse
 
niubo profile image
Rolando Niubo • Edited

You are 100 % correct.

I'm also wondering how in a Single Spa project that has a React Project and an Angular project would you share components from an Utility Module. I think the developer would be forced to implement both frameworks in the same Utility Module or create several utility modules? Will be honesty a pain in either way.

In my organization we just tried to use Single Spa because we thought the microservices idea in the frontend would be right for us. But we are seeing the ugly faces of it already.

I personally don't think microservices in the frontend are a good idea, at least just yet. In my very personal opinion a UI needs it's sections talking each other in a dynamic way, unless you are doing something very very custom and unique with very specific purpose. If that is the case and Single-Spa and this frameworks are only used in those weird unique cases, this entire micro frontends architecture will eventually fail and be forgotten.

We are seeing cases already of big companies like Trulia, leaving this architecture because in the long run became for them hard to maintain, it became the very thing they were running away from by adopting the micro frontend architecture in the very first place.

But back to your question, if you go down to a Single Spa project with React and Angular mfes, and need some Global State solution, which by the way, is according to them an anti pattern, because you are going against the decoupling of micro services. But if you just need it, you should be able to get what you want maybe with the Pub Sub pattern, I haven't try though, but it should work, as you are just publishing events in the DOM and subscribing to those events...

Collapse
 
alxizr profile image
alxizr

Thanks mate. This is exactly what i had in mind. It is still a mystery with mfe architecture and until someone comes with a battle tested approach we can only experiment trial and error all by ourselves. :)