Skip to content
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

1247: WIP: Partial Tree Rerendering #1248

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

steve-the-edwards
Copy link
Contributor

@steve-the-edwards steve-the-edwards commented Jan 20, 2025

Re-render the node only if:

  1. The state of this node or one of its children has changed (this includes if props changed).

In order to do this, we have to propagate the action cascade all the way up to the root to record a single path of changed nodes.

Note we currently do not re-render if the workflow instance changed (unless the state also changed!), assuming the new workflow is still compatible with the old rendering because its identifier did not change.

Closes #1247.

@steve-the-edwards steve-the-edwards changed the base branch from main to sedwards/cache-render-context January 21, 2025 20:32
@steve-the-edwards steve-the-edwards force-pushed the sedwards/cache-render-context branch 2 times, most recently from 6f2d156 to 74fb6fb Compare January 23, 2025 15:30
@steve-the-edwards steve-the-edwards force-pushed the sedwards/cache-render-context branch from 74fb6fb to c7d7c15 Compare January 23, 2025 20:22
@steve-the-edwards steve-the-edwards force-pushed the sedwards/cache-render-context branch 2 times, most recently from 0a36563 to 717d484 Compare January 24, 2025 16:24
@steve-the-edwards steve-the-edwards force-pushed the sedwards/partial-tree branch 3 times, most recently from 7d7098f to b6e677c Compare January 24, 2025 19:49
return flow.value
context.runningWorker(rerenderWorker) { output: T ->
action("rerenderUpdate") {
state = output
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prior to this state was not actually changing - so this would not work in the optimized runtime.

@steve-the-edwards steve-the-edwards force-pushed the sedwards/partial-tree branch 2 times, most recently from 8647d68 to e99c6b6 Compare January 27, 2025 14:55
@steve-the-edwards steve-the-edwards force-pushed the sedwards/cache-render-context branch from 717d484 to 646ebf7 Compare January 28, 2025 15:03
Base automatically changed from sedwards/cache-render-context to main January 28, 2025 16:24
@steve-the-edwards steve-the-edwards force-pushed the sedwards/partial-tree branch 3 times, most recently from e4a227d to 6560454 Compare January 30, 2025 16:15
Track whether or not the state (or state of a child) has changed in the WorkflowNode. Pass lastRendering if its not.
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.

Partial Tree Re-rendering
1 participant