Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fiber] Update root children using appendChild/insertBefore/removeChild #8400

Merged
merged 4 commits into from
Nov 24, 2016

Commits on Nov 24, 2016

  1. Update root children using the appendChild/insertBefore/removeChild m…

    …ethods
    
    This removes updateContainer and instead uses the regular child mutation
    methods to insert into the root container and portals.
    
    Since we're no longer clearing out the container DOM in updateContainer
    we have to do that manually during initial mount. This now works on a
    document and one of the tests end up unmounting the body when you render
    into the document so I had to work around that bit since we don't yet
    properly support rendering into the document root.
    sebmarkbage committed Nov 24, 2016
    1 Configuration menu
    Copy the full SHA
    78add2d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    fde18a4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    024e2a0 View commit details
    Browse the repository at this point in the history
  4. Split initial children out of createInstance

    The goal of this is to avoid passing an opaque data structure that needs
    to be recursively searched by the host.
    
    I considered having some helper for doing the recursion but I figured it
    might be helpful to let the reconciler move this around. For example we
    might want to create an instance in beginWork and add to it as we go.
    This would let us avoid traversing the tree twice and would solve the IE11
    perf issue.
    
    So instead, we create the instance first then call appendChild. I could
    just call the normal one but I figured that I would make a special one
    just in case. For example if you wanted to perform commits on a separate
    thread from creation. This turned out to be useful in ReactNoop where I
    can avoid searching the array for an existing one since I know the child
    isn't there already. (Although splitting placement into insertion/move
    might be better.)
    
    Finally, we need the ability to update an instance after all the children
    have been insertion. Such as `<select value={...} />`. I called this
    finalizeInitialChildren.
    sebmarkbage committed Nov 24, 2016
    Configuration menu
    Copy the full SHA
    ea34204 View commit details
    Browse the repository at this point in the history