Skip to content

[Live] Fix parent->child fingerprint problem + always match child component #766

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

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

weaverryan
Copy link
Member

Q A
Bug fix? yes
New feature? no
Tickets None
License MIT

Another boring PR from me to prep for 2.8 :P. This is caused by a few different changes to the system mixing together. Fixes:

A) If a parent component re-renders and the "input props" that are passed to the child differ, the child should re-render with the updated "input props". That broken in 2.8 due to a checksum problem. No fixed, and a new updateFromParent was added to opt into this behavior, which makes most parent-child situations simpler.

B) When a parent component re-renders and the "input props" that are passed to the child have NOT changed, we render a "dummy" child element (so that we don't need to use the CPU to render a component that doesn't need to be updated). This was already the case, but until now, we always rendered as a div (even if the original child were an li). I had thought we could "get away" with this (as we are discarding that fake, empty element anyways), but we couldn't. So now we render the correct tag always.

Cheers!

@weaverryan weaverryan force-pushed the live-child-fingerprints-fix branch from 156e048 to 007447c Compare March 30, 2023 18:37
@weaverryan weaverryan force-pushed the live-child-fingerprints-fix branch from 007447c to ee4536e Compare March 31, 2023 00:40
@weaverryan weaverryan merged commit d8fe5c7 into symfony:2.x Mar 31, 2023
@weaverryan weaverryan deleted the live-child-fingerprints-fix branch March 31, 2023 00:40
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.

1 participant