From 919279f4d488c44622a88f2eb8a5996185383aa7 Mon Sep 17 00:00:00 2001 From: bmac Date: Tue, 22 Nov 2016 16:46:01 -0500 Subject: [PATCH 1/3] Add RFC for deprecation Ember Data initializers --- .../0181-deprecate-ember-data-initializers.md | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 text/0181-deprecate-ember-data-initializers.md diff --git a/text/0181-deprecate-ember-data-initializers.md b/text/0181-deprecate-ember-data-initializers.md new file mode 100644 index 0000000000..71f7bc33ae --- /dev/null +++ b/text/0181-deprecate-ember-data-initializers.md @@ -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 initializers that Ember Data injects +into apps. The `ember-data` initializer not be changed and any code +that previously depended on the ordering of these initializers (via +the `before` or `after` properties on an initalizer) will can be +changed to use the `ember-data` initializers for ordering. + +# Motivation + +The intializes `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 have depending 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 who's `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 remove 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 there initalizers. + +# 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 From 81fe7e5b270a9ba5f54d645977fb47762970f037 Mon Sep 17 00:00:00 2001 From: bmac Date: Mon, 5 Dec 2016 14:59:55 -0500 Subject: [PATCH 2/3] Update the rfc based on pr feedback --- text/0181-deprecate-ember-data-initializers.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/text/0181-deprecate-ember-data-initializers.md b/text/0181-deprecate-ember-data-initializers.md index 71f7bc33ae..4f032ef0bd 100644 --- a/text/0181-deprecate-ember-data-initializers.md +++ b/text/0181-deprecate-ember-data-initializers.md @@ -5,19 +5,19 @@ # Summary The goal of this RFC is to remove the `data-adapter`, `injectStore`, -`transforms`, and `store` Ember initializers that Ember Data injects +`transforms`, and `store` Ember application initializers that Ember Data injects into apps. The `ember-data` initializer not be changed and any code that previously depended on the ordering of these initializers (via -the `before` or `after` properties on an initalizer) will can be +the `before` or `after` properties on an initalizer) can be changed to use the `ember-data` initializers for ordering. # Motivation -The intializes `data-adapter`, `injectStore`, `transforms`, and +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 have depending on these initializers +Data because existing apps may depend on these initializers for ordering their own initializers to run before or after Ember Data's setup code. @@ -25,16 +25,16 @@ 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 +`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 who's `before` or `after` properties depend on one of +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 +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 @@ -48,12 +48,12 @@ removed. # How We Teach This This change should have no impact on how we teach Ember or Ember -Data. The initalizers that will be remove have been unused for a long +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 there initalizers. +'ember-data'`, or `after: 'ember-data'` on their initializers. # Drawbacks From 0c24fab47abd0f5dd173f6273223f6c5236e073a Mon Sep 17 00:00:00 2001 From: Ricardo Mendes Date: Thu, 5 Jan 2017 12:55:02 +0000 Subject: [PATCH 3/3] Update 0181-deprecate-ember-data-initializers.md --- text/0181-deprecate-ember-data-initializers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0181-deprecate-ember-data-initializers.md b/text/0181-deprecate-ember-data-initializers.md index 4f032ef0bd..13ac7882ba 100644 --- a/text/0181-deprecate-ember-data-initializers.md +++ b/text/0181-deprecate-ember-data-initializers.md @@ -6,7 +6,7 @@ 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 not be changed and any code +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.