Memoize stateful AppWrap components#6651
Conversation
Now that StateProvider and EventLoopProvider are defined as dynamic app_wrap components rather than static providers, it is necessary to auto-memoize (convert to individual react components) any component that depends on state, so that its hooks drop into the auto-memo component, rather than in the parent AppWrap component where the StateProvider has not yet provided the value being depended on. This is also advantageous generally for preventing whole-page re-renders when an app_wrap component's dependent vars change, since the page component itself is ultimately a descendent of the AppWrap.
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThis PR adds a memoization pass for stateful
Confidence Score: 5/5The change is well-scoped: it inserts a single extra plugin pass over the already-assembled AppWrap chain and writes memo definitions into the existing compile context dict; all downstream emit logic is unchanged. The new No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "add news fragment" | Re-trigger Greptile |
Now that StateProvider and EventLoopProvider are defined as dynamic app_wrap components rather than static providers, it is necessary to auto-memoize (convert to individual react components) any component that depends on state, so that its hooks drop into the auto-memo component, rather than in the parent AppWrap component where the StateProvider has not yet provided the value being depended on.
This is also advantageous generally for preventing whole-page re-renders when an app_wrap component's dependent vars change, since the page component itself is ultimately a descendent of the AppWrap.
Fixes #6650