Closed kumaranbsundar closed 6 years ago
Apologies for the very very slow response here.
The majority of our initial examples (including single-spa-examples) used to be implemented with SystemJS, but we got rid of it because it became confusing for many people in the issue queues. If you went far enough back in the git history of single-spa-examples, you'd actually find SystemJS in there.
So currently I am not aware of any example repos that use systemjs. However, at Canopy we use SystemJS in production, have our single-spa applications in separate git repositories, and have the builds and deploys for single-spa applications completely independent of each other.
I actually start last week a blog post about this topic (see https://github.com/CanopyTax/single-spa/issues/221 and https://github.com/CanopyTax/single-spa/issues/169).
The basic approach:
SystemJS.registerDynamic('react', ....)
singleSpa.register('app1', () => SystemJS.import('/path-to-my-app.js', () => true)
Anyway, hope that helps! I'm going to close this for now but feel free to reopen with further discussion or questions.
wanted to submit a fresh working SystemJS based sample since this took me a bit to get my head around the specifics given SystemJS and everything else has evolved enough for errors to be confusing based on the slightly dated sample code in these threads... not a dig, just the reality of how everything is moving forward.
@joeldenning - thanks for all of your kind guidance in these threads! and thanks to CanopyTax for backing the single-spa rallying point... we have high hopes for this basic concept in a major Seattle county govt Azure based project... there'd be no way i would've got there without all your posts... these clear steps you listed here were my north star :)
i'm going to cross post this in a couple other issues to make sure people see it... just comment back if that's frowned upon and i'll delete.
All examples seem to be with webpack. How would we build the apps when they reside in different repos? Any help or suggestions is appreciated. Thx!