fix: version-gate Angular 19 runtime instructions (#107)#108
fix: version-gate Angular 19 runtime instructions (#107)#108Brooooooklyn wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
💡 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".
crates/oxc_angular_compiler/src/pipeline/phases/reify/statements/bindings.rs
Outdated
Show resolved
Hide resolved
90d2286 to
ff5bf7a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
ff5bf7a to
191c8d8
Compare
There was a problem hiding this comment.
💡 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) |
There was a problem hiding this comment.
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>
191c8d8 to
be1d003
Compare


Angular 19.2 runtime uses different instructions than Angular 20+:
propertyInterpolate*/attributeInterpolate*/stylePropInterpolate*/styleMapInterpolate*/classMapInterpolate*instead of nestedproperty(interpolate*())callshostPropertyinstead ofdomPropertyThis adds
supports_value_interpolation()(>= 20) andsupports_dom_property()(>= 20) version gates so the compiler emits the correct instructions based on
the target Angular version.
Also fixes
collapse_singleton_interpolationsto 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_interpolationandsupports_dom_propertyto 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_versionthrough host-binding ingestion/compilation jobs, extendsr3::Identifiersand helpers for the Angular 19 combined interpolation instructions, and refactors the chaining phase from aLazyLockmap to a constmatchlookup. 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.