Skip to content

fix(compiler): match Angular 22.2.2 emit for img/video src sanitizers and namespaced block tags - #577

Merged
Brooooooklyn merged 3 commits into
mainfrom
fix/angular-22-2-2-emit-compat
Oct 14, 2026
Merged

Brooooooklyn merged 3 commits into
mainfrom
fix/angular-22-2-2-emit-compat

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Summary

Matches Angular 22.2.2's emit so the fixture-compare gate passes on both 22.2.1 and 22.2.2 (unblocks #575). Both behaviors are gated on angularVersion >= 22.2.2; angularVersion unset keeps the newest behavior, matching the existing "assume latest" convention.

Upstream changes ported

Angular commit Change oxc equivalent
439ff1bdf4 (refactor: remove img/video src from URL security context) img|src and video|src leave SecurityContext::Url → no ɵɵsanitizeUrl on img[src]/video[src] new SchemaKind::V22_2_2 in dom_security_schema.rs; V22 (22.0.0–22.2.1) keeps the keys, and so do the 21.x/20.x/19.x backports
0244a1cb3 (fix: match namespaced root nodes of control flow blocks against ng-content tag selectors, fixes angular#71162) splitNsName applied to the single-root tag copied onto ɵɵconditionalCreate/ɵɵconditionalBranchCreate/ɵɵrepeaterCreate — :svg:svg → svg ingest_control_flow_insertion_point in pipeline/ingest.rs strips the namespace at ≥22.2.2

Both fixes also ship in 22.3.0-next.1 and were never backported to 21.x/20.x/19.x, so a single >= 22.2.2 predicate covers all released lines (AngularVersion::is_at_least / strips_namespaced_block_tag / drops_img_video_src_url_context).

Failing fixtures this fixes (PR #575 CI)

  • bindings/attr-interpolation, regressions/sanitizer-src-interpolation, regressions/sanitizer-srcset, templates/case-html-void-elements — ɵɵsanitizeUrl no longer emitted on img|src
  • regressions/clickup-exact-{minimal,svg-in-if,svg-in-if-else,theme-switcher}, clickup-theme-switcher-pattern, svg-in-conditional-branch, svg-in-if-else, svg-nested-in-for — :svg:svg → svg block tags

Test plan

  • cargo test -p oxc_angular_compiler — all green (~3205 tests, 0 failed)
  • pnpm test (napi) — 441/441
  • pnpm --filter @oxc-angular/compare compare --fixtures — 0 mismatched at Angular 22.2.1 (unchanged from main) and 0 mismatched after resolving @angular/compiler@22.2.2 via temporary workspace overrides (same setup as PR chore(deps): update npm packages #575's CI)
  • New unit tests cover 22.2.1 (old), 22.2.2/22.3/23 (new), and None (new) for both gates

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T16:18:27.715451Z 2f6db14 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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: 0ef3f4742e

ℹ️ 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".

Comment thread crates/oxc_angular_compiler/src/component/metadata.rs Outdated

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

Copy link
Copy Markdown

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: a73c4c9e97

ℹ️ 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".

Comment thread crates/oxc_angular_compiler/src/component/metadata.rs Outdated
@Brooooooklyn
Brooooooklyn merged commit 210d009 into main Oct 14, 2026
10 checks passed
@Brooooooklyn
Brooooooklyn deleted the fix/angular-22-2-2-emit-compat branch October 14, 2026 01:59
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