-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store the noconflict aliases #204
Comments
@rajasegar I tried to use your current work here (both your ember-resolver PR and #205 - through However I failed to make it work. Do you have this successfully working already? The thing I fail with is how to properly put the code that calls My understanding is - given that we still have all of vendor.js and app.js referencing the global So with using But again, even putting it at the end of So how is this actually supposed to work in a regular Ember app? Halp! 😀 |
@simonihmig here is the sample repo |
Oh, thanks for the super quick response! Looking at your (built and minified) app code, it seems you are calling This does make sure that you are calling What I am still unsure about: does this guarantee to have no unexpected side effects on any 3rd party code? So let's assume I want to embed an Ember app into some 3rd party (server rendered) HTML page with lots of other JS. So you would have something like this: <script type="text/javascript" src="/assets/vendor.js"></script>
<script type="text/javascript" src="/assets/my-embedded-app.js"></script>
<script type="text/javascript" src="/cms/some/other/3rdparty.js"></script> With this, the browser would guarantee the evaluation order of these scripts, so That's why I thought it has to be put at the end of app.js, but basically at the root level, not within some code that is only executed asynchronously (e.g. after Does that make sense? |
Yes @simonihmig that makes sense. |
So far, I have failed to make this work. One reason is quite specific to my app, and out of scope of the general case. But two other issues blocked this furthermore:
FWIW, the only way I finally got my app to coexist with other AMD-based scripts on the same page was to use |
I knew about ember-data but not ember-classic-decorators, I will check out ember-derequire |
Related to ember-cli/ember-resolver#629
We need to store the noconflict aliases within the global loader object, so that other libraries in the Ember ecosystem like ember-resolver can be able to use the aliased objects like define, require and requirejs instead of the default ones.
The text was updated successfully, but these errors were encountered: