-
-
Notifications
You must be signed in to change notification settings - Fork 403
Add RFC for deprecation Ember Data initializers #181
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| - Start Date: 2016-11-22 | ||
| - RFC PR: (leave this empty) | ||
| - Ember Issue: (leave this empty) | ||
|
|
||
| # Summary | ||
|
|
||
| The goal of this RFC is to remove the `data-adapter`, `injectStore`, | ||
| `transforms`, and `store` Ember application initializers that Ember Data injects | ||
| into apps. The `ember-data` initializer will not be changed and any code | ||
| that previously depended on the ordering of these initializers (via | ||
| the `before` or `after` properties on an initalizer) can be | ||
| changed to use the `ember-data` initializers for ordering. | ||
|
|
||
| # Motivation | ||
|
|
||
| The initializers `data-adapter`, `injectStore`, `transforms`, and | ||
| `store` have not been used by Ember Data since | ||
| [Apr 8, 2014](https://github.com/emberjs/data/commit/d25e23f622a3677b8372db535b2ab824ad306a16). However, | ||
| they are still injected into every Ember app that depends on Ember | ||
| Data because existing apps may depend on these initializers | ||
| for ordering their own initializers to run before or after Ember | ||
| Data's setup code. | ||
|
|
||
| Removing these initializers will help reduce the amount of code Ember | ||
| Data needs to support. | ||
|
|
||
| Since these initializers are noop functions that run after the | ||
| `ember-data` initializer, any initializers that depends on one of the | ||
| deprecated initializers listed in this rfc can easly be replaced by | ||
| depending on the `ember-data` initializer instead. | ||
|
|
||
| # Detailed design | ||
|
|
||
| Ember Data's instance initializer will start checking for any | ||
| initializers whose `before` or `after` properties depend on one of | ||
| these deprecated initalizer. If it finds an initalizer that references | ||
| one of the deprecated initalizers, Ember Data will then log a | ||
| deprecation message that states the name of the offending initalizers | ||
| and suggest changing the `before` or `after` property (the deprecation | ||
| message will refer to the correct property dynamically) to depend on | ||
| Ember Data instead. | ||
|
|
||
| This deprecation message will continue to appear until Ember Data | ||
| 3.0.0 when these initalizers and the deprecation code will be finally | ||
| removed. | ||
|
|
||
|
|
||
| # How We Teach This | ||
|
|
||
| This change should have no impact on how we teach Ember or Ember | ||
| Data. The initalizers that will be removed have been unused for a long | ||
| time and are not mentioned anywhere in today's guides or API docs. | ||
|
|
||
| Users who need to run initalizer code before or after Ember Data | ||
| injects the store into routes should be taught to use `before: | ||
| 'ember-data'`, or `after: 'ember-data'` on their initializers. | ||
|
|
||
| # Drawbacks | ||
|
|
||
| - This change will require users who depend on these deprecated initalizers to update their code. | ||
|
|
||
| # Alternatives | ||
|
|
||
| - We could leave the noop initalizers in Ember Data and continue to support them in Ember Data 3.0.0 and beyond. | ||
|
|
||
| # Unresolved questions | ||
|
|
||
| None | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we come up with a codemod?