Skip to content

Conversation

@grgbkr
Copy link
Contributor

@grgbkr grgbkr commented Feb 27, 2025

Push Change(s) must be consumed synchronously during the push method execution. If they are consumed later relationships can have incorrect values that conflict with other changes, resulting in a node already exists error being thrown by applyChanges.

The change to have the Vue view queue #pendingChanges: Change[] and only apply them onTransactionCommit 5d43ae0 was probably based on a similar change in zero-solid rocicorp/mono#3608, however that change was incorrect and later fixed by rocicorp/mono#3701. The zero-solid fix still delays apply changes till onTransactionCommit, but it "materialized" the changes relationships. This was important for performance with SolidJS as SolidJS does not batch DOM updates.

It is my understanding that Vue automatically batches DOM updates, thus it is simplest and probably most performant to just apply push changes immediately when received.

@aboodman
Copy link

@danielroe in case it's unclear @grgbkr is on the zero team.

@danielroe danielroe merged commit 769ea23 into danielroe:main Feb 27, 2025
6 checks passed
@Gerbuuun
Copy link
Contributor

I indeed did copy it from solid but I wasn't sure if it was really needed. Very nice to have it fixed 👌🏻

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.

4 participants