Repository navigation
RFC#1234 & RFC#1247: Drop the computed exports with EMBER_DROP_CLASSIC_FEATURES - #21744
Draft
NullVoxPopuli-ai-agent wants to merge 3 commits into
Draft
NullVoxPopuli-ai-agent wants to merge 3 commits into
NullVoxPopuli-ai-agent wants to merge 3 commits into
Conversation
`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>
With the flag, the rest of the computed property API exports `undefined`:
- `computed` from `@ember/object`
- `dependentKeyCompat` from `@ember/object/compat`
- from `@ember/object/computed`: the default export (`ComputedProperty`),
`expandProperties`, `empty`, `notEmpty`, `none`, and the array macros
`sum`, `max`, `min`, `map`, `mapBy`, `filter`, `filterBy`, `uniq`,
`uniqBy`, `union`, `intersect`, `setDiff`, `collect` and `sort`
A cast keeps the published types, and a type alias keeps the type half of
the default export.
Ember code keeps the implementation. The code of `dependentKeyCompat` moves
to the private `@ember/object/lib/dependent-key-compat.ts`, which `Route`
and `RouterService` import. Rollup bundles that file into a shared chunk,
so it does not become a module path.
Tests:
- Tests that use these APIs skip with the flag. The array macro tests and
one `{{#each}}` module with a computed `arrangedContent` register only
without the flag.
- The shared array test helpers use the internal `computed`, because the
flag test page must load.
- The flag-only module checks that the exports are `undefined`.
- `packages/ember/tests/without-EMBER_DROP_CLASSIC_FEATURES/computed_test.js`
checks the API in builds without the flag.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NullVoxPopuli
marked this pull request as draft
October 17, 2026 20:57
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge #21726 and #21740 first. This PR sits on top of both. Review only the last commit,
2898b872d1.With
EMBER_DROP_CLASSIC_FEATURES=true, the rest of the computed property API exportsundefined. #21740 already does this for the 15 macros ofdeprecate-computed-macros.Behind the flag
@ember/objectcomputed@ember/object/compatdependentKeyCompat@ember/object/computedComputedProperty),expandProperties@ember/object/computedempty,notEmpty,none@ember/object/computedsum,max,min,map,mapBy,filter,filterBy,uniq,uniqBy,union,intersect,setDiff,collect,sort| undefined.import ComputedPropertystill gives the class type.computedfrom@ember/-internals/metal.dependentKeyCompatmoves to the private@ember/object/lib/dependent-key-compat.ts, whichRouteandRouterServiceimport. The file is in the rollup ignore list, so it goes into a shared chunk and does not become a module path.pnpm builddoes not changepackage.json.Not behind the flag
defineProperty,notifyPropertyChangefrom@ember/objectcacheForfrom@ember/object/internalsobserver,addObserver,removeObserverget,set,getProperties,setPropertiesTests
testUnless(import.meta.env?.EMBER_DROP_CLASSIC_FEATURES), and 35 tests with atestUnlessget the flag in their conditioncomputed, the macros ordependentKeyCompatreduce_computed_macros_test.jsregisters its modules only without the flagifeach-test.js: the module "with array proxies, arrangedContent depends on external content" registers only without the flagarrangedContentis computed. The tests come from a shared base class, so they cannot skip one by onehash-test.gjs: "works with computeds" usestest.skipwith the flagruntime/tests/helpers/array.js) use the internalcomputeddrop_classic_features_test.jschecks that the new exports areundefinedember/tests/without-EMBER_DROP_CLASSIC_FEATURES/computed_test.jscomputed,ComputedProperty,dependentKeyCompat,expandProperties,emptyandsumin builds without the flagChecks
ALL_DEPRECATIONS_ENABLED=trueOVERRIDE_DEPRECATION_VERSION=15.0.0EMBER_DROP_CLASSIC_FEATURES=trueThe flag mode has fewer tests, because the array macro modules and one
{{#each}}module do not register with the flag.The type checks of the internals and of the published types (with and without stable decorators),
eslint,prettierand the docs check pass.🤖 Generated with Claude Code