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: use Fragment VNodes for if-elseif-else children #3042

Closed
wants to merge 4 commits into from

Conversation

jye-sf
Copy link
Contributor

@jye-sf jye-sf commented Sep 13, 2022

Details

Builds on top of #3034 to resolve issue with diffing algo. if-elseif-else children are now properly marked as fragments so that the diffing algo can update the nodes properly.

Has dependencies on both #3034 and #3030 and should only be merged into a branch that contains both those changes.

Does this pull request introduce a breaking change?

  • ✅ No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • ⚠️ Yes, it does include an observable change.

GUS work item

): t.Expression {
const ifBlockKey = key || codeGen.generateKey('if-fr');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use the same key for each branch of the if-elseif-else chain so that the different fragment vnodes are recognized as belonging to the same space. Thanks Jose for the recommendation.

@jye-sf jye-sf requested a review from jmsjtu September 14, 2022 03:08
api_text("First Alternative Header"),
]),
])
: api_fragment("if-fr0", stc2),
Copy link
Contributor

Choose a reason for hiding this comment

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

this fragment should have childrens, or should be just null in the else part?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, this should just be null.

@jye-sf
Copy link
Contributor Author

jye-sf commented Sep 16, 2022

Closing in favor of #3047.
cc - @jmsjtu @jodarove

@jye-sf jye-sf closed this Sep 16, 2022
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.

2 participants