Skip to content

Adding stage3-compatible decorator implementations - #20507

Closed
ef4 wants to merge 3 commits into
mainfrom
stage3-decorators
Closed

ef4 wants to merge 3 commits into
mainfrom
stage3-decorators

Conversation

@ef4

@ef4 ef4 commented Jul 22, 2023

Copy link
Copy Markdown
Contributor

(This should stay draft and not merge until we have some consensus on the ecosystem-spanning parts of the migration.)

This is an exploration to see how easy it is to make the ember-provided decorators work under both legacy decorators and stage3 decorators.

(I don't think it's hard!)

The first commit here implements @tracked. I tested it in an application with the configuration:

 const app = new EmberApp(defaults, {
    'ember-cli-babel': {
      disableDecoratorTransforms: true,
    },
    babel: {
      plugins: [
        [
          '@babel/plugin-proposal-decorators',
          {
            version: '2023-05',
          },
        ],
      ],
    },
  });

With those settings, @tracked foo becomes a runtime error and will tell you to use @tracked accessor foo instead, and when you do it all works correctly.

(This should stay draft and not merge until we have some consensus on the ecosystem-spanning parts of the migration.)

This is an exploration to see how easy it is to make the ember-provided decorators work under both legacy decorators and stage3 decorators.

(I don't think it's hard!)

The first commit here implements `@tracked`. I tested it in an application with the configuration:

```js
 const app = new EmberApp(defaults, {
    'ember-cli-babel': {
      disableDecoratorTransforms: true,
    },
    babel: {
      plugins: [
        [
          '@babel/plugin-proposal-decorators',
          {
            version: '2023-05',
          },
        ],
      ],
    },
  });
```

With those settings, `@tracked foo` becomes a runtime error and will tell you to use `@tracked accessor foo` instead, and when you do it all works correctly.
@ef4
ef4 marked this pull request as draft July 22, 2023 19:27
@kategengler

Copy link
Copy Markdown
Member

Is this still relevant? It is a draft PR

@ef4

ef4 commented Jun 5, 2024

Copy link
Copy Markdown
Contributor Author

Still planning to pick this back up. Now that the build refactor has landed it's a bit easier to test.

@ef4

ef4 commented Mar 9, 2025

Copy link
Copy Markdown
Contributor Author

Superseded by #20868

@ef4 ef4 closed this Mar 9, 2025
@kategengler
kategengler deleted the stage3-decorators branch June 1, 2026 18:28
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.

2 participants