single-spa-examples | Examples of single-spa applications | Single Page Application library
kandi X-RAY | single-spa-examples Summary
kandi X-RAY | single-spa-examples Summary
Examples of single-spa applications.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Generate menu items items .
- Controller for view
- Gulp Babel config .
- Returns a string representation of the given framework .
- Bootstrap the iframe
- Declare the if inspector .
- Create a new store
- View constructor .
- template constructor .
- Dispatch an event to target element
single-spa-examples Key Features
single-spa-examples Examples and Code Snippets
Community Discussions
Trending Discussions on single-spa-examples
QUESTION
I am trying to use ember as one of the child application with single spa(https://github.com/CanopyTax/single-spa), however I am unable to load the js files assets/vendor.js, assets/ember-app.js properly using systemJS.
Steps to reproduce issue:
1) Setting up single spa example with ember
...ANSWER
Answered 2017-Aug-02 at 03:55Thanks for the clear description and steps to reproduce! I was able to do all the steps and get exactly the same error that you reported.
The tldr for what you are seeing is that SystemJS doesn't know how to execute the ember-app.js and vendor.js bundles correctly.
The longer explanation: when SystemJS downloads the code for those bundles, it runs a regular expression on the code to see what format it is in. The vendor.js file has a combination of amd, cjs, and esm module syntax, but SystemJS decides to interpret the bundles as esm (es6) module syntax. It then transpiles the code into System.register format and forces the code to be executed in javascript strict mode with a "use strict"
statement. Once in strict mode, the code runs with a different context (this
), which is why this.Ember
results in the error Cannot read property 'Ember' of undefined
. Let me know if you want more detail on any of that or if it doesn't make sense. It took me a while to track down, but I believe I now understand it and I can give you more detail if you'd like.
With that said, all of this is pretty deep in the bowels of SystemJS and pretty removed from how single-spa works.
If you're wanting to just see what running Ember inside of a single-spa app looks like, I would check out https://github.com/CanopyTax/single-spa-examples/pull/37#pullrequestreview-53690825 for where I have worked around this issue. Also see https://github.com/CanopyTax/single-spa-examples/issues/33#issuecomment-319359153 and for related discussions.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install single-spa-examples
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page