Skip to content

fix: pool ng-content attributes into the const pool (v22)#340

Merged
brandonroberts merged 2 commits into
mainfrom
fix/projection-attrs-const-pool
Jun 8, 2026
Merged

fix: pool ng-content attributes into the const pool (v22)#340
brandonroberts merged 2 commits into
mainfrom
fix/projection-attrs-const-pool

Conversation

@brandonroberts

Copy link
Copy Markdown
Collaborator

Summary

Content-projection attributes were emitted inline in the ɵɵprojection call:

i0.ɵɵprojection(0, 0, ["ngProjectAs", "[card-content]", 5, ["", "card-content", ""]]);

Angular 22.0.0 (rc.3, angular/angular@2891f7e — "move projection attributes into constants") moves those attrs into the shared const pool:

const _c1 = ["ngProjectAs", "[card-content]", 5, ["", "card-content", ""]];
i0.ɵɵprojection(0, 0, _c1);

This PR mirrors that in const_collection: projection attrs are now routed through pool.get_const_literal(.., true), exactly like element attrs and the projectionDef / ngContentSelectors consts already are. Because this phase runs after generate_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.
  • Bump the conformance Angular submodule v22.0.0-rc.2 → v22.0.0 so the suite guards this emit (rc.2 predates the change).
  • Update the three ng-content integration snapshots to the pooled form.

Verification

  • Conformance: 1264/1264 (100%) against the v22.0.0 goldens.
  • Full oxc_angular_compiler crate suite green (unit + integration + snapshots).
  • Verified end-to-end through the OXC engine in an Analog app: content-projection fixtures emit the pooled _cN form and match the Angular reference.

Reference

packages/compiler/src/template/pipeline/src/phases/const_collection.tsop.attributes = job.pool.getConstLiteral(attrArray, true).

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>
@brandonroberts

Copy link
Copy Markdown
Collaborator Author

@codex[agent] review

@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: 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".

Comment thread crates/oxc_angular_compiler/src/pipeline/phases/const_collection.rs
Co-authored-by: brandonroberts <42211+brandonroberts@users.noreply.github.com>
@Codex

Codex AI commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@codex[agent] review

Reviewed and added a small robustness fix so pooled projection attrs are applied to every ɵɵprojection op that shares the same xref (instead of being consumed on first use). Commit: 06cdb17. Also re-ran cargo test -p oxc_angular_compiler locally (pass).

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@brandonroberts brandonroberts enabled auto-merge (squash) June 8, 2026 02:15
@Brooooooklyn

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

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

@brandonroberts brandonroberts merged commit 166f6e2 into main Jun 8, 2026
9 checks passed
@brandonroberts brandonroberts deleted the fix/projection-attrs-const-pool branch June 8, 2026 12:23
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.

3 participants