fix: defer timer consts placed after i18n consts in consts array#21
Merged
Conversation
Defer timer configs (e.g. [100, null] for @Loading minimum) were being added directly to the consts array in Phase 19 (defer_configs), placing them before i18n consts added in Phase 52. This caused all i18n const indices to be off by 1. Match Angular TS's approach: wrap timer configs in ConstCollectedExpr so they are resolved by Phase 53 (collectConstExpressions) which runs after Phase 52 (collectI18nConsts), ensuring correct ordering. Also fixes null vs 0 for missing timer values — Angular uses null for absent loadingAfterTime, not 0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Defer timer configs (e.g. [100, null] for @Loading minimum) were being added directly to the consts array in Phase 19 (defer_configs), placing them before i18n consts added in Phase 52. This caused all i18n const indices to be off by 1.
Match Angular TS's approach: wrap timer configs in ConstCollectedExpr so they are resolved by Phase 53 (collectConstExpressions) which runs after Phase 52 (collectI18nConsts), ensuring correct ordering.
Also fixes null vs 0 for missing timer values — Angular uses null for absent loadingAfterTime, not 0.
Note
Medium Risk
Touches IR types and the const-collection/reify pipeline for
@defer, which can affect emitted const indices and runtime instruction arguments; changes are localized and covered by a new integration test.Overview
Fixes
@defertimer config const ordering by changingDeferOp.loading_config/placeholder_configfrom const-pool indices toConstCollectedExpr-wrapped IR expressions, so Phase 53 lifts them into the consts array after i18n const collection.Updates expression traversal to visit/transform these new config expressions, updates reification to extract the final const index from
ConstReference, and aligns semantics with Angular by emittingnull(not0) for missing timer values. Adds an integration test + snapshot that asserts i18n const indices stay stable when defer loading timers are present.Written by Cursor Bugbot for commit 683fbf5. This will update automatically on new commits. Configure here.