Conversation
rwjblue
left a comment
There was a problem hiding this comment.
I think this will also need a couple of tests
|
So had a quick convo with @rwjblue about this, and we realized we're going to need to make some additional changes. Currently, So, in this package we need to add the Ember package so you can actually import it. In the babel plugin that |
e0fdb0f to
bc14af2
Compare
|
Next Steps?:
|
rwjblue
left a comment
There was a problem hiding this comment.
In order to land we need to:
- Update https://github.com/ember-cli/babel-plugin-ember-modules-api-polyfill
- Add a new configuration option (
useEmberModulemaybe?) to opt in to emitting theimport Ember from 'ember';bit or doing the (currently default) "just usewindow.Ember" thing
- Add a new configuration option (
- Update ember-cli-babel
- to use that new version of babel-plugin-ember-modules-api-polyfill
- to pass
trueorfalseto that new option based on the running version ofember-source
- Update this PR to actually emit a
embermodule (current Ember apps actually have noembermodule at runtime, we have to fix that)
packages/ember/index.js
Outdated
| Object.defineProperty(context.exports, 'Ember', { | ||
| configurable: true, | ||
| writable: false, | ||
| get() { | ||
| return Ember; | ||
| }, | ||
| }); | ||
|
|
||
| return Ember; | ||
| }, |
There was a problem hiding this comment.
Hmm, I don't think we should redefine it. If we do, then you won't have a deprecation for every usage of Ember without importing (you'd only get on deprecation). This would make finding and fixing any global accessing quite difficult.
packages/ember/index.js
Outdated
| }, | ||
| }); | ||
|
|
||
| context.exports.Em = context.exports.Ember; |
There was a problem hiding this comment.
This one also needs to be Object.defineProperty(context.exports, 'Em' with a deprecation
|
Aren't there some important parts that have not been exposed via modules yet? How would that work with this? |
|
@btecu as noted in the RFC, you will still be able to |
|
babel plugin: ember-cli/babel-plugin-ember-modules-api-polyfill#175 |
|
@NullVoxPopuli can you rebase this PR? Now that #19390 has landed, everything should be much easier to deprecate since the global is now setup lazily (you can do it in |
… window.Ember RFC: emberjs/rfcs#706 tl;dr: Recommend `import Ember from 'ember';` instead of using the window.Ember global
bc14af2 to
5534e7f
Compare
|
https://github.com/ember-cli/babel-plugin-ember-modules-api-polyfill/releases/tag/v3.3.0 includes new |
|
This has been superseded by #19457, so can be closed, right? |
No description provided.