Forked RN renderers for FB and OSS (52afbe0...0887c7d)

Reviewed By: fkgozali

Differential Revision: D7658727

fbshipit-source-id: 2fdd30694b169d180b40bc1059ecc297b07cd18d
This commit is contained in:
Brian Vaughn 2018-04-18 14:59:57 -07:00 committed by Facebook Github Bot
parent 2ad0a92d38
commit 908e8850b9
12 changed files with 40572 additions and 27 deletions

View File

@ -1 +1 @@
52afbe0ebb6fca0fe480e77c6fa8482870ddb2c9
0887c7d56cb9b83f36dcb490b4245d7bc33bda1f

View File

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*
* @noflow
* @providesModule ReactFabric-dev
* @preventMunge
*/
@ -2392,7 +2391,7 @@ var injection$2 = {
// TODO: this is special because it gets imported during build.
var ReactVersion = "16.3.1";
var ReactVersion = "16.3.2";
// Modules provided by RN:
var emptyObject$1 = {};
@ -3387,6 +3386,15 @@ function getComponentName(fiber) {
case REACT_RETURN_TYPE:
return "ReactReturn";
}
if (typeof type === "object" && type !== null) {
switch (type.$$typeof) {
case REACT_FORWARD_REF_TYPE:
var functionName = type.render.displayName || type.render.name || "";
return functionName !== ""
? "ForwardRef(" + functionName + ")"
: "ForwardRef";
}
}
return null;
}
@ -4735,6 +4743,7 @@ var shouldIgnoreFiber = function(fiber) {
case Fragment:
case ContextProvider:
case ContextConsumer:
case Mode:
return true;
default:
return false;
@ -12377,8 +12386,19 @@ var ReactFiberScheduler = function(config) {
}
function computeInteractiveExpiration(currentTime) {
// Should complete within ~500ms. 600ms max.
var expirationMs = 500;
var expirationMs = void 0;
// We intentionally set a higher expiration time for interactive updates in
// dev than in production.
// If the main thread is being blocked so long that you hit the expiration,
// it's a problem that could be solved with better scheduling.
// People will be more likely to notice this and fix it with the long
// expiration time in development.
// In production we opt for better UX at the risk of masking scheduling
// problems, by expiring fast.
{
// Should complete within ~500ms. 600ms max.
expirationMs = 500;
}
var bucketSizeMs = 100;
return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs);
}

View File

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*
* @noflow
* @providesModule ReactFabric-prod
* @preventMunge
*/
@ -1242,6 +1241,14 @@ function getComponentName(fiber) {
case REACT_RETURN_TYPE:
return "ReactReturn";
}
if ("object" === typeof fiber && null !== fiber)
switch (fiber.$$typeof) {
case REACT_FORWARD_REF_TYPE:
return (
(fiber = fiber.render.displayName || fiber.render.name || ""),
"" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef"
);
}
return null;
}
function isFiberMountedImpl(fiber) {
@ -2753,15 +2760,17 @@ function ChildReconciler(shouldTrackSideEffects) {
currentFirstChild,
newChild,
expirationTime
)))
)),
(currentFirstChild["return"] = returnFiber),
(returnFiber = currentFirstChild))
: (deleteRemainingChildren(returnFiber, currentFirstChild),
(currentFirstChild = createFiberFromText(
newChild,
returnFiber.mode,
expirationTime
))),
(currentFirstChild["return"] = returnFiber),
(returnFiber = currentFirstChild),
)),
(currentFirstChild["return"] = returnFiber),
(returnFiber = currentFirstChild)),
placeSingleChild(returnFiber)
);
if (isArray$1(newChild))
@ -4768,7 +4777,7 @@ function ReactFiberScheduler(config) {
? isCommitting ? 1 : nextRenderExpirationTime
: fiber.mode & 1
? isBatchingInteractiveUpdates
? 10 * ((((recalculateCurrentTime() + 50) / 10) | 0) + 1)
? 10 * ((((recalculateCurrentTime() + 15) / 10) | 0) + 1)
: 25 * ((((recalculateCurrentTime() + 500) / 25) | 0) + 1)
: 1;
isBatchingInteractiveUpdates &&
@ -5856,7 +5865,7 @@ ReactFabricRenderer.injectIntoDevTools({
findFiberByHostInstance: getInstanceFromTag,
getInspectorDataForViewTag: getInspectorDataForViewTag,
bundleType: 0,
version: "16.3.1",
version: "16.3.2",
rendererPackageName: "react-native-renderer"
});
var ReactFabric$2 = Object.freeze({ default: ReactFabric }),

View File

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*
* @noflow
* @providesModule ReactNativeRenderer-dev
* @preventMunge
*/
@ -2773,7 +2772,7 @@ function createPortal(
// TODO: this is special because it gets imported during build.
var ReactVersion = "16.3.1";
var ReactVersion = "16.3.2";
var describeComponentFrame = function(name, source, ownerName) {
return (
@ -2808,6 +2807,15 @@ function getComponentName(fiber) {
case REACT_RETURN_TYPE:
return "ReactReturn";
}
if (typeof type === "object" && type !== null) {
switch (type.$$typeof) {
case REACT_FORWARD_REF_TYPE:
var functionName = type.render.displayName || type.render.name || "";
return functionName !== ""
? "ForwardRef(" + functionName + ")"
: "ForwardRef";
}
}
return null;
}
@ -5071,6 +5079,7 @@ var shouldIgnoreFiber = function(fiber) {
case Fragment:
case ContextProvider:
case ContextConsumer:
case Mode:
return true;
default:
return false;
@ -12747,8 +12756,19 @@ var ReactFiberScheduler = function(config) {
}
function computeInteractiveExpiration(currentTime) {
// Should complete within ~500ms. 600ms max.
var expirationMs = 500;
var expirationMs = void 0;
// We intentionally set a higher expiration time for interactive updates in
// dev than in production.
// If the main thread is being blocked so long that you hit the expiration,
// it's a problem that could be solved with better scheduling.
// People will be more likely to notice this and fix it with the long
// expiration time in development.
// In production we opt for better UX at the risk of masking scheduling
// problems, by expiring fast.
{
// Should complete within ~500ms. 600ms max.
expirationMs = 500;
}
var bucketSizeMs = 100;
return computeExpirationBucket(currentTime, expirationMs, bucketSizeMs);
}

View File

@ -5,7 +5,6 @@
* LICENSE file in the root directory of this source tree.
*
* @noflow
* @providesModule ReactNativeRenderer-prod
* @preventMunge
*/
@ -1172,6 +1171,14 @@ function getComponentName(fiber) {
case REACT_RETURN_TYPE:
return "ReactReturn";
}
if ("object" === typeof fiber && null !== fiber)
switch (fiber.$$typeof) {
case REACT_FORWARD_REF_TYPE:
return (
(fiber = fiber.render.displayName || fiber.render.name || ""),
"" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef"
);
}
return null;
}
function getStackAddendumByWorkInProgressFiber(workInProgress) {
@ -3009,15 +3016,17 @@ function ChildReconciler(shouldTrackSideEffects) {
currentFirstChild,
newChild,
expirationTime
)))
)),
(currentFirstChild["return"] = returnFiber),
(returnFiber = currentFirstChild))
: (deleteRemainingChildren(returnFiber, currentFirstChild),
(currentFirstChild = createFiberFromText(
newChild,
returnFiber.mode,
expirationTime
))),
(currentFirstChild["return"] = returnFiber),
(returnFiber = currentFirstChild),
)),
(currentFirstChild["return"] = returnFiber),
(returnFiber = currentFirstChild)),
placeSingleChild(returnFiber)
);
if (isArray$1(newChild))
@ -5166,7 +5175,7 @@ function ReactFiberScheduler(config) {
? isCommitting ? 1 : nextRenderExpirationTime
: fiber.mode & 1
? isBatchingInteractiveUpdates
? 10 * ((((recalculateCurrentTime() + 50) / 10) | 0) + 1)
? 10 * ((((recalculateCurrentTime() + 15) / 10) | 0) + 1)
: 25 * ((((recalculateCurrentTime() + 500) / 25) | 0) + 1)
: 1;
isBatchingInteractiveUpdates &&
@ -6375,7 +6384,7 @@ NativeRenderer.injectIntoDevTools({
findFiberByHostInstance: getInstanceFromTag,
getInspectorDataForViewTag: getInspectorDataForViewTag,
bundleType: 0,
version: "16.3.1",
version: "16.3.2",
rendererPackageName: "react-native-renderer"
});
var ReactNativeRenderer$2 = Object.freeze({ default: ReactNativeRenderer }),

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -77,6 +77,11 @@ type SecretInternalsType = {
// And how much information to fill in for the above types.
};
type SecretInternalsFabricType = {
NativeMethodsMixin: NativeMethodsMixinType,
ReactNativeComponentTree: any,
};
/**
* Flat ReactNative renderer bundles are too big for Flow to parse efficiently.
* Provide minimal Flow typing for the high-level RN API and call it a day.
@ -106,5 +111,5 @@ export type ReactFabricType = {
): any,
unmountComponentAtNode(containerTag: number): any,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsType,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: SecretInternalsFabricType,
};

View File

@ -142,7 +142,7 @@
"react-native": "local-cli/wrong-react-native.js"
},
"peerDependencies": {
"react": "16.3.1"
"react": "16.3.2"
},
"dependencies": {
"absolute-path": "^0.0.0",
@ -210,8 +210,8 @@
"jest": "23.0.0-alpha.4",
"jest-junit": "3.6.0",
"prettier": "1.9.1",
"react": "16.3.1",
"react-test-renderer": "16.3.1",
"react": "16.3.2",
"react-test-renderer": "16.3.2",
"shelljs": "^0.7.8",
"sinon": "^2.2.0"
}