From 601529667743d39d4657399a5248057df5d0a019 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 14 Nov 2021 07:29:43 -0600 Subject: [PATCH 01/25] Deprecate implicit record loading in Ember Route --- text/0774-implicit-record-route-loading.md | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 text/0774-implicit-record-route-loading.md diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md new file mode 100644 index 0000000000..b5e8ef9d15 --- /dev/null +++ b/text/0774-implicit-record-route-loading.md @@ -0,0 +1,85 @@ +--- +Stage: Initial +Start Date: 2021-11-14 +Release Date: Unreleased +Release Versions: + ember-source: vX.Y.Z + ember-data: vX.Y.Z +Relevant Team(s): Ember.js +RFC PR: https://github.com/emberjs/rfcs/pull/774 +--- + +# Deprecate Implicit Record Loading in Routes + +## Summary + +This RFC seeks to deprecate and remove the default record loading behaviour on Ember's Route. By consequence, this will also deprecate and remove the default store on every Route. This behaviour is likely something you either know you have or do not know but it may be occuring in your app. + +```js +export default class PostRoute extends Route { + beforeModel() { + // do stuff + } + + afterModel() { + // do stuff + } +} +``` + +In this example, the `model` hook is not defined. However, Ember will attempt to try a few things before rendering this route's template. + +1. If there is a `store` property on your route, it will attempt to call it's `find` method. Assuming you have `ember-data` installed, you may be expecting this. The arguments will be extracted from the params. + a. For example, if a dynamic segment is `:post_id`, there exists logic to split on the underscore and and find a record of type `post`. + +2. As a fallback, it will attempt to defined a `find` method and use your `Model` instance's find method to fetch. If no `find` method exists, an assertion is thrown. + +## Motivation + +If a user does not define a `model` hook, a side effect of going to the network has long confused developers. Users have come to associate `Route.model()` with a hook that returns `ember-data` models in the absense of explicit injection. While this can be true, it is not wholly true. New patterns of data loading are becoming accepted in the community including opting to fetch data in a Component or using different libraries. + +By removing this behaviour, we will encourage developers to explicitly define what data is being fetched and from where. + +## Detailed design + +We will issue a deprecation to `findModel` notifying the user that if they want to continue this behaviour of attempting to fetch a resource implicitly, they should try and replicate with their own explicitly defined `model` hook. This will not remove returning the `transition` context when no `model` hook is defined. + +## How we teach this + +Most of this behaviour is lightly documented. Developers often come to this by mistake after some difficult searching. First, we will have to remove this sentence from the [docs](https://guides.emberjs.com/release/routing/defining-your-routes/#toc_dynamic-segments). + +> The first reason is that Routes know how to fetch the right model by default, if you follow the convention. + +A direct one to one replacement might look like this. + +```js +import { inject as service } from '@ember/service'; + +export default class PostRoute extends Route { + // assuming you have ember-data installed + @service store; + + beforeModel() { + // do stuff + } + + model({ post_id }) { + return this.store.find('post', post_id); + } + + afterModel() { + // do stuff + } +} +``` + +## Alternatives + +- Continue to provide fallback fetching behaviour but ensure no `assert` is called for users that neither a store nor a `Model` with a `find` method. + +## Open Questions + +## Related links and RFCs +- [Deprecate defaultStore located at `Route.store`](https://github.com/emberjs/rfcs/issues/377) +- [Pre-RFC: Deprecate implicit injections (owner.inject)](https://github.com/emberjs/rfcs/issues/508) +- [Deprecate implicit record loading in routes](https://github.com/emberjs/rfcs/issues/557) From 7493a7d7c0078de222e4810dec0fa920361d5bf8 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 14 Nov 2021 08:42:00 -0600 Subject: [PATCH 02/25] Update text/0774-implicit-record-route-loading.md Co-authored-by: Bert De Block --- text/0774-implicit-record-route-loading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index b5e8ef9d15..22cfbd253d 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -30,7 +30,7 @@ export default class PostRoute extends Route { In this example, the `model` hook is not defined. However, Ember will attempt to try a few things before rendering this route's template. 1. If there is a `store` property on your route, it will attempt to call it's `find` method. Assuming you have `ember-data` installed, you may be expecting this. The arguments will be extracted from the params. - a. For example, if a dynamic segment is `:post_id`, there exists logic to split on the underscore and and find a record of type `post`. + a. For example, if a dynamic segment is `:post_id`, there exists logic to split on the underscore and find a record of type `post`. 2. As a fallback, it will attempt to defined a `find` method and use your `Model` instance's find method to fetch. If no `find` method exists, an assertion is thrown. From 80facdd46bc9becf2a4511e2ccf67346fd09305d Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 14 Nov 2021 08:42:11 -0600 Subject: [PATCH 03/25] Update text/0774-implicit-record-route-loading.md Co-authored-by: Bert De Block --- text/0774-implicit-record-route-loading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index 22cfbd253d..30d8fd5aed 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -75,7 +75,7 @@ export default class PostRoute extends Route { ## Alternatives -- Continue to provide fallback fetching behaviour but ensure no `assert` is called for users that neither a store nor a `Model` with a `find` method. +- Continue to provide fallback fetching behaviour but ensure no `assert` is called for users that have neither a store nor a `Model` with a `find` method. ## Open Questions From 0c16882023ab440b5c550ce846a930b1e8e73a57 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 14 Nov 2021 08:42:16 -0600 Subject: [PATCH 04/25] Update text/0774-implicit-record-route-loading.md Co-authored-by: Bert De Block --- text/0774-implicit-record-route-loading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index 30d8fd5aed..20db1fcbda 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -32,7 +32,7 @@ In this example, the `model` hook is not defined. However, Ember will attempt t 1. If there is a `store` property on your route, it will attempt to call it's `find` method. Assuming you have `ember-data` installed, you may be expecting this. The arguments will be extracted from the params. a. For example, if a dynamic segment is `:post_id`, there exists logic to split on the underscore and find a record of type `post`. -2. As a fallback, it will attempt to defined a `find` method and use your `Model` instance's find method to fetch. If no `find` method exists, an assertion is thrown. +2. As a fallback, it will attempt to define a `find` method and use your `Model` instance's find method to fetch. If no `find` method exists, an assertion is thrown. ## Motivation From 953677859ad69e4d644459ada704276736cbcfa0 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 14 Nov 2021 08:42:22 -0600 Subject: [PATCH 05/25] Update text/0774-implicit-record-route-loading.md Co-authored-by: Bert De Block --- text/0774-implicit-record-route-loading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index 20db1fcbda..c1d4678861 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -1,5 +1,5 @@ --- -Stage: Initial +Stage: Accepted Start Date: 2021-11-14 Release Date: Unreleased Release Versions: From 537653e7b568043a58eb210d21cf745faf11ad73 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 14 Nov 2021 08:43:07 -0600 Subject: [PATCH 06/25] findRecrod instead of find --- text/0774-implicit-record-route-loading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index c1d4678861..9a9a695fd6 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -64,7 +64,7 @@ export default class PostRoute extends Route { } model({ post_id }) { - return this.store.find('post', post_id); + return this.store.findRecord('post', post_id); } afterModel() { From 4419a8fb27a0b1f32e7c755bcde786831eb11e9a Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 14 Nov 2021 09:00:11 -0600 Subject: [PATCH 07/25] clarify removal --- text/0774-implicit-record-route-loading.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index 9a9a695fd6..ed005ea13b 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -42,7 +42,9 @@ By removing this behaviour, we will encourage developers to explicitly define wh ## Detailed design -We will issue a deprecation to `findModel` notifying the user that if they want to continue this behaviour of attempting to fetch a resource implicitly, they should try and replicate with their own explicitly defined `model` hook. This will not remove returning the `transition` context when no `model` hook is defined. +We will issue a deprecation to [`findModel`](https://github.com/emberjs/ember.js/blob/017b11e2f58880869a5b8c647bf7f3199fc07f26/packages/%40ember/-internals/routing/lib/system/route.ts#L1376) notifying the user that if they want to continue this behaviour of attempting to fetch a resource implicitly, they should try and replicate with their own explicitly defined `model` hook. + +In v5.0.0, we will remove `findModel` and logic to determine arguments for this method. This will not remove returning the `transition` context when no `model` hook is defined. ## How we teach this From a3d9b56cd7eec1360bc4bcbed13e4fb4c2725f78 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 2 Oct 2022 20:44:51 -0500 Subject: [PATCH 08/25] add language for optional feature --- text/0774-implicit-record-route-loading.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index ed005ea13b..7cff29fc82 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -44,6 +44,8 @@ By removing this behaviour, we will encourage developers to explicitly define wh We will issue a deprecation to [`findModel`](https://github.com/emberjs/ember.js/blob/017b11e2f58880869a5b8c647bf7f3199fc07f26/packages/%40ember/-internals/routing/lib/system/route.ts#L1376) notifying the user that if they want to continue this behaviour of attempting to fetch a resource implicitly, they should try and replicate with their own explicitly defined `model` hook. +In addition, we will include an [optional feature](https://github.com/emberjs/ember-optional-features) to disable this feature and clear the deprecation. + In v5.0.0, we will remove `findModel` and logic to determine arguments for this method. This will not remove returning the `transition` context when no `model` hook is defined. ## How we teach this From 60a8f3ab22c52b79f257936332410f92aa0e6a55 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 2 Oct 2022 20:49:38 -0500 Subject: [PATCH 09/25] update header --- text/0774-implicit-record-route-loading.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index 7cff29fc82..b1fe2168ec 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -1,12 +1,12 @@ --- -Stage: Accepted -Start Date: 2021-11-14 -Release Date: Unreleased -Release Versions: - ember-source: vX.Y.Z - ember-data: vX.Y.Z -Relevant Team(s): Ember.js -RFC PR: https://github.com/emberjs/rfcs/pull/774 +stage: accepted +start-date: 2021-11-14 +release-date: +release-versions: +teams: # delete teams that aren't relevant + - framework +prs: + accepted: https://github.com/emberjs/rfcs/pull/774 --- # Deprecate Implicit Record Loading in Routes From 47dbda3a5b23d7ef3e858b77d182f25bd48c4f9d Mon Sep 17 00:00:00 2001 From: wagenet Date: Wed, 23 Nov 2022 17:11:29 +0000 Subject: [PATCH 10/25] Advance RFC to Stage recommended --- text/0756-helper-default-manager.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/text/0756-helper-default-manager.md b/text/0756-helper-default-manager.md index 005410f1f6..fe6dda6737 100644 --- a/text/0756-helper-default-manager.md +++ b/text/0756-helper-default-manager.md @@ -1,15 +1,14 @@ --- -stage: released # FIXME: This may be recommended +stage: recommended start-date: 2021-05-17T00:00:00.000Z release-date: 2022-05-13T00:00:00.000Z release-versions: ember-source: v4.5.0 - teams: - framework - learning prs: - accepted: https://github.com/emberjs/rfcs/pull/756 + accepted: 'https://github.com/emberjs/rfcs/pull/756' project-link: --- @@ -156,7 +155,7 @@ setHelperManager(() => DEFAULT_HELPER_MANAGER, Function.prototype); - when the "helper" is created, the function is not invoked - when `getValue` is invoked, - the function is invoked with the named arguments all grouped into the last arg - - if no named arguments are given, an empty object is used instead to allow less nullish checking in userland + - if no named arguments are given, an empty object is used instead to allow lessish checking in userland - to register this helper manager, it should occur during app boot so developers do not need to import anything to trigger the `setHelperManager` call From 42dd05a30639606222c4e2c2ff2774d29df08e88 Mon Sep 17 00:00:00 2001 From: "Ember.js RFCS CI" Date: Wed, 23 Nov 2022 17:11:33 +0000 Subject: [PATCH 11/25] Update RFC 0756 recommended PR URL --- text/0756-helper-default-manager.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/0756-helper-default-manager.md b/text/0756-helper-default-manager.md index fe6dda6737..1af73dbe98 100644 --- a/text/0756-helper-default-manager.md +++ b/text/0756-helper-default-manager.md @@ -9,6 +9,7 @@ teams: - learning prs: accepted: 'https://github.com/emberjs/rfcs/pull/756' + recommended: 'https://github.com/emberjs/rfcs/pull/866' project-link: --- From a982f6b5dbc6d50bc3acb2c30bc9b428c59f534c Mon Sep 17 00:00:00 2001 From: wagenet Date: Thu, 29 Dec 2022 18:42:54 +0000 Subject: [PATCH 12/25] Advance RFC to Stage ready-for-release --- text/0889-deprecate-ember-error.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/text/0889-deprecate-ember-error.md b/text/0889-deprecate-ember-error.md index eb7c931908..c0c52516d6 100644 --- a/text/0889-deprecate-ember-error.md +++ b/text/0889-deprecate-ember-error.md @@ -1,13 +1,13 @@ --- -stage: accepted -start-date: 2022-12-15 +stage: ready-for-release +start-date: 2022-12-15T00:00:00.000Z release-date: release-versions: -teams: # delete teams that aren't relevant +teams: - framework - typescript prs: - accepted: https://github.com/emberjs/rfcs/pull/889 + accepted: 'https://github.com/emberjs/rfcs/pull/889' project-link: --- From 347a196199676ef577541841307de958c71ebc01 Mon Sep 17 00:00:00 2001 From: wagenet Date: Tue, 3 Jan 2023 22:58:27 +0000 Subject: [PATCH 13/25] Advance RFC to Stage ready-for-release --- text/0236-deprecation-ember-string.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/text/0236-deprecation-ember-string.md b/text/0236-deprecation-ember-string.md index 880de8d972..d61cf4ee89 100644 --- a/text/0236-deprecation-ember-string.md +++ b/text/0236-deprecation-ember-string.md @@ -1,5 +1,5 @@ --- -stage: accepted +stage: ready-for-release start-date: 2017-07-14T00:00:00.000Z release-date: 2020-12-28T00:00:00.000Z release-versions: @@ -7,10 +7,10 @@ teams: - framework - typescript prs: - accepted: https://github.com/emberjs/rfcs/pull/236 + accepted: 'https://github.com/emberjs/rfcs/pull/236' project-link: meta: - tracking: https://github.com/emberjs/rfc-tracking/issues/26 + tracking: 'https://github.com/emberjs/rfc-tracking/issues/26' --- # Summary From 1ed8e8cfe6ea48fe9d6d1c488f7f529bb180b332 Mon Sep 17 00:00:00 2001 From: "Ember.js RFCS CI" Date: Tue, 3 Jan 2023 22:58:32 +0000 Subject: [PATCH 14/25] Update RFC 0236 ready-for-release PR URL --- text/0236-deprecation-ember-string.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/0236-deprecation-ember-string.md b/text/0236-deprecation-ember-string.md index d61cf4ee89..d588e959e0 100644 --- a/text/0236-deprecation-ember-string.md +++ b/text/0236-deprecation-ember-string.md @@ -8,6 +8,7 @@ teams: - typescript prs: accepted: 'https://github.com/emberjs/rfcs/pull/236' + ready-for-release: 'https://github.com/emberjs/rfcs/pull/892' project-link: meta: tracking: 'https://github.com/emberjs/rfc-tracking/issues/26' From 1c2ac17ff64eb11e9a3672dbec1d5524747e2f00 Mon Sep 17 00:00:00 2001 From: Peter Wagenet Date: Tue, 3 Jan 2023 14:59:33 -0800 Subject: [PATCH 15/25] Update tracking --- text/0236-deprecation-ember-string.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text/0236-deprecation-ember-string.md b/text/0236-deprecation-ember-string.md index d588e959e0..3823aeea66 100644 --- a/text/0236-deprecation-ember-string.md +++ b/text/0236-deprecation-ember-string.md @@ -11,7 +11,8 @@ prs: ready-for-release: 'https://github.com/emberjs/rfcs/pull/892' project-link: meta: - tracking: 'https://github.com/emberjs/rfc-tracking/issues/26' + tracking: 'https://github.com/emberjs/ember.js/issues/20340' + legacy-tracking: 'https://github.com/emberjs/rfc-tracking/issues/26' --- # Summary From 29a51c2e5d5b7a7324d4a99b465442878017938b Mon Sep 17 00:00:00 2001 From: kategengler Date: Fri, 13 Jan 2023 19:32:39 +0000 Subject: [PATCH 16/25] Advance RFC to Stage released --- text/0236-deprecation-ember-string.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0236-deprecation-ember-string.md b/text/0236-deprecation-ember-string.md index 3823aeea66..db4d8b8f8c 100644 --- a/text/0236-deprecation-ember-string.md +++ b/text/0236-deprecation-ember-string.md @@ -1,5 +1,5 @@ --- -stage: ready-for-release +stage: released start-date: 2017-07-14T00:00:00.000Z release-date: 2020-12-28T00:00:00.000Z release-versions: From d837ea6ff86ec9b7168e41a15e63269f3d086cec Mon Sep 17 00:00:00 2001 From: "Ember.js RFCS CI" Date: Fri, 13 Jan 2023 19:32:43 +0000 Subject: [PATCH 17/25] Update RFC 0236 released PR URL --- text/0236-deprecation-ember-string.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/0236-deprecation-ember-string.md b/text/0236-deprecation-ember-string.md index db4d8b8f8c..8704553312 100644 --- a/text/0236-deprecation-ember-string.md +++ b/text/0236-deprecation-ember-string.md @@ -9,6 +9,7 @@ teams: prs: accepted: 'https://github.com/emberjs/rfcs/pull/236' ready-for-release: 'https://github.com/emberjs/rfcs/pull/892' + released: 'https://github.com/emberjs/rfcs/pull/897' project-link: meta: tracking: 'https://github.com/emberjs/ember.js/issues/20340' From ea28669fba086c7e68c82b63ada5a8d457a62031 Mon Sep 17 00:00:00 2001 From: Peter Wagenet Date: Fri, 13 Jan 2023 15:55:26 -0800 Subject: [PATCH 18/25] Update RFC 236 release version --- text/0236-deprecation-ember-string.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text/0236-deprecation-ember-string.md b/text/0236-deprecation-ember-string.md index 8704553312..fde9040c75 100644 --- a/text/0236-deprecation-ember-string.md +++ b/text/0236-deprecation-ember-string.md @@ -1,8 +1,9 @@ --- stage: released start-date: 2017-07-14T00:00:00.000Z -release-date: 2020-12-28T00:00:00.000Z +release-date: 2023-01-12T00:00:00.000Z release-versions: + ember-source: v4.10.0 teams: - framework - typescript From 2e8792458cdc7c6b683f617c73b4ceb2143d7e39 Mon Sep 17 00:00:00 2001 From: wagenet Date: Tue, 10 Jan 2023 19:09:46 +0000 Subject: [PATCH 19/25] Advance RFC to Stage released --- text/0889-deprecate-ember-error.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0889-deprecate-ember-error.md b/text/0889-deprecate-ember-error.md index c0c52516d6..1f20b9a355 100644 --- a/text/0889-deprecate-ember-error.md +++ b/text/0889-deprecate-ember-error.md @@ -1,5 +1,5 @@ --- -stage: ready-for-release +stage: released start-date: 2022-12-15T00:00:00.000Z release-date: release-versions: From 16e635881273ba1dc8a6f273de3201f88266aefa Mon Sep 17 00:00:00 2001 From: "Ember.js RFCS CI" Date: Tue, 10 Jan 2023 19:09:51 +0000 Subject: [PATCH 20/25] Update RFC 0889 released PR URL --- text/0889-deprecate-ember-error.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/0889-deprecate-ember-error.md b/text/0889-deprecate-ember-error.md index 1f20b9a355..2bd0b1657f 100644 --- a/text/0889-deprecate-ember-error.md +++ b/text/0889-deprecate-ember-error.md @@ -8,6 +8,7 @@ teams: - typescript prs: accepted: 'https://github.com/emberjs/rfcs/pull/889' + released: 'https://github.com/emberjs/rfcs/pull/895' project-link: --- From 66345858d78200564c24e2047b44a8b4c4c2e798 Mon Sep 17 00:00:00 2001 From: Peter Wagenet Date: Fri, 13 Jan 2023 16:06:44 -0800 Subject: [PATCH 21/25] Update release date for RFC 889 --- text/0889-deprecate-ember-error.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text/0889-deprecate-ember-error.md b/text/0889-deprecate-ember-error.md index 2bd0b1657f..741412a19c 100644 --- a/text/0889-deprecate-ember-error.md +++ b/text/0889-deprecate-ember-error.md @@ -1,8 +1,9 @@ --- stage: released start-date: 2022-12-15T00:00:00.000Z -release-date: +release-date: 2023-01-12T00:00:00.000Z release-versions: + ember-source: v4.10.0 teams: - framework - typescript From a7a1462d70e0f01d82700647c23c06c972fb17ac Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Fri, 3 Feb 2023 14:12:47 -0500 Subject: [PATCH 22/25] Update 0756-helper-default-manager.md --- text/0756-helper-default-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0756-helper-default-manager.md b/text/0756-helper-default-manager.md index 1af73dbe98..f60738c618 100644 --- a/text/0756-helper-default-manager.md +++ b/text/0756-helper-default-manager.md @@ -156,7 +156,7 @@ setHelperManager(() => DEFAULT_HELPER_MANAGER, Function.prototype); - when the "helper" is created, the function is not invoked - when `getValue` is invoked, - the function is invoked with the named arguments all grouped into the last arg - - if no named arguments are given, an empty object is used instead to allow lessish checking in userland + - if no named arguments are given, an empty object is used instead to allow less nullish checking in userland - to register this helper manager, it should occur during app boot so developers do not need to import anything to trigger the `setHelperManager` call From d22616f97fb296aa9d2f6b5733a094551723646f Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Fri, 3 Feb 2023 14:19:03 -0500 Subject: [PATCH 23/25] Update text/0774-implicit-record-route-loading.md Co-authored-by: Peter Wagenet --- text/0774-implicit-record-route-loading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index b1fe2168ec..1f10b82d1f 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -32,7 +32,7 @@ In this example, the `model` hook is not defined. However, Ember will attempt t 1. If there is a `store` property on your route, it will attempt to call it's `find` method. Assuming you have `ember-data` installed, you may be expecting this. The arguments will be extracted from the params. a. For example, if a dynamic segment is `:post_id`, there exists logic to split on the underscore and find a record of type `post`. -2. As a fallback, it will attempt to define a `find` method and use your `Model` instance's find method to fetch. If no `find` method exists, an assertion is thrown. +2. As a fallback, it will attempt to define a `find` method and use your `Model` instance's find method to fetch. If a `Model` cannot be found or if the found `Model` does not have a `find` method, an assertion is thrown. ## Motivation From 5353a68c5e16b58d20fad1635b35452b0ea56fac Mon Sep 17 00:00:00 2001 From: Edward Faulkner Date: Fri, 3 Feb 2023 14:19:17 -0500 Subject: [PATCH 24/25] Update text/0774-implicit-record-route-loading.md Co-authored-by: Peter Wagenet --- text/0774-implicit-record-route-loading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/0774-implicit-record-route-loading.md b/text/0774-implicit-record-route-loading.md index 1f10b82d1f..3a5ae917d5 100644 --- a/text/0774-implicit-record-route-loading.md +++ b/text/0774-implicit-record-route-loading.md @@ -46,7 +46,7 @@ We will issue a deprecation to [`findModel`](https://github.com/emberjs/ember.js In addition, we will include an [optional feature](https://github.com/emberjs/ember-optional-features) to disable this feature and clear the deprecation. -In v5.0.0, we will remove `findModel` and logic to determine arguments for this method. This will not remove returning the `transition` context when no `model` hook is defined. +In v6.0.0, we will remove `findModel` and logic to determine arguments for this method. This will not remove returning the `transition` context when no `model` hook is defined. ## How we teach this From cd60c8d4c21d4b469a6a9184aac3b3f4e897b6ad Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Mon, 6 Feb 2023 17:25:23 -0500 Subject: [PATCH 25/25] Add title of RFC to advancement PR titles - Update to v3.0.0 of rfcs-tooling --- .github/actions/setup-rfcs-tooling/action.yml | 2 +- .github/workflows/advance-rfc.yml | 4 ++-- .github/workflows/ci.yml | 2 +- .github/workflows/generate-rfc-frontmatter-json.yml | 2 +- .github/workflows/newly-added-rfcs.yml | 7 +++---- .github/workflows/open-advancement-pr.yml | 12 +++++++----- .github/workflows/trigger-opening-advancement-pr.yml | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/actions/setup-rfcs-tooling/action.yml b/.github/actions/setup-rfcs-tooling/action.yml index 27fd7e2e65..33620eb09e 100644 --- a/.github/actions/setup-rfcs-tooling/action.yml +++ b/.github/actions/setup-rfcs-tooling/action.yml @@ -9,7 +9,7 @@ runs: with: repository: emberjs/rfcs-tooling path: rfcs-tooling - ref: 'v2.1.1' + ref: 'v3.0.0' - uses: actions/setup-node@v3 with: diff --git a/.github/workflows/advance-rfc.yml b/.github/workflows/advance-rfc.yml index c0a26ec85d..a084753ab8 100644 --- a/.github/workflows/advance-rfc.yml +++ b/.github/workflows/advance-rfc.yml @@ -55,7 +55,7 @@ jobs: echo "A new RFC was added" echo "value=true" >> $GITHUB_OUTPUT else - node rfcs-tooling/has-stage-changed.js ${{ github.event.before }} ${{ steps.rfcs.outputs.modified-rfc }} + node rfcs-tooling/scripts/has-stage-changed.mjs ${{ github.event.before }} ${{ steps.rfcs.outputs.modified-rfc }} if [[ $? == 0 ]]; then echo "## Yes, stage has changed" >> $GITHUB_STEP_SUMMARY echo "value=true" >> $GITHUB_OUTPUT @@ -69,7 +69,7 @@ jobs: if: steps.has-stage-changed.outputs.value == 'true' id: new-stage run: | - new_stage=`node rfcs-tooling/find-next-stage.js ${{ steps.rfcs.outputs.modified-rfc }}` + new_stage=`node rfcs-tooling/scripts/find-next-stage.mjs ${{ steps.rfcs.outputs.modified-rfc }}` echo "New Stage: $new_stage" echo "value=$new_stage" >> $GITHUB_OUTPUT diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d282623b5..244c1481a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,4 +15,4 @@ jobs: uses: ./.github/actions/setup-rfcs-tooling - name: Lint the frontmatter of all RFCs - run: node ./rfcs-tooling/lint-rfc-frontmatter.js text/*.md + run: node ./rfcs-tooling/scripts/lint-rfc-frontmatter.mjs text/*.md diff --git a/.github/workflows/generate-rfc-frontmatter-json.yml b/.github/workflows/generate-rfc-frontmatter-json.yml index ae0429662b..fbc963bccd 100644 --- a/.github/workflows/generate-rfc-frontmatter-json.yml +++ b/.github/workflows/generate-rfc-frontmatter-json.yml @@ -18,7 +18,7 @@ jobs: - name: Generate frontmatter data file run: | - node rfcs-tooling/list-frontmatter.js text/*.md > rfc-data.json + node rfcs-tooling/scripts/list-frontmatter.mjs text/*.md > rfc-data.json - uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/newly-added-rfcs.yml b/.github/workflows/newly-added-rfcs.yml index 4331efa33d..bf6266a2f4 100644 --- a/.github/workflows/newly-added-rfcs.yml +++ b/.github/workflows/newly-added-rfcs.yml @@ -92,7 +92,7 @@ jobs: - name: Verify stage of newly added RFC is `accepted` in frontmatter run: | - frontmatter=`node rfcs-tooling/rfc-frontmatter.js ${{ needs.check-rfcs.outputs.modified-rfc }}` + frontmatter=`node rfcs-tooling/scripts/rfc-frontmatter.mjs ${{ needs.check-rfcs.outputs.modified-rfc }}` stage=`echo $frontmatter | jq '.stage'` if [[ $stage != '"accepted"' ]]; then echo "::error::Newly added RFCs must have the stage 'accepted' in the frontmatter" @@ -113,8 +113,7 @@ jobs: - name: Test RFC Filename matches PR Number that adds it env: PR_NUMBER: ${{ github.event.pull_request.number }} - run: node check-filename-matches-pr.js $PR_NUMBER ${{ needs.check-rfcs.outputs.modified-rfc }} - working-directory: rfcs-tooling + run: node rfcs-tooling/scripts/check-filename-matches-pr.mjs $PR_NUMBER ${{ needs.check-rfcs.outputs.modified-rfc }} check-accepted-pr-url: name: Verify Accepted PR URL is correct @@ -129,7 +128,7 @@ jobs: - name: Verify Accepted PR URL is correct run: | - frontmatter=`node rfcs-tooling/rfc-frontmatter.js ${{ needs.check-rfcs.outputs.modified-rfc }}` + frontmatter=`node rfcs-tooling/scripts/rfc-frontmatter.mjs ${{ needs.check-rfcs.outputs.modified-rfc }}` accepted_pr=`echo $frontmatter | jq '.prs.accepted'` accepted_pr=${accepted_pr//\"/} expected_pr="${{ github.event.pull_request.html_url }}" diff --git a/.github/workflows/open-advancement-pr.yml b/.github/workflows/open-advancement-pr.yml index a4e59a87dc..9141138b1b 100644 --- a/.github/workflows/open-advancement-pr.yml +++ b/.github/workflows/open-advancement-pr.yml @@ -28,16 +28,17 @@ jobs: - name: Update frontmatter run: | - node rfcs-tooling/update-rfc-stage.js ${{ inputs.new-stage }} ${{ inputs.rfc-path }} + node rfcs-tooling/scripts/update-rfc-stage.mjs ${{ inputs.new-stage }} ${{ inputs.rfc-path }} - name: Set variables for use in PR id: pr-variables run: | - frontmatter=`node rfcs-tooling/rfc-frontmatter.js ${{ inputs.rfc-path }}` + frontmatter=`node rfcs-tooling/scripts/rfc-frontmatter.mjs ${{ inputs.rfc-path }}` ready_for_release_pr=`echo $frontmatter | jq '.prs."ready-for-release"'` ready_for_release_pr=${ready_for_release_pr//\"/} released_pr=`echo $frontmatter | jq '.prs.released'` released_pr=${released_pr//\"/} + title=`echo $frontmatter | jq '.title'` if [[ ${{ inputs.new-stage }} == "ready-for-release" ]]; then pretty_stage="Ready for Release" template=`sed -e 's/__RFC_NUMBER__/${{ inputs.rfc-number }}/g' .github/PULL_REQUEST_TEMPLATE/advance-to-ready-for-release.md` @@ -53,23 +54,24 @@ jobs: echo 'EOF' >> $GITHUB_OUTPUT echo "Pretty Stage: $pretty_stage" echo "pretty-stage=$pretty_stage" >> $GITHUB_OUTPUT + echo "title=$title" >> $GITHUB_OUTPUT - name: Open PR id: create-pr uses: peter-evans/create-pull-request@v4.2.0 with: token: ${{ secrets.personal-access-token }} - commit-message: "Advance RFC to Stage ${{ inputs.new-stage }}" + commit-message: "Advance RFC {{ inputs.rfc-number }} to Stage ${{ inputs.new-stage }}" add-paths: 'text' branch: "advance-rfc-${{ inputs.rfc-number }}" - title: "Advance RFC #${{ inputs.rfc-number}} to Stage ${{ steps.pr-variables.outputs.pretty-stage }}" + title: "Advance RFC #${{ inputs.rfc-number}} `${{ steps.pr-variables.outputs.title }}` to Stage ${{ steps.pr-variables.outputs.pretty-stage }}" body: "${{ steps.pr-variables.outputs.body }}" labels: "RFC Advancement,S-${{ steps.pr-variables.outputs.pretty-stage}}" draft: true - name: Add new PR link to RFC frontmatter run: | - node rfcs-tooling/update-advancement-pr.js ${{ inputs.rfc-path }} ${{ inputs.new-stage}} ${{ steps.create-pr.outputs.pull-request-url }} + node rfcs-tooling/scripts/update-advancement-pr.mjs ${{ inputs.rfc-path }} ${{ inputs.new-stage}} ${{ steps.create-pr.outputs.pull-request-url }} - name: Update PR run: | diff --git a/.github/workflows/trigger-opening-advancement-pr.yml b/.github/workflows/trigger-opening-advancement-pr.yml index 60c06b0b7b..1a72661d91 100644 --- a/.github/workflows/trigger-opening-advancement-pr.yml +++ b/.github/workflows/trigger-opening-advancement-pr.yml @@ -33,7 +33,7 @@ jobs: - name: Find new stage id: new-stage run: | - new_stage=`node rfcs-tooling/find-next-stage.js ${{ inputs.rfc-path }}` + new_stage=`node rfcs-tooling/scripts/find-next-stage.mjs ${{ inputs.rfc-path }}` echo "New Stage: $new_stage" echo "value=$new_stage" >> $GITHUB_OUTPUT