Skip to content

fix: defer timer consts placed after i18n consts in consts array#21

Merged
Brooooooklyn merged 1 commit into
mainfrom
fix/defer-timer-consts-ordering
Feb 10, 2026
Merged

fix: defer timer consts placed after i18n consts in consts array#21
Brooooooklyn merged 1 commit into
mainfrom
fix/defer-timer-consts-ordering

Conversation

@Brooooooklyn
Copy link
Copy Markdown
Member

@Brooooooklyn Brooooooklyn commented Feb 10, 2026

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 @defer timer config const ordering by changing DeferOp.loading_config/placeholder_config from const-pool indices to ConstCollectedExpr-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 emitting null (not 0) 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.

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>
@Brooooooklyn Brooooooklyn merged commit aabfc01 into main Feb 10, 2026
3 checks passed
@Brooooooklyn Brooooooklyn deleted the fix/defer-timer-consts-ordering branch February 10, 2026 07:34
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.

1 participant