3 ms·
For those who may not know, here's a similar library: https://github.com/CanopyTax/single-spa https://github.com/CanopyTax/single-spa I'm glad to see two solut
by JMTQp8lwXL 7y ago
For those who may not know, here's a similar library: https://github.com/CanopyTax/single-spa https://github.com/CanopyTax/single-spa
I'm glad to see two solutions out there, because there's a lot of variety in how this problem can be solved. For example, single-spa recommends (but does not mandate) using import maps [0] using SystemJS (to get better cross-browser support) The idea is, each application says they want 'react-dom' or '@angular/core', and it is resolved to a URL.
However, if applications are built expecting, say, different versions of dependencies, a naive approach to import maps won't work (e.g., the import 'react-dom' is requested-- how do we know which version to serve?).
At my employer, we take each frontend application and transpile to ES Modules and then combine via webpack. It's not what's recommended in Single SPA, but it greatly simplifies the deployment architecture for us.
We don't have to worry about hosting a CDN that can resolve import maps, everything's just in the bundle.
- FlorianRappl 7y agoI think there are multiple solutions out there. Our solution is called Piral, https://github.com/smapiot/piral https://github.com/smapiot/piral, however, we do not believe that mixing technologies should be a solution - it's rather a workaround (which we also support). The real deal from our point of view is in independent development, deployment, and modular, decoupled thinking.