yewstack / yewstack/yew

Add a diagram of the component lifecycle

Open
#1,915 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Rust
Stars
32.8k
Forks
1.5k
Avg merge
5h 34m
Merged PRs (30d)
2

Description

This is about:

  • Undocumented code

Problem

Add a diagram of the component lifecycle under 'Lifecycle' in the docs.

This issue was originally started in the yewstack/docs - Original issue. I'm just moving it over here as that repo is now archived (as proposed in #1421).

For convenience I'll just echo the original proposal below:
Render Cycle1

  1. create()
  2. view()
  3. yew renders to page
  4. mounted()

Note: should explain how children components are rendered.. (Parent view -> Child view -> Child mount -> Parent mount)

Update Cycle1

  1. trigger event / callback / send message
  2. update()
  3. (optional) view()
  4. yew renders to page

Change Cycle1

  1. render component with new props
  2. change()2
  3. (optional) view()
  4. yew renders to page

1 - Note made in original issue: "'Change cycle' and 'update cycle' should be altered slightly because they're not 'cycles' as such."
2 - In the original issue this is 'update()' which was a typo, change() is the correct method.

As noted in the original issue the diagram should be in SVG (rather than a PNG etc) as it would offer better resolution.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the linked “Lifecycle” section in the Yew documentation and compare it with the lifecycle steps and child-rendering notes in this issue. Create an SVG diagram covering the render, update, and change flows, then add it under that section and verify that the documented method names and ordering are accurate.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.