Repository navigation
fix(compiler): match Angular 22.2.2 emit for img/video src sanitizers and namespaced block tags - #577
Brooooooklyn wants to merge 3 commits into
Conversation
… and namespaced block tags
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
There was a problem hiding this comment.
💡 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".
| pub fn drops_img_video_src_url_context(&self) -> bool { | ||
| self.is_at_least(22, 2, 2) && !self.is_22_3_0_next_0() |
There was a problem hiding this comment.
Honor unknown prereleases at the feature cutoff
When a caller supplies an unrecognized prerelease such as 22.3.0-beta.2 or a custom snapshot tag, parsing stores Prerelease::Other, which the new API documentation explicitly defines as earlier than next/rc, but this predicate excludes only Next(0). Such builds therefore incorrectly take the 22.3.0-next.1+ path, dropping the img/video sanitizer; the companion predicate similarly strips namespaced block tags. Compare the stored prerelease against the next.1 cutoff rather than special-casing only next.0.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2f6db14. The Next(0) special case is gone — 22.3.0 prereleases now compare against the next.1 cutoff directly: Prerelease orders Other < Next(n) < Rc(n), so beta/snapshot/any unknown tag (parses to Other) keeps the old behavior, next.0 keeps the old behavior, and next.1+/rc.0+/22.3.0 stable take the new path. Tests cover beta.2 and snapshot.9 on the old side alongside next.0.
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;angularVersionunset keeps the newest behavior, matching the existing "assume latest" convention.Upstream changes ported
439ff1bdf4(refactor: remove img/video src from URL security context)img|srcandvideo|srcleaveSecurityContext::Url→ noɵɵsanitizeUrlonimg[src]/video[src]SchemaKind::V22_2_2indom_security_schema.rs;V22(22.0.0–22.2.1) keeps the keys, and so do the 21.x/20.x/19.x backports0244a1cb3(fix: match namespaced root nodes of control flow blocks against ng-content tag selectors, fixes angular#71162)splitNsNameapplied to the single-root tag copied ontoɵɵconditionalCreate/ɵɵconditionalBranchCreate/ɵɵrepeaterCreate—:svg:svg→svgingest_control_flow_insertion_pointinpipeline/ingest.rsstrips the namespace at ≥22.2.2Both 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.2predicate 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—ɵɵsanitizeUrlno longer emitted onimg|srcregressions/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→svgblock tagsTest plan
cargo test -p oxc_angular_compiler— all green (~3205 tests, 0 failed)pnpm test(napi) — 441/441pnpm --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)None(new) for both gates