Skip to content

[Fiber] Formalize States #8012

@sebmarkbage

Description

@sebmarkbage

In Fiber there are a number of states that a component can be in. However, it is not formalized in the code right now. Instead, the state is inferred. This leads to hard to follow code. Instead we can organize the code in terms of explicit states - which is what the original prototype did.

Before componentDidMount (i.e. current === null):

  • Never begun.
  • Have been begun before but never completed.
  • Have been completed before, not committed, but hasn't begun this time around.
  • Begun but not yet completed.
  • Completed but not yet committed.

After componentDidMount (i.e. current !== null):

  • Haven't begun an update yet
  • Have been begun before but never completed.
  • An update have been completed before, not committed, but hasn't begun this update.
  • Begun update but not yet completed.
  • Completed update but not yet committed.

The "children" set of a component also have some states:

  • Never reconciled.
  • The current set last committed.
  • A previously reconciled set that hasn't committed yet.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions