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

[BUGFIX beta] Allow deprecated access to registry. #12157

Merged

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Aug 20, 2015

As part of the ember-registry-container-reform the registry was moved from Application#registry / ApplicationInstance#registry to __registry__, and a new public API was created allowing access to the majority of functions that folks used directly on Application or ApplicationInstance instances.

We created an alias container property for ApplicationInstances, but missed creating the same thing for registry which was exposed non-underscored on both Application and ApplicationInstance instances.

This adds an alias for all public registry methods at their original location and provides a helpful deprecation warning instructing you what to use instead.

Also, changes the ApplicationInstance Object.defineProperty calls to be done once on the ApplicationInstance prototype (instead of on each instance).


This fixes a regression that was reported in a number of prominent projects:

As part of the `ember-registry-container-reform` the registry was moved
from `Application#registry` / `ApplicationInstance#registry` to
`__registry__`, and a new public API was created allowing access to the
majority of functions that folks used directly on `Application` or
`ApplicationInstance` instances.

We created an alias `container` property for `ApplicationInstances`,
but missed creating the same thing for `registry` which was exposed
non-underscored on both `Application` and `ApplicationInstance`
instances.

This adds an alias for all public `registry` methods at their original
location and provides a helpful deprecation warning instructing you what
to use instead.

Also, changes the `ApplicationInstance` `Object.defineProperty` calls to be
done once on the `ApplicationInstance` prototype (instead of on each instance).
@rwjblue
Copy link
Member Author

rwjblue commented Aug 20, 2015

@dgeb - Would love your review on this, as you are the most familiar with the ember-registry-container-reform feature?

bmac added a commit to bmac/data that referenced this pull request Aug 20, 2015
This way Ember Data won't log deprecation warnings when emberjs/ember.js#12157 lands in Ember.
bmac added a commit to bmac/data that referenced this pull request Aug 20, 2015
This way Ember Data won't log deprecation warnings when emberjs/ember.js#12157 lands in Ember.
bmac added a commit to emberjs/data that referenced this pull request Aug 20, 2015
This way Ember Data won't log deprecation warnings when emberjs/ember.js#12157 lands in Ember.

(cherry picked from commit c08f725)
rwjblue added a commit that referenced this pull request Aug 22, 2015
…istry-functions

[BUGFIX beta] Allow deprecated access to registry.
@rwjblue rwjblue merged commit 12a3ea2 into emberjs:master Aug 22, 2015
@rwjblue rwjblue deleted the allow-deprecated-access-to-registry-functions branch August 22, 2015 22:57
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 this pull request may close these issues.

1 participant