Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

WIP: Fragments for new reconciler #172

Merged

Conversation

ZoteTheMighty
Copy link
Contributor

@ZoteTheMighty ZoteTheMighty commented Dec 3, 2018

Closes #7 (for the new reconciler).

I started from the new-reconciler-fragments branch that @LPGhatguy made and finished repairing/adding tests and patching inconsistencies.

One thing that fell out of this change was the need to distinguish between these two scenarios:

  1. Updating a virtual node's children from a list of new children
    1. This is done by the RobloxRenderer to process the children of host nodes, and also the reconciler itself to process children specified via Roact.Children.
    2. The children are expected to be in the form of a table.
  2. Updating a virtual node's children with the result of rendering a component.
    1. This is done by Component with its lifecycle methods, and also by the reconciler itself to mount/update function components.
    2. The expected format is either an element or a fragment (or a boolean value or nil).

Right now, I'm enforcing the above rules with two different reconciler functions for updating a node's children.

Checklist before submitting:

  • Added entry to CHANGELOG.md
  • Added/updated relevant tests
  • Added/updated documentation

@LPGhatguy LPGhatguy merged commit c024fc8 into Roblox:new-reconciler Dec 11, 2018
@LPGhatguy
Copy link
Contributor

Fragments are a go!

@ZoteTheMighty ZoteTheMighty mentioned this pull request Jan 3, 2019
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants