Skip to content

fix: version-gate Angular 19 runtime instructions (#107)#108

Open
Brooooooklyn wants to merge 1 commit intomainfrom
fix/angular-19-version-gating
Open

fix: version-gate Angular 19 runtime instructions (#107)#108
Brooooooklyn wants to merge 1 commit intomainfrom
fix/angular-19-version-gating

Conversation

@Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Mar 13, 2026

Angular 19.2 runtime uses different instructions than Angular 20+:

  • Combined propertyInterpolate*/attributeInterpolate*/stylePropInterpolate*/
    styleMapInterpolate*/classMapInterpolate* instead of nested
    property(interpolate*()) calls
  • hostProperty instead of domProperty

This adds supports_value_interpolation() (>= 20) and supports_dom_property()
(>= 20) version gates so the compiler emits the correct instructions based on
the target Angular version.

Also fixes collapse_singleton_interpolations to only collapse StyleProp/
StyleMap/ClassMap singletons on v20+ (v19 only collapsed Attribute), and
refactors the chaining phase's CHAIN_COMPATIBILITY from LazyLock
to a const fn match lookup.

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Note

Medium Risk
Changes codegen for template and host-binding reification based on the target Angular version, which can subtly affect runtime behavior and output stability. Broad test coverage reduces risk, but it still touches core compiler emission paths.

Overview
Adds Angular version gating for runtime instruction emission (v19 vs v20+). The compiler now checks supports_value_interpolation and supports_dom_property to decide between Angular 20+ nested ɵɵinterpolate* inside ɵɵproperty/ɵɵattribute/style/class bindings vs Angular 19 combined ɵɵ*Interpolate* instructions, and between ɵɵdomProperty (v20+) vs ɵɵhostProperty (v19) for DomOnly/host property bindings.

Plumbs the optional angular_version through host-binding ingestion/compilation jobs, extends r3::Identifiers and helpers for the Angular 19 combined interpolation instructions, and refactors the chaining phase from a LazyLock map to a const match lookup. Adds extensive integration tests and snapshots to validate v19/v20 output differences, including sanitizer/unit/namespace edge cases.

Written by Cursor Bugbot for commit be1d003. This will update automatically on new commits. Configure here.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 90d228656f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Brooooooklyn Brooooooklyn force-pushed the fix/angular-19-version-gating branch from 90d2286 to ff5bf7a Compare March 13, 2026 13:07
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@Brooooooklyn Brooooooklyn force-pushed the fix/angular-19-version-gating branch from ff5bf7a to 191c8d8 Compare March 13, 2026 13:32
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 191c8d8272

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

input: HostBindingInput<'a>,
pool_starting_index: u32,
) -> HostBindingCompilationJob<'a> {
ingest_host_binding_with_version(allocator, input, pool_starting_index, None)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Propagate target Angular version in host ingest wrapper

ingest_host_binding now hardcodes None when delegating to ingest_host_binding_with_version, which forces callers of the legacy API to compile host bindings with v20+ instruction gates. The compile_template_to_js_with_options host path still uses this wrapper, so angular_version: Some(19.x) can produce mixed output (v19 template instructions but v20 host instructions like ɵɵdomProperty/standalone interpolation). Thread the requested version through this path instead of defaulting to None.

Useful? React with 👍 / 👎.

Angular 19.2 runtime uses different instructions than Angular 20+:
- Combined `propertyInterpolate*`/`attributeInterpolate*`/`stylePropInterpolate*`/
  `styleMapInterpolate*`/`classMapInterpolate*` instead of nested
  `property(interpolate*())` calls
- `hostProperty` instead of `domProperty`

This adds `supports_value_interpolation()` (>= 20) and `supports_dom_property()`
(>= 20) version gates so the compiler emits the correct instructions based on
the target Angular version.

Also refactors the chaining phase's CHAIN_COMPATIBILITY from LazyLock<FxHashMap>
to a const fn match lookup, and fixes `reify_interpolation` to preserve trailing
empty strings when extra positional args (sanitizer, namespace, unit) follow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Brooooooklyn Brooooooklyn force-pushed the fix/angular-19-version-gating branch from 191c8d8 to be1d003 Compare March 13, 2026 14:33
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