Repository navigation
Conversation
Guard the array invariant in setTNodeInsertBeforeIndex so production bundles can remove the check and its assertion helpers. Keep the existing development diagnostics and array insertion behavior.
JeanMeche
approved these changes
Oct 8, 2026
Member
|
This is also shows that we don't have great coverage for i18n, this should have broken a symbol test (that would have shown that we have this assert function in a prod bundle) |
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.
PR Checklist
This performance change uses the existing i18n tests and does not change a public API.
PR Type
What is the current behavior?
setTNodeInsertBeforeIndexcallsassertEqual(Array.isArray(insertBeforeIndex), ...)without anngDevModeguard when appending to an i18n insertion array. The helper is used by the production i18n creation path, so the check and its assertion helpers can remain in optimized bundles.What is the new behavior?
Guard the array invariant with
ngDevMode, matching the adjacent assertions. Production optimization can remove the check while preserving development diagnostics and the array insertion.Does this PR introduce a breaking change?
Other information
The isolated AOT i18n control used published
@angular/core@22.3.0-next.0FESMs with this one-line change applied, the@angular/build@22.2.0JavaScript optimizer, and esbuild 0.28.2. Production flags were set tofalse; RxJS and the compiler were external.This is a fixture-specific bundle measurement, not a full Angular CLI application build.