From e812b0e1ccbb31b05e77b5b2243510c01851d3d0 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:32:17 -0400 Subject: [PATCH 1/5] oops --- text/0690-deprecate-attrs-in-templates.md | 45 ++++------- ...1111-deprecate-attrs-in-templates-again.md | 74 +++++++++++++++++++ 2 files changed, 90 insertions(+), 29 deletions(-) create mode 100644 text/1111-deprecate-attrs-in-templates-again.md diff --git a/text/0690-deprecate-attrs-in-templates.md b/text/0690-deprecate-attrs-in-templates.md index 6619b2c7b1..60df328591 100644 --- a/text/0690-deprecate-attrs-in-templates.md +++ b/text/0690-deprecate-attrs-in-templates.md @@ -12,62 +12,49 @@ prs: project-link: --- -# Deprecate using `{{attrs}}` in templates +# Deprecate using `{{attrs}}` and {{this.attrs}} in templates ## Summary -The `{{attrs}}` object in templates is an alternative way for users to reference -named arguments directly in a template. +[RFC #690](https://github.com/emberjs/rfcs/pull/690) had some unfortunate timing where `{{attrs}}` was widely used, but before usage of `{{this.x}}` became widely common. As such, the deprecation messaging [implemented here](https://github.com/emberjs/ember.js/blob/0822efd9c0554f11d01232585596ac70c14a4306/packages/ember-template-compiler/lib/plugins/assert-against-attrs.ts#L58) only messaged in the case of `{{attrs}}`, rather than both `{{attrs}}` and `{{this.attrs}}`. + + +The RFC had intended, and even describes in its transition path to move away from `{{this.attrs}}`. [The code for the build time assertion](https://github.com/emberjs/ember.js/blob/0822efd9c0554f11d01232585596ac70c14a4306/packages/ember-template-compiler/lib/plugins/assert-against-attrs.ts#L84) even tried to handle the `{{this.attrs}}` case. + ```hbs -{{attrs.foo}} +{{attrs.foo}} and {{this.attrs.foo}} {{! is equivalent to }} -{{@foo}} +{{@foo}} and {{@foo}} ``` It was a legacy API that existed prior to named arguments being introduced in Ember, and has continued to be supported via a template transform for some time. -This RFC proposes that we deprecate this functionality in favor of directly -using named arguments. + +This RFC proposes that we immediately remove support for `{{this.attrs}}` in favor of named arguments. ## Motivation -The `{{attrs}}` syntax was from a previous iteration of the concepts that +The `{{attrs}}` / `{{this.attrs}}` syntax was from a previous iteration of the concepts that eventually became named argument syntax. Now that named arguments exist in the framework, and are considered the best practice, there is no reason to continue supporting this syntax. ## Transition Path -Users who currently rely on referencing `{{attrs}}` can convert their references -to named arguments. This should be highly codemoddable, and we will attempt to -make a codemod to help out with the transition. +Users who currently rely on referencing `{{attrs}}` or `{{this.attrs}}` can convert their references +to named arguments. ## How We Teach This ### Deprecation Guide -The `{{attrs}}` object was an alternative way to reference named arguments in -templates that was introduced prior to named arguments syntax being finalized. -References to properties on `{{attrs}}` can be converted directly to named -argument syntax. +The deprecation guide from [3.26.0](https://deprecations.emberjs.com/v3.x#toc_attrs-arg-access) is already sufficient. -Before: +## Alternatives -```hbs -{{attrs.foo}} -{{this.attrs.foo.bar}} -{{deeply (nested attrs.foobar.baz)}} -``` - -After: - -```hbs - {{@foo}} - {{@foo.bar}} - {{deeply (nested @foobar.baz)}} - ``` +pre-v6 deprecation. ## Drawbacks diff --git a/text/1111-deprecate-attrs-in-templates-again.md b/text/1111-deprecate-attrs-in-templates-again.md new file mode 100644 index 0000000000..6619b2c7b1 --- /dev/null +++ b/text/1111-deprecate-attrs-in-templates-again.md @@ -0,0 +1,74 @@ +--- +stage: recommended +start-date: 2020-12-22T00:00:00.000Z +release-date: 2021-03-22T00:00:00.000Z +release-versions: + ember-source: v3.26.0 + +teams: + - framework +prs: + accepted: https://github.com/emberjs/rfcs/pull/690 +project-link: +--- + +# Deprecate using `{{attrs}}` in templates + +## Summary + +The `{{attrs}}` object in templates is an alternative way for users to reference +named arguments directly in a template. + +```hbs +{{attrs.foo}} + +{{! is equivalent to }} +{{@foo}} +``` + +It was a legacy API that existed prior to named arguments being introduced in +Ember, and has continued to be supported via a template transform for some time. +This RFC proposes that we deprecate this functionality in favor of directly +using named arguments. + +## Motivation + +The `{{attrs}}` syntax was from a previous iteration of the concepts that +eventually became named argument syntax. Now that named arguments exist in the +framework, and are considered the best practice, there is no reason to continue +supporting this syntax. + +## Transition Path + +Users who currently rely on referencing `{{attrs}}` can convert their references +to named arguments. This should be highly codemoddable, and we will attempt to +make a codemod to help out with the transition. + +## How We Teach This + +### Deprecation Guide + +The `{{attrs}}` object was an alternative way to reference named arguments in +templates that was introduced prior to named arguments syntax being finalized. +References to properties on `{{attrs}}` can be converted directly to named +argument syntax. + +Before: + +```hbs +{{attrs.foo}} +{{this.attrs.foo.bar}} +{{deeply (nested attrs.foobar.baz)}} +``` + +After: + +```hbs + {{@foo}} + {{@foo.bar}} + {{deeply (nested @foobar.baz)}} + ``` + +## Drawbacks + +- None From 8c38f4a5e0cc7bf4ac24e449ceed6d9000cebbbe Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:33:28 -0400 Subject: [PATCH 2/5] oi --- text/0690-deprecate-attrs-in-templates.md | 45 +++++++---- .../1016-deprecate-this-attrs-in-templates.md | 61 +++++++++++++++ ...1111-deprecate-attrs-in-templates-again.md | 74 ------------------- 3 files changed, 90 insertions(+), 90 deletions(-) create mode 100644 text/1016-deprecate-this-attrs-in-templates.md delete mode 100644 text/1111-deprecate-attrs-in-templates-again.md diff --git a/text/0690-deprecate-attrs-in-templates.md b/text/0690-deprecate-attrs-in-templates.md index 60df328591..6619b2c7b1 100644 --- a/text/0690-deprecate-attrs-in-templates.md +++ b/text/0690-deprecate-attrs-in-templates.md @@ -12,49 +12,62 @@ prs: project-link: --- -# Deprecate using `{{attrs}}` and {{this.attrs}} in templates +# Deprecate using `{{attrs}}` in templates ## Summary -[RFC #690](https://github.com/emberjs/rfcs/pull/690) had some unfortunate timing where `{{attrs}}` was widely used, but before usage of `{{this.x}}` became widely common. As such, the deprecation messaging [implemented here](https://github.com/emberjs/ember.js/blob/0822efd9c0554f11d01232585596ac70c14a4306/packages/ember-template-compiler/lib/plugins/assert-against-attrs.ts#L58) only messaged in the case of `{{attrs}}`, rather than both `{{attrs}}` and `{{this.attrs}}`. - - -The RFC had intended, and even describes in its transition path to move away from `{{this.attrs}}`. [The code for the build time assertion](https://github.com/emberjs/ember.js/blob/0822efd9c0554f11d01232585596ac70c14a4306/packages/ember-template-compiler/lib/plugins/assert-against-attrs.ts#L84) even tried to handle the `{{this.attrs}}` case. - +The `{{attrs}}` object in templates is an alternative way for users to reference +named arguments directly in a template. ```hbs -{{attrs.foo}} and {{this.attrs.foo}} +{{attrs.foo}} {{! is equivalent to }} -{{@foo}} and {{@foo}} +{{@foo}} ``` It was a legacy API that existed prior to named arguments being introduced in Ember, and has continued to be supported via a template transform for some time. - -This RFC proposes that we immediately remove support for `{{this.attrs}}` in favor of named arguments. +This RFC proposes that we deprecate this functionality in favor of directly +using named arguments. ## Motivation -The `{{attrs}}` / `{{this.attrs}}` syntax was from a previous iteration of the concepts that +The `{{attrs}}` syntax was from a previous iteration of the concepts that eventually became named argument syntax. Now that named arguments exist in the framework, and are considered the best practice, there is no reason to continue supporting this syntax. ## Transition Path -Users who currently rely on referencing `{{attrs}}` or `{{this.attrs}}` can convert their references -to named arguments. +Users who currently rely on referencing `{{attrs}}` can convert their references +to named arguments. This should be highly codemoddable, and we will attempt to +make a codemod to help out with the transition. ## How We Teach This ### Deprecation Guide -The deprecation guide from [3.26.0](https://deprecations.emberjs.com/v3.x#toc_attrs-arg-access) is already sufficient. +The `{{attrs}}` object was an alternative way to reference named arguments in +templates that was introduced prior to named arguments syntax being finalized. +References to properties on `{{attrs}}` can be converted directly to named +argument syntax. -## Alternatives +Before: -pre-v6 deprecation. +```hbs +{{attrs.foo}} +{{this.attrs.foo.bar}} +{{deeply (nested attrs.foobar.baz)}} +``` + +After: + +```hbs + {{@foo}} + {{@foo.bar}} + {{deeply (nested @foobar.baz)}} + ``` ## Drawbacks diff --git a/text/1016-deprecate-this-attrs-in-templates.md b/text/1016-deprecate-this-attrs-in-templates.md new file mode 100644 index 0000000000..60df328591 --- /dev/null +++ b/text/1016-deprecate-this-attrs-in-templates.md @@ -0,0 +1,61 @@ +--- +stage: recommended +start-date: 2020-12-22T00:00:00.000Z +release-date: 2021-03-22T00:00:00.000Z +release-versions: + ember-source: v3.26.0 + +teams: + - framework +prs: + accepted: https://github.com/emberjs/rfcs/pull/690 +project-link: +--- + +# Deprecate using `{{attrs}}` and {{this.attrs}} in templates + +## Summary + +[RFC #690](https://github.com/emberjs/rfcs/pull/690) had some unfortunate timing where `{{attrs}}` was widely used, but before usage of `{{this.x}}` became widely common. As such, the deprecation messaging [implemented here](https://github.com/emberjs/ember.js/blob/0822efd9c0554f11d01232585596ac70c14a4306/packages/ember-template-compiler/lib/plugins/assert-against-attrs.ts#L58) only messaged in the case of `{{attrs}}`, rather than both `{{attrs}}` and `{{this.attrs}}`. + + +The RFC had intended, and even describes in its transition path to move away from `{{this.attrs}}`. [The code for the build time assertion](https://github.com/emberjs/ember.js/blob/0822efd9c0554f11d01232585596ac70c14a4306/packages/ember-template-compiler/lib/plugins/assert-against-attrs.ts#L84) even tried to handle the `{{this.attrs}}` case. + + +```hbs +{{attrs.foo}} and {{this.attrs.foo}} + +{{! is equivalent to }} +{{@foo}} and {{@foo}} +``` + +It was a legacy API that existed prior to named arguments being introduced in +Ember, and has continued to be supported via a template transform for some time. + +This RFC proposes that we immediately remove support for `{{this.attrs}}` in favor of named arguments. + +## Motivation + +The `{{attrs}}` / `{{this.attrs}}` syntax was from a previous iteration of the concepts that +eventually became named argument syntax. Now that named arguments exist in the +framework, and are considered the best practice, there is no reason to continue +supporting this syntax. + +## Transition Path + +Users who currently rely on referencing `{{attrs}}` or `{{this.attrs}}` can convert their references +to named arguments. + +## How We Teach This + +### Deprecation Guide + +The deprecation guide from [3.26.0](https://deprecations.emberjs.com/v3.x#toc_attrs-arg-access) is already sufficient. + +## Alternatives + +pre-v6 deprecation. + +## Drawbacks + +- None diff --git a/text/1111-deprecate-attrs-in-templates-again.md b/text/1111-deprecate-attrs-in-templates-again.md deleted file mode 100644 index 6619b2c7b1..0000000000 --- a/text/1111-deprecate-attrs-in-templates-again.md +++ /dev/null @@ -1,74 +0,0 @@ ---- -stage: recommended -start-date: 2020-12-22T00:00:00.000Z -release-date: 2021-03-22T00:00:00.000Z -release-versions: - ember-source: v3.26.0 - -teams: - - framework -prs: - accepted: https://github.com/emberjs/rfcs/pull/690 -project-link: ---- - -# Deprecate using `{{attrs}}` in templates - -## Summary - -The `{{attrs}}` object in templates is an alternative way for users to reference -named arguments directly in a template. - -```hbs -{{attrs.foo}} - -{{! is equivalent to }} -{{@foo}} -``` - -It was a legacy API that existed prior to named arguments being introduced in -Ember, and has continued to be supported via a template transform for some time. -This RFC proposes that we deprecate this functionality in favor of directly -using named arguments. - -## Motivation - -The `{{attrs}}` syntax was from a previous iteration of the concepts that -eventually became named argument syntax. Now that named arguments exist in the -framework, and are considered the best practice, there is no reason to continue -supporting this syntax. - -## Transition Path - -Users who currently rely on referencing `{{attrs}}` can convert their references -to named arguments. This should be highly codemoddable, and we will attempt to -make a codemod to help out with the transition. - -## How We Teach This - -### Deprecation Guide - -The `{{attrs}}` object was an alternative way to reference named arguments in -templates that was introduced prior to named arguments syntax being finalized. -References to properties on `{{attrs}}` can be converted directly to named -argument syntax. - -Before: - -```hbs -{{attrs.foo}} -{{this.attrs.foo.bar}} -{{deeply (nested attrs.foobar.baz)}} -``` - -After: - -```hbs - {{@foo}} - {{@foo.bar}} - {{deeply (nested @foobar.baz)}} - ``` - -## Drawbacks - -- None From 03a4bc2a66fa9d468beaf5e2b3786dd40aac3d94 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:33:53 -0400 Subject: [PATCH 3/5] oi --- text/1016-deprecate-this-attrs-in-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/1016-deprecate-this-attrs-in-templates.md b/text/1016-deprecate-this-attrs-in-templates.md index 60df328591..5eaec4350b 100644 --- a/text/1016-deprecate-this-attrs-in-templates.md +++ b/text/1016-deprecate-this-attrs-in-templates.md @@ -8,7 +8,7 @@ release-versions: teams: - framework prs: - accepted: https://github.com/emberjs/rfcs/pull/690 + accepted: https://github.com/emberjs/rfcs/pull/1016 project-link: --- From 33a4fabe29c383dbbf9d6704fa7a6f9b6808c7b0 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:45:39 -0400 Subject: [PATCH 4/5] Use less crazy phrasing --- text/1016-deprecate-this-attrs-in-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/1016-deprecate-this-attrs-in-templates.md b/text/1016-deprecate-this-attrs-in-templates.md index 5eaec4350b..27ccf6881c 100644 --- a/text/1016-deprecate-this-attrs-in-templates.md +++ b/text/1016-deprecate-this-attrs-in-templates.md @@ -32,7 +32,7 @@ The RFC had intended, and even describes in its transition path to move away fro It was a legacy API that existed prior to named arguments being introduced in Ember, and has continued to be supported via a template transform for some time. -This RFC proposes that we immediately remove support for `{{this.attrs}}` in favor of named arguments. +This RFC proposes that we add a deprecation warning to the build-time assertion that forbids `{{attrs}}`, it will also forbid `{{this.attrs}}`. ## Motivation From 943b23adff40340829d0cb0b21778742e69d3ad1 Mon Sep 17 00:00:00 2001 From: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com> Date: Wed, 27 Mar 2024 17:46:11 -0400 Subject: [PATCH 5/5] Update stage --- text/1016-deprecate-this-attrs-in-templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/text/1016-deprecate-this-attrs-in-templates.md b/text/1016-deprecate-this-attrs-in-templates.md index 27ccf6881c..943fa9c7e2 100644 --- a/text/1016-deprecate-this-attrs-in-templates.md +++ b/text/1016-deprecate-this-attrs-in-templates.md @@ -1,5 +1,5 @@ --- -stage: recommended +stage: accepted start-date: 2020-12-22T00:00:00.000Z release-date: 2021-03-22T00:00:00.000Z release-versions: