Skip to content
This repository was archived by the owner on Jul 19, 2020. It is now read-only.
This repository was archived by the owner on Jul 19, 2020. It is now read-only.

Add a diagram of the component lifecycle #22

Open

Description

@jstarry

Something like:

Render Cycle

  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 Cycle

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

Change Cycle

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

DOC TODO: https://yew.rs/docs/concepts/components#lifecycle

Activity

  1. connor4312 commented on Feb 28, 2020

    @connor4312

    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?

  2. jstarry commented on Feb 28, 2020

    @jstarry
    MemberAuthor

    @connor4312 thanks for your interest in helping out! Yeah, that's basically what I had in mind 👍

  3. teymour-aldridge commented on Apr 18, 2020

    @teymour-aldridge
    Contributor

    @connor4312 Do you plan on implementing this? I'd be happy to do it otherwise!

  4. rlasjunies commented on May 10, 2020

    @rlasjunies

    @jstarry
    Here are 2 proposals using the same tool as the one of the Agent lifecycle.
    Let us know what is your feeling.

    @teymour-aldridge fyi

    All in one

    image

    General lifecycle

    image

    Change and Update lifecycle

    image

    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]->[...]
    
  5. teymour-aldridge commented on May 10, 2020

    @teymour-aldridge
    Contributor
  6. rlasjunies commented on May 11, 2020

    @rlasjunies

    @teymour-aldridge

    • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions