qwik
qwik copied to clipboard
[📖] Docs/tutorials expect extra renders - signals are too efficient!
Suggestion
If a component inserts store values directly into the JSX for example, Qwik can propagate signal updates directly into the DOM without re-running the component's render function. This seems to have made a number of tutorials/docs out of date.
Discussed a bit on discord: https://discord.com/channels/842438759945601056/1060999298671718540/1060999298671718540
These are the sorts of inaccuracies noticed (please feel free to add more)
- [ ] https://qwik.builder.io/docs/concepts/reactivity/#counter-example "downloads the rendering function and re-runs the OnRender method"
- [ ] https://qwik.builder.io/tutorial/reactivity/template/ "a++ button will only cause the re-rendering of <DisplayA>"
- [ ] https://qwik.builder.io/tutorial/projection/basic/ "Notice that the
<App>
is re-render on button click" - [ ] https://qwik.builder.io/tutorial/props/store/ "The re-rendering of
<App>
is needed to update the props of <Display>"
Additionally, is there anything we can to to assist the mental model when describing this behavior - is there a word for the "rerender without rerender"?
If there is appetite here to make some changes I can read through all the docs/tutorials and make sure we have the exhaustive list.
I think it'd be a good idea
@cmbartschat Thanks for your report. Would you like fix the docs for this particular topic?
Happy to! I just need a little bit of direction from a terminology standpoint. Is there a word the core team uses to describe the "rerender without rerender"?
How would these two processes be labelled?
- A component's render function gets run again in response to a signal change
- The DOM structure receives targeted updates in response to a signal change, without invoking component code
Thanks, this would make a significant community issue. Is anyone up for a PR?
@mhevery I'm working on it ✏️
Thanks @wtlin1228 💪
Closing this issue as PRs have landed...