Add a diagram of the component lifecycle
jstarry opened this issue · 6 comments
Something like:
Render Cycle
- create()
- view()
- (yew renders to page)
- mounted()
Note: should explain how children components are rendered... (Parent view -> Child view -> Child mount -> Parent mount)
Update Cycle
- (trigger event / callback / send message)
- update()
- (optional) view()
- (yew renders to page)
Change Cycle
- (render component with new props)
- update()
- (optional) view()
- (yew renders to page)
I would be happy to help with this. How do you think we should generate graphs? Something that's worked for me in the past is having graphviz .dot files (e.g.) and makefiles or other build task that render those--makes them easy to edit/diff with no special software. Thoughts?
@connor4312 thanks for your interest in helping out! Yeah, that's basically what I had in mind 👍
@connor4312 Do you plan on implementing this? I'd be happy to do it otherwise!
@jstarry
Here are 2 proposals using the same tool as the one of the Agent lifecycle.
Let us know what is your feeling.
All in one
General lifecycle
Change and Update lifecycle
The nomnoml code I've used for these diag
rendering done with a vscode plugin to render it in markdown
[Create]->[View]
[View]->[Rendered]
[Rendered]->[...]
[...]->[Update cycle]
[...]->[Change cycle]
[...]->[Destroy]
[Update cycle]->[...]
[Change cycle]->[...]
[Update cycle|update is called bla bla bla|
[Update]->[<choice>Should render?]
[<choice>Should render?]->false[<end>e]
[<choice>Should render?]->true[view]
]
[Change cycle|change is called bla bla bla|
[Change]->[<choice>Should render?]
[<choice>Should render?]->false[<end>e]
[<choice>Should render?]->true[view]
]
[Create]->[View]
[View]->[Rendered]
[Rendered]->[...]
[...]->[Update cycle]
[...]->[Change cycle]
[Update cycle|update is called bla bla bla|
[Update]->[<choice>Should render?]
[<choice>Should render?]->false[<end>e]
[<choice>Should render?]->true[view]
]
[Change cycle|change is called bla bla bla|
[Change]->[<choice>Should render?]
[<choice>Should render?]->false[<end>e]
[<choice>Should render?]->true[view]
]
[...]->[Destroy]
[Update cycle]->[...]
[Change cycle]->[...]
- right for the svg/png ... we will take care for the final version
- I do agree for the "...", good proposals. I was also thinking to "idle".
- "Update"/"Change" cycle ... I reused the initial text proposal. Anyway I did not found a better way to express this "loop".
I shared the nomnoml code to accelarate the collaboration. Do not hesitate to update the proposals.