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

[v9] fix: swap instances in reverse #3272

Merged
merged 7 commits into from
May 26, 2024
Merged

Conversation

CodyJasonBennett
Copy link
Member

Refactors switchInstance so we swap instances in reverse, handling tricky cases where we sort or shuffle elements in an array with shared objects. Previously, we had to employ clever tricks since we could only modify instances front-to-back in commitUpdate (the inherent order from React mutation effects). Now, we accumulate instances to be reconstructed in-place, and process them when we hit a tail sibling which is either the last sibling in a view, or the last sibling in a sequence with an update.

Copy link

codesandbox-ci bot commented May 25, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0e1dec5:

Sandbox Source
example Configuration

@CodyJasonBennett CodyJasonBennett merged commit 486ba41 into v9 May 26, 2024
2 checks passed
@CodyJasonBennett CodyJasonBennett deleted the fix/reverse-switchinstance branch May 26, 2024 03:48
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