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

@ember/ordered-set does not avoid deprecation warnings #19

Closed
ef4 opened this issue Jun 1, 2018 · 5 comments · Fixed by #21
Closed

@ember/ordered-set does not avoid deprecation warnings #19

ef4 opened this issue Jun 1, 2018 · 5 comments · Fixed by #21

Comments

@ef4
Copy link
Contributor

ef4 commented Jun 1, 2018

My understanding of this addon is that people should switch to it to avoid deprecation warnings from the built-in ordered-set inside Ember. Which is what ember-data is doing here.

But using ember-data 3.1.1 (which is importing from @ember/ordered-set) with ember-canary we still get the deprecation. Presumably because @ember/ordered-set falls back to the built-in implementation in an effort not to bloat code size.

Do you want PRs to ember and ordered-set to create a deprecation-free private path?

cc @savvymas

@rwjblue
Copy link
Member

rwjblue commented Jun 1, 2018

My understanding of this addon is that people should switch to it to avoid deprecation warnings from the built-in ordered-set inside Ember.

👍

But using ember-data 3.1.1 (which is importing from @ember/ordered-set) with ember-canary we still get the deprecation. Presumably because falls back to the built-in implementation in an effort not to bloat code size.

Yes, that was exactly the goal. 🤔

Do you want PRs to ember and ordered-set to create a deprecation-free private path?

Yes, please 🙏 .

@rwjblue
Copy link
Member

rwjblue commented Jun 1, 2018

I think the most straightforward way to do this is:

  • add via a private env flag (similar to this)
  • Update the deprecation conditions here to check that private env flag (and suppress the deprecation when it is true)
  • Add the flag to this addons config/environment.js (similar to this)

@ef4
Copy link
Contributor Author

ef4 commented Jun 1, 2018

I think we don't want a global flag though -- anybody who is trying to use Ember.OrderedSet directly should still see a deprecation until they switch to using it via @ember/ordered-set.

@rwjblue
Copy link
Member

rwjblue commented Jun 1, 2018

@ef4 - Ahh, good point. In that case, I think we need to add the following to my steps above:

  • Update the main module to have two exports, a non-deprecated (but private) base class and an extended class that adds the deprecation that exists today
  • Update the main exports module to ensure that Ember.OrderedSet is using the deprecated class, and also add an Ember.__OrderedSet__
  • Update this addons index.js to be OrderedSet = Ember.__OrderedSet__ || Ember.OrderedSet;

What do you think?

@ef4
Copy link
Contributor Author

ef4 commented Jun 1, 2018

Yup, @savvymas is already embarking in that direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants