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

Integrate @let into the runtime #56527

Closed
wants to merge 2 commits into from
Closed

Conversation

crisbeto
Copy link
Member

Includes the following changes that integrate the new @let syntax into the runtime.

refactor(core): integrate let instructions into the runtime

Adds the implementation of the following new instructions:

  • declareLet - creation-time instruction that initializes the slot for a let declaration.
  • storeLet - update-time instruction that stores the current value of a let declaration.
  • readContextLet - instruction that reads the stored value of a let declaration from a different view.

On top of the instructions, it also introduces a new LetDeclaration TNode type. The new TNode is nececessary for DI to work correctly in pipes inside the let expression, as well as for proper hydration support.

refactor(core): support let declarations during hydration

Updates the hydration logic to account for the fact that let declarations don't create a DOM node.

@crisbeto crisbeto added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release labels Jun 20, 2024
@ngbot ngbot bot added this to the Backlog milestone Jun 20, 2024
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@crisbeto looks great, just left a few minor comments.

packages/core/src/render3/collect_native_nodes.ts Outdated Show resolved Hide resolved
packages/core/src/render3/instructions/let_declaration.ts Outdated Show resolved Hide resolved
packages/core/src/render3/interfaces/node.ts Show resolved Hide resolved
packages/core/src/render3/instructions/let_declaration.ts Outdated Show resolved Hide resolved
packages/core/src/hydration/annotate.ts Outdated Show resolved Hide resolved
Adds the implementation of the following new instructions:
* `declareLet` - creation-time instruction that initializes the slot for a let declaration.
* `storeLet` - update-time instruction that stores the current value of a let declaration.
* `readContextLet` - instruction that reads the stored value of a let declaration from a different view.

On top of the instructions, it also introduces a new `LetDeclaration` TNode type.
The new TNode is nececessary for DI to work correctly in pipes inside the let expression,
as well as for proper hydration support.
Updates the hydration logic to account for the fact that let declarations don't create a DOM node.
@crisbeto
Copy link
Member Author

Thank you for the feedback @AndrewKushnir, it has been addressed.

@crisbeto crisbeto changed the title Implement @let into the runtime Integrate @let into the runtime Jun 21, 2024
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

@crisbeto looks great, thanks! 👍

@pullapprove pullapprove bot requested review from alxhub, atscott and dylhunn June 21, 2024 23:20
Copy link
Contributor

@AndrewKushnir AndrewKushnir 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: public-api

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: public-api
Reviewed-for: fw-core

@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 Jun 24, 2024
@dylhunn
Copy link
Contributor

dylhunn commented Jun 26, 2024

This PR was merged into the repository by commit 7dfe302.

The changes were merged into the following branches: main, 18.0.x

dylhunn pushed a commit that referenced this pull request Jun 26, 2024
Adds the implementation of the following new instructions:
* `declareLet` - creation-time instruction that initializes the slot for a let declaration.
* `storeLet` - update-time instruction that stores the current value of a let declaration.
* `readContextLet` - instruction that reads the stored value of a let declaration from a different view.

On top of the instructions, it also introduces a new `LetDeclaration` TNode type.
The new TNode is nececessary for DI to work correctly in pipes inside the let expression,
as well as for proper hydration support.

PR Close #56527
dylhunn pushed a commit that referenced this pull request Jun 26, 2024
Updates the hydration logic to account for the fact that let declarations don't create a DOM node.

PR Close #56527
@dylhunn dylhunn closed this in bbe39c1 Jun 26, 2024
dylhunn pushed a commit that referenced this pull request Jun 26, 2024
Updates the hydration logic to account for the fact that let declarations don't create a DOM node.

PR Close #56527
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants