Repository navigation
Use native classes in routing tests that are not about classic classes - #21691
Merged
NullVoxPopuli merged 2 commits intoOct 11, 2026
Merged
NullVoxPopuli merged 2 commits into
NullVoxPopuli merged 2 commits into
Conversation
These tests are about routing, locations and the router service. They used `.extend()`, `reopen()`, the `get` and `set` methods, `EmberObject` fixtures and `computed` only for historical reasons. - `.extend()` and `reopen()` become native classes and assignments. - The `get` method becomes a property read. - The `set` method becomes the `set` function. - `EmberObject` fixtures become plain classes. - `subclass()` on the application test case replaces a registration with a subclass of it. The classic class changes come from emberjs#21673, so that PR can show only the deprecation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`typeOf` must return 'class' for a classic class and for a native class. The test now has one assertion for each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ef4
approved these changes
Oct 11, 2026
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.
Tests about routing, locations and the router service stop using the classic object model. Only test files and one test harness file change.
Why this is a separate PR
This PR does for classic classes what #21690 does for
A().#21673 deprecates
.extend(),reopen()andreopenClass()(RFC 1117). The spike #21674 deprecatesEmberObject, itsgetandsetmethods, andcomputed(RFC 1234). A test that is about one of those APIs keeps it, expects the deprecation, and has a removal guard. A test that is about a feature that stays must not use them.The 13 files here are in the second group. This PR has no dependency on a deprecation, so it can merge first. After it merges, these files drop out of #21673.
Changes
ember/tests/routing/router_service_test/:basic_test,recognize_test,transitionTo_testember/tests/routing/query_params_test/:model_dependent_state_with_query_params_test,overlapping_query_params_testember/tests/routing/decoupled_basic_test@ember/routing/tests/location/:history_location_test,none_location_test@ember/routing/tests/system/dsl_testattrs-lookup-test,@ember/utils/tests/compare_test: only.extend()andreopenClass()go. These tests are about classic components and aboutEmberObjectvalues.@ember/utils/tests/type_of_test: the assertion for a classic class stays, and a new assertion covers a native class.New in the test harness:
subclass(specifier, build)on the application test case. The registry caches a class after the first lookup, so the helper removes the registration before it adds the subclass.Not in this PR
initonRoute,Routerand location subclasses stays.HistoryLocation#initsetsbaseURLandlocation, so a class field cannot replace aninitthat sets them aftersuper.init(). The replacement forinitis an open decision in Spike: deprecate EmberObject (RFC 1234) #21674.model_dependent_state_with_query_params_test.jsstill callsA(). Use native and tracked arrays in tests that are not about Ember arrays #21690 changes those lines. The two PRs merge without a conflict.Test results
Local runs of the full suite on this branch. The number of tests is the same as on
main.tsc --noEmit,eslintandprettier --checkpass on the changed files.🤖 Generated with Claude Code