Skip to content
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

Deprecate the Ember Global #706

Merged
merged 3 commits into from Jan 22, 2021
Merged

Deprecate the Ember Global #706

merged 3 commits into from Jan 22, 2021

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented Jan 14, 2021

@chancancode chancancode added this to the 4.0 milestone Jan 15, 2021
used by legacy code and occasionally in examples. However, it still exists and
remains undeprecated.

The primary motivation for deprecating the global object is for _tree shaking_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pzuraq maybe I'm missing something, could you please describe how we could do tree shaking if we do import Ember from 'ember';? Would build system look which props get used from Ember objet imported that way (that seem like more complex that tree shaking based on imports)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SergeAstapov it's actually the opposite, if you do not import Ember from 'ember'; anywhere in your application, then we can treeshake.

Today, we can't even if you do not import it explicitly, because any code anywhere could reference the Ember global dynamically.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pzuraq thanks for clarification!

@rwjblue
Copy link
Member

rwjblue commented Jan 15, 2021

We discussed this at todays core team meeting, and are moving it into final comment period.

@rwjblue rwjblue added Final Comment Period T-framework RFCs that impact the ember.js library labels Jan 15, 2021
@rwjblue rwjblue merged commit 693671e into master Jan 22, 2021
@rwjblue rwjblue deleted the deprecate-ember-global branch January 22, 2021 19:14
@xg-wang
Copy link
Contributor

xg-wang commented Jan 26, 2021

@pzuraq
Copy link
Contributor Author

pzuraq commented Jan 26, 2021

Ember Inspector uses a lot of intimate/private APIs, so we can expose something for it to read to get access to the things it needs. It doesn't need to be public, so we can figure out the details when the time comes.

NullVoxPopuli added a commit to NullVoxPopuli/ember.js that referenced this pull request Jan 27, 2021
of window.Ember

RFC: emberjs/rfcs#706

tl;dr: Recommend `import Ember from 'ember';` instead of using the window.Ember
global
NullVoxPopuli added a commit to NullVoxPopuli/ember.js that referenced this pull request Feb 13, 2021
… window.Ember

RFC: emberjs/rfcs#706

tl;dr: Recommend `import Ember from 'ember';` instead of using the window.Ember
global
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Final Comment Period T-framework RFCs that impact the ember.js library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants