fix: pool ng-content attributes into the const pool (v22)#340
Conversation
Angular 22.0.0 (rc.3, angular/angular@2891f7e) moves the `attrs` argument of `ɵɵprojection` out of the inline call and into the shared const pool, emitting `ɵɵprojection(slot, idx, _cN)` instead of an inline array. Mirror that in const_collection by routing projection attrs through `pool.get_const_literal(.., true)`, exactly as element attrs and the projectionDef/ngContentSelectors consts already do. This phase runs after generate_projection_def, so the projection attrs land at the next `_cN`, matching the goldens. Bump the conformance angular submodule rc.2 -> v22.0.0 so the suite guards this emit. Conformance stays at 1264/1264 (100%); update the three ng-content integration snapshots to the pooled form. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@codex[agent] review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8113ffc6f4
ℹ️ 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".
Co-authored-by: brandonroberts <42211+brandonroberts@users.noreply.github.com>
Reviewed and added a small robustness fix so pooled projection attrs are applied to every |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Content-projection attributes were emitted inline in the
ɵɵprojectioncall:Angular 22.0.0 (rc.3, angular/angular@2891f7e — "move projection attributes into constants") moves those
attrsinto the shared const pool:This PR mirrors that in
const_collection: projection attrs are now routed throughpool.get_const_literal(.., true), exactly like element attrs and theprojectionDef/ngContentSelectorsconsts already are. Because this phase runs aftergenerate_projection_def, the projection attrs are pooled at the next_cN, matching the Angular goldens.Changes
crates/oxc_angular_compiler/src/pipeline/phases/const_collection.rs— pool projection attrs into the const pool instead of emitting them inline.ng-contentintegration snapshots to the pooled form.Verification
oxc_angular_compilercrate suite green (unit + integration + snapshots)._cNform and match the Angular reference.Reference
packages/compiler/src/template/pipeline/src/phases/const_collection.ts—op.attributes = job.pool.getConstLiteral(attrArray, true).