Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler): capture data bindings for content projection purposes in blocks #54876

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

Fixes a regression in the template pipeline where data bindings weren't being captured for content projection purposes.

Fixes #54872.

…in blocks

Fixes a regression in the template pipeline where data bindings weren't being captured for content projection purposes.

Fixes angular#54872.
@@ -359,7 +359,7 @@ function ingestIfBlock(unit: ViewCompilationUnit, ifBlock: t.IfBlock): void {
cView.contextVariables.set(ifCase.expressionAlias.name, ir.CTX_REF);
}

let ifCaseI18nMeta = undefined;
let ifCaseI18nMeta: i18n.BlockPlaceholder|undefined = undefined;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated change, I just saw that vscode was flagging this as an error.

for (const attr of root.attributes) {
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
unit.update.push(ir.createBindingOp(
xref, ir.BindingKind.Attribute, attr.name, o.literal(attr.value), null, securityContext,
true, false, null, asMessage(attr.i18n), attr.sourceSpan));
}

// Also collect the inputs since they participate in content projection as well.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For reference, this is where the TDB was constructing the attributes array and this is the code that was capturing both the static attributes and the inputs.

@crisbeto crisbeto requested a review from dylhunn March 15, 2024 13:20
@crisbeto crisbeto marked this pull request as ready for review March 15, 2024 13:20
@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release area: compiler Issues related to `ngc`, Angular's template compiler labels Mar 15, 2024
@ngbot ngbot bot added this to the Backlog milestone Mar 15, 2024
Copy link
Member

@pkozlowski-opensource pkozlowski-opensource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Reviewed-for: fw-core

Copy link
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: fw-compiler

@dylhunn
Copy link
Contributor

dylhunn commented Mar 15, 2024

(thanks for fixing this issue @crisbeto!)

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 15, 2024
alxhub pushed a commit that referenced this pull request Mar 15, 2024
…in blocks (#54876)

Fixes a regression in the template pipeline where data bindings weren't being captured for content projection purposes.

Fixes #54872.

PR Close #54876
@alxhub
Copy link
Member

alxhub commented Mar 15, 2024

This PR was merged into the repository by commit 879bd80.

@alxhub alxhub closed this in 879bd80 Mar 15, 2024
ilirbeqirii pushed a commit to ilirbeqirii/angular that referenced this pull request Apr 6, 2024
…in blocks (angular#54876)

Fixes a regression in the template pipeline where data bindings weren't being captured for content projection purposes.

Fixes angular#54872.

PR Close angular#54876
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: compiler Issues related to `ngc`, Angular's template compiler target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamically generated content is not projected
4 participants