Skip to content

RFC#1234 & RFC#1247: Drop the computed macro exports with EMBER_DROP_CLASSIC_FEATURES - #21740

Draft
NullVoxPopuli-ai-agent wants to merge 2 commits into
emberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/drop-computed-macros
Draft

NullVoxPopuli-ai-agent wants to merge 2 commits into
emberjs:mainfrom
NullVoxPopuli-ai-agent:nvp/drop-computed-macros

Conversation

@NullVoxPopuli-ai-agent

Copy link
Copy Markdown
Contributor

Merge #21726 first. This PR sits on top of it. Review only the last commit, 82f2441334.

With EMBER_DROP_CLASSIC_FEATURES=true, @ember/object/computed exports undefined for the 15 macros of the deprecate-computed-macros deprecation (#21688):

alias, and, bool, deprecatingAlias, equal, gt, gte, lt, lte, match, not, oneWay, or, readOnly, reads

export const readOnly = (
  import.meta.env?.EMBER_DROP_CLASSIC_FEATURES ? undefined : macros.readOnly
) as typeof macros.readOnly;
  • The macros do not throw. They are not exported.
  • A cast keeps the published types without | undefined.
  • empty, notEmpty, none and the array macros stay, because other deprecations cover them.

Tests

  • The tests of these macros skip when the flag is set, as they skip when the deprecation is removed. This includes 13 tests in macro_decorators_test.js that check the "used without parameters" assertion.
  • length_test.js: one test used a deprecated macro, but did not skip when the deprecation is removed. It skips now.
  • New packages/@ember/object/tests/computed/drop_classic_features_test.js checks that the 15 exports are undefined. It registers only with the flag.

Checks

Mode Result
Default 9234 tests, 0 failures
ALL_DEPRECATIONS_ENABLED=true 9234 tests, 0 failures
OVERRIDE_DEPRECATION_VERSION=15.0.0 8257 tests, 0 failures
Production build 9071 tests, 0 failures
EMBER_DROP_CLASSIC_FEATURES=true 9235 tests, 0 failures

The type checks of the internals and of the published types (with and without stable decorators), eslint, prettier and the docs check pass.

🤖 Generated with Claude Code

NullVoxPopuli and others added 2 commits October 17, 2026 16:06
`import.meta.env?.EMBER_DROP_CLASSIC_FEATURES` is a build-time flag for
RFC 1247. Later changes read it where a classic feature is defined, and
remove that feature from builds that set the flag.

- `ImportMetaEnv` declares the flag for the type checks.
- `EMBER_DROP_` is in the Vite `envPrefix`, so
  `EMBER_DROP_CLASSIC_FEATURES=true pnpm vite build` sets it for the tests.
- CI has a "Classic features dropped" variant that builds and tests with
  the flag.
- The hello-world smoke test sets the flag with a Vite `define` entry, so
  the package-size workflow measures an app without the classic features.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the flag, `@ember/object/computed` exports `undefined` for the 15
macros of the `deprecate-computed-macros` deprecation: `alias`, `and`,
`bool`, `deprecatingAlias`, `equal`, `gt`, `gte`, `lt`, `lte`, `match`,
`not`, `oneWay`, `or`, `readOnly` and `reads`. A cast keeps the published
types.

Tests of these macros skip with the flag, as they skip when the
deprecation is removed. A new test checks that the exports are `undefined`
in a build with the flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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