-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: SolidJS port #16
base: main
Are you sure you want to change the base?
Conversation
This is a basic SolidJS port It does not yet figure out how to make Replicache ❤️ SolidJS. This is just a baseline to start from.
Your Render PR Server URL is https://todo-row-versioning-pr-16.onrender.com. Follow its progress at https://dashboard.render.com/web/srv-cng698tjm4es73f1s4i0. |
Not intended to be merged to main. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the re-rendering characteristics of this like? Seems like we should ideally only re-render the todo row that changed, not the entire list. Users often ask us to do better and re-render only the field that changed, but this doesn't seem practical.
In React, the model we've settled on is to have the container only subscribe to the keys. not the values. So the container re-renders if the list of todo IDs changes, but not their values. See reflect-draw for an example of this pattern.
I wonder if we could do something similar for Solid and/or if it's appropriate.
My plan was to look at the rerendering behavior after getting the basics working. In Solid when you use the
I agree that this does not seem to be practical in general. In Replicache we never mutate the data and we go a long way to ensure we minimize the number of clones. To support this deep mutation that would trigger minimal render updates the data needs to be cloned and mutated. I do think that there might be some utilities that can be used in SolidJS apps that would map from a key to a solid store. And when the value of that key changes it would use solid's reconcile to update the store to only mutate the innards of the object. Strawman: const item = createReplicacheValueStore(rep, key);
return <div>{item.description}</div>
We could also have version that supports scalars but then the Then we could maybe provide similar things for scan... and subscribe... Anyway, I need to think more. |
const todos = await todosByList(tx, listID); | ||
return todos.sort((a, b) => a.sort - b.sort); | ||
}, set), | ||
const todos = subscribeStore( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is getting a bit more ergonomic.
Your plan makes sense, thanks for explaining! |
This is a basic SolidJS port
It does not yet figure out how to make Replicache ❤️ SolidJS. This is just a baseline to start from.