-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Explicit no-change render node #262
Comments
You generally shouldn't be triggering a re-render of the entire page unless an element at the top level changes - when you submit a During re-render, an in-memory representation of the elements is diff'd against the desired state, and DOM operations are only performed when necessary, so rendering should already be relatively cheap in any case, unless there are actual changes required. |
Also note the RenderSkipper interface allows a component to decide for itself if rerendering should not occur: https://pkg.go.dev/github.com/hexops/vecty#RenderSkipper |
(This overlaps with #217 and similar.)
I've only just found Vecty, and maybe I'm getting ahead of myself, but I'm wondering about the amount of work involved in creating and comparing the render trees for big pages that don't significantly change between renders.
E.g. if I have 1000 elements in my page, there's a good chance that 990 don't change ever, and also that these elements are grouped together.
Is there a method (or would a change be considered) of allowing explicit no-change render nodes, maybe something like:
The explicit storage of the subtree would avoid accidental changes, and also shortcut the tree comparison by allowing a version id to be embedded in the real DOM.
Thoughts? Thanks!
The text was updated successfully, but these errors were encountered: