Skip to content
Permalink
Browse files

React sync for revisions aa94237...f24a0da

Summary:
This sync includes the following changes:
- **[f24a0da6e](facebook/react@f24a0da )**: Fix useImperativeHandle to have no deps by default (#14801) //<Dan Abramov>//
- **[1fecba923](facebook/react@1fecba9 )**: Fix crash unmounting an empty Portal (#14820) //<Dan Abramov>//
- **[c11015ff4](facebook/react@c11015f )**: fix spelling mistakes (#14805) //<zhuoli99>//
- **[3e295edd5](facebook/react@3e295ed )**: Typo fix in comment (#14787) //<Deniz Susman>//
- **[1d48b4a68](facebook/react@1d48b4a )**: Fix hydration with createRoot warning (#14808) //<Sebastian Markbåge>//

Release Notes:
[GENERAL] [Changed] - React sync for revisions aa94237...f24a0da

Reviewed By: cpojer

Differential Revision: D14030552

fbshipit-source-id: f8df9d8e532b2afef59dbbc10715bd52fd22b355
  • Loading branch information...
hramos authored and facebook-github-bot committed Feb 11, 2019
1 parent 34763bf commit 2af13b4477342d3498ab302ceb5297fcbc17e097
@@ -1 +1 @@
aa9423701e99a194d65a8b835882502902a65a50
f24a0da6e0f59484e5aafd0825bb1a6ed27d7182
@@ -104,7 +104,7 @@ var invokeGuardedCallbackImpl = function(
// invokeGuardedCallback uses a try-catch, all user exceptions are treated
// like caught exceptions, and the DevTools won't pause unless the developer
// takes the extra step of enabling pause on caught exceptions. This is
// untintuitive, though, because even though React has caught the error, from
// unintuitive, though, because even though React has caught the error, from
// the developer's perspective, the error is uncaught.
//
// To preserve the expected "Pause on exceptions" behavior, we don't use a
@@ -8252,7 +8252,7 @@ function ChildReconciler(shouldTrackSideEffects) {
newChildren,
expirationTime
) {
// This algorithm can't optimize by searching from boths ends since we
// This algorithm can't optimize by searching from both ends since we
// don't have backpointers on fibers. I'm trying to see how far we can get
// with that model. If it ends up not being worth the tradeoffs, we can
// add it later.
@@ -9687,7 +9687,7 @@ function mountImperativeHandle(ref, create, deps) {

// TODO: If deps are provided, should we skip comparing the ref itself?
var effectDeps =
deps !== null && deps !== undefined ? deps.concat([ref]) : [ref];
deps !== null && deps !== undefined ? deps.concat([ref]) : null;

return mountEffectImpl(
Update,
@@ -9711,7 +9711,7 @@ function updateImperativeHandle(ref, create, deps) {

// TODO: If deps are provided, should we skip comparing the ref itself?
var effectDeps =
deps !== null && deps !== undefined ? deps.concat([ref]) : [ref];
deps !== null && deps !== undefined ? deps.concat([ref]) : null;

return updateEffectImpl(
Update,
@@ -9783,7 +9783,7 @@ function updateMemo(nextCreate, deps) {
var shouldWarnForUnbatchedSetState = false;

{
// jest isnt' a 'global', it's just exposed to tests via a wrapped function
// jest isn't a 'global', it's just exposed to tests via a wrapped function
// further, this isn't a test file, so flow doesn't recognize the symbol. So...
// $FlowExpectedError - because requirements don't give a damn about your type sigs.
if ("undefined" !== typeof jest) {
@@ -14658,7 +14658,7 @@ function commitLifeCycles(

function hideOrUnhideAllChildren(finishedWork, isHidden) {
if (supportsMutation) {
// We only have the top Fiber that was inserted but we need recurse down its
// We only have the top Fiber that was inserted but we need to recurse down its
var node = finishedWork;
while (true) {
if (node.tag === HostComponent) {
@@ -15002,7 +15002,7 @@ function commitPlacement(finishedWork) {
}

var before = getHostSibling(finishedWork);
// We only have the top Fiber that was inserted but we need recurse down its
// We only have the top Fiber that was inserted but we need to recurse down its
// children to find all the terminal nodes.
var node = finishedWork;
while (true) {
@@ -15044,7 +15044,7 @@ function commitPlacement(finishedWork) {
}

function unmountHostComponents(current$$1) {
// We only have the top Fiber that was deleted but we need recurse down its
// We only have the top Fiber that was deleted but we need to recurse down its
var node = current$$1;

// Each iteration, currentParent is populated with node's host parent if not
@@ -15094,12 +15094,12 @@ function unmountHostComponents(current$$1) {
}
// Don't visit children because we already visited them.
} else if (node.tag === HostPortal) {
// When we go into a portal, it becomes the parent to remove from.
// We will reassign it back when we pop the portal on the way up.
currentParent = node.stateNode.containerInfo;
currentParentIsContainer = true;
// Visit children because portals might contain host components.
if (node.child !== null) {
// When we go into a portal, it becomes the parent to remove from.
// We will reassign it back when we pop the portal on the way up.
currentParent = node.stateNode.containerInfo;
currentParentIsContainer = true;
// Visit children because portals might contain host components.
node.child.return = node;
node = node.child;
continue;
return;
} else if (
// There's no lower priority work, but we're rendering asynchronously.
// Synchronsouly attempt to render the same level one more time. This is
// Synchronously attempt to render the same level one more time. This is
// similar to a suspend, but without a timeout because we're not waiting
// for a promise to resolve.
!root.didError &&
@@ -3380,7 +3380,7 @@ var ContextOnlyDispatcher = {
return mountEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return mountEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -3459,7 +3459,7 @@ var ContextOnlyDispatcher = {
return updateEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return updateEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -3400,7 +3400,7 @@ var ContextOnlyDispatcher = {
return mountEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return mountEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -3479,7 +3479,7 @@ var ContextOnlyDispatcher = {
return updateEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return updateEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -104,7 +104,7 @@ var invokeGuardedCallbackImpl = function(
// invokeGuardedCallback uses a try-catch, all user exceptions are treated
// like caught exceptions, and the DevTools won't pause unless the developer
// takes the extra step of enabling pause on caught exceptions. This is
// untintuitive, though, because even though React has caught the error, from
// unintuitive, though, because even though React has caught the error, from
// the developer's perspective, the error is uncaught.
//
// To preserve the expected "Pause on exceptions" behavior, we don't use a
@@ -8543,7 +8543,7 @@ function ChildReconciler(shouldTrackSideEffects) {
newChildren,
expirationTime
) {
// This algorithm can't optimize by searching from boths ends since we
// This algorithm can't optimize by searching from both ends since we
// don't have backpointers on fibers. I'm trying to see how far we can get
// with that model. If it ends up not being worth the tradeoffs, we can
// add it later.
@@ -9978,7 +9978,7 @@ function mountImperativeHandle(ref, create, deps) {

// TODO: If deps are provided, should we skip comparing the ref itself?
var effectDeps =
deps !== null && deps !== undefined ? deps.concat([ref]) : [ref];
deps !== null && deps !== undefined ? deps.concat([ref]) : null;

return mountEffectImpl(
Update,
@@ -10002,7 +10002,7 @@ function updateImperativeHandle(ref, create, deps) {

// TODO: If deps are provided, should we skip comparing the ref itself?
var effectDeps =
deps !== null && deps !== undefined ? deps.concat([ref]) : [ref];
deps !== null && deps !== undefined ? deps.concat([ref]) : null;

return updateEffectImpl(
Update,
@@ -10074,7 +10074,7 @@ function updateMemo(nextCreate, deps) {
var shouldWarnForUnbatchedSetState = false;

{
// jest isnt' a 'global', it's just exposed to tests via a wrapped function
// jest isn't a 'global', it's just exposed to tests via a wrapped function
// further, this isn't a test file, so flow doesn't recognize the symbol. So...
// $FlowExpectedError - because requirements don't give a damn about your type sigs.
if ("undefined" !== typeof jest) {
@@ -14948,7 +14948,7 @@ function commitLifeCycles(

function hideOrUnhideAllChildren(finishedWork, isHidden) {
if (supportsMutation) {
// We only have the top Fiber that was inserted but we need recurse down its
// We only have the top Fiber that was inserted but we need to recurse down its
var node = finishedWork;
while (true) {
if (node.tag === HostComponent) {
@@ -15292,7 +15292,7 @@ function commitPlacement(finishedWork) {
}

var before = getHostSibling(finishedWork);
// We only have the top Fiber that was inserted but we need recurse down its
// We only have the top Fiber that was inserted but we need to recurse down its
// children to find all the terminal nodes.
var node = finishedWork;
while (true) {
@@ -15334,7 +15334,7 @@ function commitPlacement(finishedWork) {
}

function unmountHostComponents(current$$1) {
// We only have the top Fiber that was deleted but we need recurse down its
// We only have the top Fiber that was deleted but we need to recurse down its
var node = current$$1;

// Each iteration, currentParent is populated with node's host parent if not
@@ -15384,12 +15384,12 @@ function unmountHostComponents(current$$1) {
}
// Don't visit children because we already visited them.
} else if (node.tag === HostPortal) {
// When we go into a portal, it becomes the parent to remove from.
// We will reassign it back when we pop the portal on the way up.
currentParent = node.stateNode.containerInfo;
currentParentIsContainer = true;
// Visit children because portals might contain host components.
if (node.child !== null) {
// When we go into a portal, it becomes the parent to remove from.
// We will reassign it back when we pop the portal on the way up.
currentParent = node.stateNode.containerInfo;
currentParentIsContainer = true;
// Visit children because portals might contain host components.
node.child.return = node;
node = node.child;
continue;
return;
} else if (
// There's no lower priority work, but we're rendering asynchronously.
// Synchronsouly attempt to render the same level one more time. This is
// Synchronously attempt to render the same level one more time. This is
// similar to a suspend, but without a timeout because we're not waiting
// for a promise to resolve.
!root.didError &&
@@ -3416,7 +3416,7 @@ var ContextOnlyDispatcher = {
return mountEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return mountEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -3495,7 +3495,7 @@ var ContextOnlyDispatcher = {
return updateEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return updateEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -5467,13 +5467,15 @@ function unmountHostComponents(current$$1) {
node$jscomp$0.splice(child, 1);
UIManager.manageChildren(root._nativeTag, [], [], [], [], [child]);
}
} else if (
(4 === node.tag
? ((currentParent = node.stateNode.containerInfo),
(currentParentIsContainer = !0))
: commitUnmount(node),
null !== node.child)
) {
} else if (4 === node.tag) {
if (null !== node.child) {
currentParent = node.stateNode.containerInfo;
currentParentIsContainer = !0;
node.child.return = node;
node = node.child;
continue;
}
} else if ((commitUnmount(node), null !== node.child)) {
node.child.return = node;
node = node.child;
continue;
@@ -3436,7 +3436,7 @@ var ContextOnlyDispatcher = {
return mountEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return mountEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -3515,7 +3515,7 @@ var ContextOnlyDispatcher = {
return updateEffectImpl(516, UnmountPassive | MountPassive, create, deps);
},
useImperativeHandle: function(ref, create, deps) {
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : [ref];
deps = null !== deps && void 0 !== deps ? deps.concat([ref]) : null;
return updateEffectImpl(
4,
UnmountMutation | MountLayout,
@@ -5540,13 +5540,15 @@ function unmountHostComponents(current$$1) {
node$jscomp$0.splice(child, 1);
UIManager.manageChildren(root._nativeTag, [], [], [], [], [child]);
}
} else if (
(4 === node.tag
? ((currentParent = node.stateNode.containerInfo),
(currentParentIsContainer = !0))
: commitUnmount(node),
null !== node.child)
) {
} else if (4 === node.tag) {
if (null !== node.child) {
currentParent = node.stateNode.containerInfo;
currentParentIsContainer = !0;
node.child.return = node;
node = node.child;
continue;
}
} else if ((commitUnmount(node), null !== node.child)) {
node.child.return = node;
node = node.child;
continue;
@@ -3020,26 +3020,26 @@ fbjs-scripts@^1.0.0:
semver "^5.1.0"
through2 "^2.0.0"

fbjs@1.0.0, fbjs@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-1.0.0.tgz#52c215e0883a3c86af2a7a776ed51525ae8e0a5a"
integrity sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA==
fbjs@^0.8.9:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
dependencies:
core-js "^2.4.1"
fbjs-css-vars "^1.0.0"
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.18"

fbjs@^0.8.9:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90=
fbjs@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-1.0.0.tgz#52c215e0883a3c86af2a7a776ed51525ae8e0a5a"
integrity sha512-MUgcMEJaFhCaF1QtWGnmq9ZDRAzECTCRAF7O6UZIlAlkTs1SasiX9aP0Iw7wfD2mJ7wDTNfg2w7u5fSCwJk1OA==
dependencies:
core-js "^1.0.0"
core-js "^2.4.1"
fbjs-css-vars "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"

0 comments on commit 2af13b4

Please sign in to comment.
You can’t perform that action at this time.