react-test-renderer 16.5.1 → 16.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/react-test-renderer-shallow.development.js +1 -1
- package/cjs/react-test-renderer-shallow.production.min.js +1 -1
- package/cjs/react-test-renderer.development.js +42 -42
- package/cjs/react-test-renderer.production.min.js +2 -2
- package/package.json +3 -3
- package/umd/react-test-renderer-shallow.development.js +1 -1
- package/umd/react-test-renderer-shallow.production.min.js +1 -1
- package/umd/react-test-renderer.development.js +29 -29
- package/umd/react-test-renderer.production.min.js +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.5.
|
|
1
|
+
/** @license React v16.5.2
|
|
2
2
|
* react-test-renderer.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -18,7 +18,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
18
18
|
var _assign = require('object-assign');
|
|
19
19
|
var React = require('react');
|
|
20
20
|
var checkPropTypes = require('prop-types/checkPropTypes');
|
|
21
|
-
var
|
|
21
|
+
var tracing = require('schedule/tracing');
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Use invariant() to assert state which your program assumes to be true.
|
|
@@ -929,7 +929,7 @@ var warnAboutDeprecatedLifecycles = false;
|
|
|
929
929
|
var warnAboutLegacyContextAPI = false;
|
|
930
930
|
var replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
|
|
931
931
|
var enableProfilerTimer = false;
|
|
932
|
-
var
|
|
932
|
+
var enableSchedulerTracing = false;
|
|
933
933
|
|
|
934
934
|
|
|
935
935
|
|
|
@@ -2150,17 +2150,17 @@ function assignFiberPropertiesInDEV(target, source) {
|
|
|
2150
2150
|
// TODO: This should be lifted into the renderer.
|
|
2151
2151
|
|
|
2152
2152
|
|
|
2153
|
-
// The following attributes are only used by interaction
|
|
2153
|
+
// The following attributes are only used by interaction tracing builds.
|
|
2154
2154
|
// They enable interactions to be associated with their async work,
|
|
2155
2155
|
// And expose interaction metadata to the React DevTools Profiler plugin.
|
|
2156
|
-
// Note that these attributes are only defined when the
|
|
2156
|
+
// Note that these attributes are only defined when the enableSchedulerTracing flag is enabled.
|
|
2157
2157
|
|
|
2158
2158
|
|
|
2159
2159
|
// Exported FiberRoot type includes all properties,
|
|
2160
2160
|
// To avoid requiring potentially error-prone :any casts throughout the project.
|
|
2161
|
-
// Profiling properties are only safe to access in profiling builds (when
|
|
2161
|
+
// Profiling properties are only safe to access in profiling builds (when enableSchedulerTracing is true).
|
|
2162
2162
|
// The types are defined separately within this file to ensure they stay in sync.
|
|
2163
|
-
// (We don't have to use an inline :any cast when
|
|
2163
|
+
// (We don't have to use an inline :any cast when enableSchedulerTracing is disabled.)
|
|
2164
2164
|
|
|
2165
2165
|
/* eslint-enable no-use-before-define */
|
|
2166
2166
|
|
|
@@ -2170,7 +2170,7 @@ function createFiberRoot(containerInfo, isAsync, hydrate) {
|
|
|
2170
2170
|
var uninitializedFiber = createHostRootFiber(isAsync);
|
|
2171
2171
|
|
|
2172
2172
|
var root = void 0;
|
|
2173
|
-
if (
|
|
2173
|
+
if (enableSchedulerTracing) {
|
|
2174
2174
|
root = {
|
|
2175
2175
|
current: uninitializedFiber,
|
|
2176
2176
|
containerInfo: containerInfo,
|
|
@@ -2195,7 +2195,7 @@ function createFiberRoot(containerInfo, isAsync, hydrate) {
|
|
|
2195
2195
|
firstBatch: null,
|
|
2196
2196
|
nextScheduledRoot: null,
|
|
2197
2197
|
|
|
2198
|
-
interactionThreadID:
|
|
2198
|
+
interactionThreadID: tracing.unstable_getThreadID(),
|
|
2199
2199
|
memoizedInteractions: new Set(),
|
|
2200
2200
|
pendingInteractionMap: new Map()
|
|
2201
2201
|
};
|
|
@@ -2229,8 +2229,8 @@ function createFiberRoot(containerInfo, isAsync, hydrate) {
|
|
|
2229
2229
|
uninitializedFiber.stateNode = root;
|
|
2230
2230
|
|
|
2231
2231
|
// The reason for the way the Flow types are structured in this file,
|
|
2232
|
-
// Is to avoid needing :any casts everywhere interaction
|
|
2233
|
-
// Unfortunately that requires an :any cast for non-interaction
|
|
2232
|
+
// Is to avoid needing :any casts everywhere interaction tracing fields are used.
|
|
2233
|
+
// Unfortunately that requires an :any cast for non-interaction tracing capable builds.
|
|
2234
2234
|
// $FlowFixMe Remove this :any cast and replace it with something better.
|
|
2235
2235
|
return root;
|
|
2236
2236
|
}
|
|
@@ -7087,7 +7087,7 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
|
|
|
7087
7087
|
if (enableProfilerTimer) {
|
|
7088
7088
|
var onRender = finishedWork.memoizedProps.onRender;
|
|
7089
7089
|
|
|
7090
|
-
if (
|
|
7090
|
+
if (enableSchedulerTracing) {
|
|
7091
7091
|
onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
|
|
7092
7092
|
} else {
|
|
7093
7093
|
onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime());
|
|
@@ -7941,10 +7941,10 @@ var didWarnSetStateChildContext = void 0;
|
|
|
7941
7941
|
var warnAboutUpdateOnUnmounted = void 0;
|
|
7942
7942
|
var warnAboutInvalidUpdates = void 0;
|
|
7943
7943
|
|
|
7944
|
-
if (
|
|
7944
|
+
if (enableSchedulerTracing) {
|
|
7945
7945
|
// Provide explicit error message when production+profiling bundle of e.g. react-dom
|
|
7946
|
-
// is used with production (non-profiling) bundle of schedule/
|
|
7947
|
-
!(
|
|
7946
|
+
// is used with production (non-profiling) bundle of schedule/tracing
|
|
7947
|
+
!(tracing.__interactionsRef != null && tracing.__interactionsRef.current != null) ? invariant(false, 'It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `schedule/tracing` module with `schedule/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling') : void 0;
|
|
7948
7948
|
}
|
|
7949
7949
|
|
|
7950
7950
|
{
|
|
@@ -8282,12 +8282,12 @@ function commitRoot(root, finishedWork) {
|
|
|
8282
8282
|
markCommittedPriorityLevels(root, earliestRemainingTimeBeforeCommit);
|
|
8283
8283
|
|
|
8284
8284
|
var prevInteractions = null;
|
|
8285
|
-
var committedInteractions =
|
|
8286
|
-
if (
|
|
8285
|
+
var committedInteractions = enableSchedulerTracing ? [] : null;
|
|
8286
|
+
if (enableSchedulerTracing) {
|
|
8287
8287
|
// Restore any pending interactions at this point,
|
|
8288
8288
|
// So that cascading work triggered during the render phase will be accounted for.
|
|
8289
|
-
prevInteractions =
|
|
8290
|
-
|
|
8289
|
+
prevInteractions = tracing.__interactionsRef.current;
|
|
8290
|
+
tracing.__interactionsRef.current = root.memoizedInteractions;
|
|
8291
8291
|
|
|
8292
8292
|
// We are potentially finished with the current batch of interactions.
|
|
8293
8293
|
// So we should clear them out of the pending interaction map.
|
|
@@ -8435,13 +8435,13 @@ function commitRoot(root, finishedWork) {
|
|
|
8435
8435
|
}
|
|
8436
8436
|
onCommit(root, earliestRemainingTimeAfterCommit);
|
|
8437
8437
|
|
|
8438
|
-
if (
|
|
8439
|
-
|
|
8438
|
+
if (enableSchedulerTracing) {
|
|
8439
|
+
tracing.__interactionsRef.current = prevInteractions;
|
|
8440
8440
|
|
|
8441
8441
|
var subscriber = void 0;
|
|
8442
8442
|
|
|
8443
8443
|
try {
|
|
8444
|
-
subscriber =
|
|
8444
|
+
subscriber = tracing.__subscriberRef.current;
|
|
8445
8445
|
if (subscriber !== null && root.memoizedInteractions.size > 0) {
|
|
8446
8446
|
var threadID = computeThreadID(committedExpirationTime, root.interactionThreadID);
|
|
8447
8447
|
subscriber.onWorkStopped(root.memoizedInteractions, threadID);
|
|
@@ -8798,11 +8798,11 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
8798
8798
|
var expirationTime = root.nextExpirationTimeToWorkOn;
|
|
8799
8799
|
|
|
8800
8800
|
var prevInteractions = null;
|
|
8801
|
-
if (
|
|
8802
|
-
// We're about to start new
|
|
8801
|
+
if (enableSchedulerTracing) {
|
|
8802
|
+
// We're about to start new traced work.
|
|
8803
8803
|
// Restore pending interactions so cascading work triggered during the render phase will be accounted for.
|
|
8804
|
-
prevInteractions =
|
|
8805
|
-
|
|
8804
|
+
prevInteractions = tracing.__interactionsRef.current;
|
|
8805
|
+
tracing.__interactionsRef.current = root.memoizedInteractions;
|
|
8806
8806
|
}
|
|
8807
8807
|
|
|
8808
8808
|
// Check if we're starting from a fresh stack, or if we're resuming from
|
|
@@ -8815,7 +8815,7 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
8815
8815
|
nextUnitOfWork = createWorkInProgress(nextRoot.current, null, nextRenderExpirationTime);
|
|
8816
8816
|
root.pendingCommitExpirationTime = NoWork;
|
|
8817
8817
|
|
|
8818
|
-
if (
|
|
8818
|
+
if (enableSchedulerTracing) {
|
|
8819
8819
|
// Determine which interactions this batch of work currently includes,
|
|
8820
8820
|
// So that we can accurately attribute time spent working on it,
|
|
8821
8821
|
var interactions = new Set();
|
|
@@ -8834,13 +8834,13 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
8834
8834
|
root.memoizedInteractions = interactions;
|
|
8835
8835
|
|
|
8836
8836
|
if (interactions.size > 0) {
|
|
8837
|
-
var subscriber =
|
|
8837
|
+
var subscriber = tracing.__subscriberRef.current;
|
|
8838
8838
|
if (subscriber !== null) {
|
|
8839
8839
|
var threadID = computeThreadID(expirationTime, root.interactionThreadID);
|
|
8840
8840
|
try {
|
|
8841
8841
|
subscriber.onWorkStarted(interactions, threadID);
|
|
8842
8842
|
} catch (error) {
|
|
8843
|
-
// Work thrown by an interaction
|
|
8843
|
+
// Work thrown by an interaction tracing subscriber should be rethrown,
|
|
8844
8844
|
// But only once it's safe (to avoid leaveing the scheduler in an invalid state).
|
|
8845
8845
|
// Store the error for now and we'll re-throw in finishRendering().
|
|
8846
8846
|
if (!hasUnhandledError) {
|
|
@@ -8903,9 +8903,9 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
8903
8903
|
break;
|
|
8904
8904
|
} while (true);
|
|
8905
8905
|
|
|
8906
|
-
if (
|
|
8907
|
-
//
|
|
8908
|
-
|
|
8906
|
+
if (enableSchedulerTracing) {
|
|
8907
|
+
// Traced work is done for now; restore the previous interactions.
|
|
8908
|
+
tracing.__interactionsRef.current = prevInteractions;
|
|
8909
8909
|
}
|
|
8910
8910
|
|
|
8911
8911
|
// We're done performing work. Time to clean up.
|
|
@@ -9134,15 +9134,15 @@ function retrySuspendedRoot(root, fiber, suspendedTime) {
|
|
|
9134
9134
|
scheduleWorkToRoot(fiber, retryTime);
|
|
9135
9135
|
var rootExpirationTime = root.expirationTime;
|
|
9136
9136
|
if (rootExpirationTime !== NoWork) {
|
|
9137
|
-
if (
|
|
9137
|
+
if (enableSchedulerTracing) {
|
|
9138
9138
|
// Restore previous interactions so that new work is associated with them.
|
|
9139
|
-
var prevInteractions =
|
|
9140
|
-
|
|
9139
|
+
var prevInteractions = tracing.__interactionsRef.current;
|
|
9140
|
+
tracing.__interactionsRef.current = root.memoizedInteractions;
|
|
9141
9141
|
// Because suspense timeouts do not decrement the interaction count,
|
|
9142
9142
|
// Continued suspense work should also not increment the count.
|
|
9143
9143
|
storeInteractionsForExpirationTime(root, rootExpirationTime, false);
|
|
9144
9144
|
requestWork(root, rootExpirationTime);
|
|
9145
|
-
|
|
9145
|
+
tracing.__interactionsRef.current = prevInteractions;
|
|
9146
9146
|
} else {
|
|
9147
9147
|
requestWork(root, rootExpirationTime);
|
|
9148
9148
|
}
|
|
@@ -9183,11 +9183,11 @@ function scheduleWorkToRoot(fiber, expirationTime) {
|
|
|
9183
9183
|
}
|
|
9184
9184
|
|
|
9185
9185
|
function storeInteractionsForExpirationTime(root, expirationTime, updateInteractionCounts) {
|
|
9186
|
-
if (!
|
|
9186
|
+
if (!enableSchedulerTracing) {
|
|
9187
9187
|
return;
|
|
9188
9188
|
}
|
|
9189
9189
|
|
|
9190
|
-
var interactions =
|
|
9190
|
+
var interactions = tracing.__interactionsRef.current;
|
|
9191
9191
|
if (interactions.size > 0) {
|
|
9192
9192
|
var pendingInteractions = root.pendingInteractionMap.get(expirationTime);
|
|
9193
9193
|
if (pendingInteractions != null) {
|
|
@@ -9210,7 +9210,7 @@ function storeInteractionsForExpirationTime(root, expirationTime, updateInteract
|
|
|
9210
9210
|
}
|
|
9211
9211
|
}
|
|
9212
9212
|
|
|
9213
|
-
var subscriber =
|
|
9213
|
+
var subscriber = tracing.__subscriberRef.current;
|
|
9214
9214
|
if (subscriber !== null) {
|
|
9215
9215
|
var threadID = computeThreadID(expirationTime, root.interactionThreadID);
|
|
9216
9216
|
subscriber.onWorkScheduled(interactions, threadID);
|
|
@@ -9236,7 +9236,7 @@ function scheduleWork(fiber, expirationTime) {
|
|
|
9236
9236
|
return;
|
|
9237
9237
|
}
|
|
9238
9238
|
|
|
9239
|
-
if (
|
|
9239
|
+
if (enableSchedulerTracing) {
|
|
9240
9240
|
storeInteractionsForExpirationTime(root, expirationTime, true);
|
|
9241
9241
|
}
|
|
9242
9242
|
|
|
@@ -9376,7 +9376,7 @@ function onTimeout(root, finishedWork, suspendedExpirationTime) {
|
|
|
9376
9376
|
recomputeCurrentRendererTime();
|
|
9377
9377
|
currentSchedulerTime = currentRendererTime;
|
|
9378
9378
|
|
|
9379
|
-
if (
|
|
9379
|
+
if (enableSchedulerTracing) {
|
|
9380
9380
|
// Don't update pending interaction counts for suspense timeouts,
|
|
9381
9381
|
// Because we know we still need to do more work in this case.
|
|
9382
9382
|
suspenseDidTimeout = true;
|
|
@@ -10063,7 +10063,7 @@ function batchedUpdates$1(fn, bookkeeping) {
|
|
|
10063
10063
|
|
|
10064
10064
|
// TODO: this is special because it gets imported during build.
|
|
10065
10065
|
|
|
10066
|
-
var ReactVersion = '16.5.
|
|
10066
|
+
var ReactVersion = '16.5.2';
|
|
10067
10067
|
|
|
10068
10068
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10069
10069
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.5.
|
|
1
|
+
/** @license React v16.5.2
|
|
2
2
|
* react-test-renderer.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -128,4 +128,4 @@ var Ed={create:function(a,b){var c=sd.createNodeMock,d=!1;"object"===typeof b&&n
|
|
|
128
128
|
null:wd(f.current)},update:function(a){null!=f&&null!=f.current&&md(a,f,null,null)},unmount:function(){null!=f&&null!=f.current&&(md(null,f,null,null),f=e=null)},getInstance:function(){if(null==f||null==f.current)return null;a:{var a=f.current;if(a.child)switch(a.child.tag){case 7:a=Ba(a.child.stateNode);break a;default:a=a.child.stateNode}else a=null}return a},unstable_flushAll:va,unstable_flushSync:function(a){xa();a:{Pc?p("187"):void 0;var b=Qc;Qc=!0;try{b:{var c=Gc;Gc=1;try{var d=a(void 0,void 0,
|
|
129
129
|
void 0,void 0);break b}finally{Gc=c}d=void 0}break a}finally{Qc=b,Tc(1,null)}d=void 0}return d},unstable_flushNumberOfYields:wa,unstable_clearYields:xa};Object.defineProperty(a,"root",{configurable:!0,enumerable:!0,get:function(){if(null===f)throw Error("Can't access .root on unmounted test renderer");var a=zd(f.current);if(0===a.length)throw Error("Can't access .root on unmounted test renderer");return 1===a.length?a[0]:Ad(f.current)}});return a},unstable_yield:function(a){A.push(a)},unstable_clearYields:xa,
|
|
130
130
|
unstable_batchedUpdates:function(a,b){if(qd)return a(b);qd=!0;try{return a(b)}finally{if(qd=!1,(null!==nd||null!==od)&&nd&&(b=nd,a=od,od=nd=null,pd(b),a))for(b=0;b<a.length;b++)pd(a[b])}},unstable_setNowImplementation:function(a){ua=a}},Fd=new WeakMap;function Ad(a){var b=Fd.get(a);void 0===b&&null!==a.alternate&&(b=Fd.get(a.alternate));void 0===b&&(b=new Dd(a),Fd.set(a,b));return b}
|
|
131
|
-
(function(a){var b=a.findFiberByHostInstance;return Sa(n({},a,{findHostInstanceByFiber:function(a){a=ta(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.5.
|
|
131
|
+
(function(a){var b=a.findFiberByHostInstance;return Sa(n({},a,{findHostInstanceByFiber:function(a){a=ta(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.5.2",rendererPackageName:"react-test-renderer"});var Gd={default:Ed},Hd=Gd&&Ed||Gd;module.exports=Hd.default||Hd;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-test-renderer",
|
|
3
|
-
"version": "16.5.
|
|
3
|
+
"version": "16.5.2",
|
|
4
4
|
"description": "React package for snapshot testing.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": "facebook/react",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"object-assign": "^4.1.1",
|
|
19
19
|
"prop-types": "^15.6.2",
|
|
20
|
-
"react-is": "^16.5.
|
|
21
|
-
"schedule": "^0.
|
|
20
|
+
"react-is": "^16.5.2",
|
|
21
|
+
"schedule": "^0.5.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^16.0.0"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.5.
|
|
1
|
+
/** @license React v16.5.2
|
|
2
2
|
* react-test-renderer.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -1033,7 +1033,7 @@ var warnAboutDeprecatedLifecycles = false;
|
|
|
1033
1033
|
var warnAboutLegacyContextAPI = false;
|
|
1034
1034
|
var replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
|
|
1035
1035
|
var enableProfilerTimer = false;
|
|
1036
|
-
var
|
|
1036
|
+
var enableSchedulerTracing = false;
|
|
1037
1037
|
|
|
1038
1038
|
|
|
1039
1039
|
|
|
@@ -2252,14 +2252,14 @@ function assignFiberPropertiesInDEV(target, source) {
|
|
|
2252
2252
|
|
|
2253
2253
|
var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2254
2254
|
|
|
2255
|
-
var _ReactInternals$Sched = ReactInternals$1.
|
|
2255
|
+
var _ReactInternals$Sched = ReactInternals$1.ScheduleTracing;
|
|
2256
2256
|
var __interactionsRef = _ReactInternals$Sched.__interactionsRef;
|
|
2257
2257
|
var __subscriberRef = _ReactInternals$Sched.__subscriberRef;
|
|
2258
2258
|
var unstable_clear = _ReactInternals$Sched.unstable_clear;
|
|
2259
2259
|
var unstable_getCurrent = _ReactInternals$Sched.unstable_getCurrent;
|
|
2260
2260
|
var unstable_getThreadID = _ReactInternals$Sched.unstable_getThreadID;
|
|
2261
2261
|
var unstable_subscribe = _ReactInternals$Sched.unstable_subscribe;
|
|
2262
|
-
var
|
|
2262
|
+
var unstable_trace = _ReactInternals$Sched.unstable_trace;
|
|
2263
2263
|
var unstable_unsubscribe = _ReactInternals$Sched.unstable_unsubscribe;
|
|
2264
2264
|
var unstable_wrap = _ReactInternals$Sched.unstable_wrap;
|
|
2265
2265
|
|
|
@@ -2267,17 +2267,17 @@ var unstable_wrap = _ReactInternals$Sched.unstable_wrap;
|
|
|
2267
2267
|
// TODO: This should be lifted into the renderer.
|
|
2268
2268
|
|
|
2269
2269
|
|
|
2270
|
-
// The following attributes are only used by interaction
|
|
2270
|
+
// The following attributes are only used by interaction tracing builds.
|
|
2271
2271
|
// They enable interactions to be associated with their async work,
|
|
2272
2272
|
// And expose interaction metadata to the React DevTools Profiler plugin.
|
|
2273
|
-
// Note that these attributes are only defined when the
|
|
2273
|
+
// Note that these attributes are only defined when the enableSchedulerTracing flag is enabled.
|
|
2274
2274
|
|
|
2275
2275
|
|
|
2276
2276
|
// Exported FiberRoot type includes all properties,
|
|
2277
2277
|
// To avoid requiring potentially error-prone :any casts throughout the project.
|
|
2278
|
-
// Profiling properties are only safe to access in profiling builds (when
|
|
2278
|
+
// Profiling properties are only safe to access in profiling builds (when enableSchedulerTracing is true).
|
|
2279
2279
|
// The types are defined separately within this file to ensure they stay in sync.
|
|
2280
|
-
// (We don't have to use an inline :any cast when
|
|
2280
|
+
// (We don't have to use an inline :any cast when enableSchedulerTracing is disabled.)
|
|
2281
2281
|
|
|
2282
2282
|
/* eslint-enable no-use-before-define */
|
|
2283
2283
|
|
|
@@ -2287,7 +2287,7 @@ function createFiberRoot(containerInfo, isAsync, hydrate) {
|
|
|
2287
2287
|
var uninitializedFiber = createHostRootFiber(isAsync);
|
|
2288
2288
|
|
|
2289
2289
|
var root = void 0;
|
|
2290
|
-
if (
|
|
2290
|
+
if (enableSchedulerTracing) {
|
|
2291
2291
|
root = {
|
|
2292
2292
|
current: uninitializedFiber,
|
|
2293
2293
|
containerInfo: containerInfo,
|
|
@@ -2346,8 +2346,8 @@ function createFiberRoot(containerInfo, isAsync, hydrate) {
|
|
|
2346
2346
|
uninitializedFiber.stateNode = root;
|
|
2347
2347
|
|
|
2348
2348
|
// The reason for the way the Flow types are structured in this file,
|
|
2349
|
-
// Is to avoid needing :any casts everywhere interaction
|
|
2350
|
-
// Unfortunately that requires an :any cast for non-interaction
|
|
2349
|
+
// Is to avoid needing :any casts everywhere interaction tracing fields are used.
|
|
2350
|
+
// Unfortunately that requires an :any cast for non-interaction tracing capable builds.
|
|
2351
2351
|
// $FlowFixMe Remove this :any cast and replace it with something better.
|
|
2352
2352
|
return root;
|
|
2353
2353
|
}
|
|
@@ -7204,7 +7204,7 @@ function commitLifeCycles(finishedRoot, current$$1, finishedWork, committedExpir
|
|
|
7204
7204
|
if (enableProfilerTimer) {
|
|
7205
7205
|
var onRender = finishedWork.memoizedProps.onRender;
|
|
7206
7206
|
|
|
7207
|
-
if (
|
|
7207
|
+
if (enableSchedulerTracing) {
|
|
7208
7208
|
onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime(), finishedRoot.memoizedInteractions);
|
|
7209
7209
|
} else {
|
|
7210
7210
|
onRender(finishedWork.memoizedProps.id, current$$1 === null ? 'mount' : 'update', finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, getCommitTime());
|
|
@@ -8058,10 +8058,10 @@ var didWarnSetStateChildContext = void 0;
|
|
|
8058
8058
|
var warnAboutUpdateOnUnmounted = void 0;
|
|
8059
8059
|
var warnAboutInvalidUpdates = void 0;
|
|
8060
8060
|
|
|
8061
|
-
if (
|
|
8061
|
+
if (enableSchedulerTracing) {
|
|
8062
8062
|
// Provide explicit error message when production+profiling bundle of e.g. react-dom
|
|
8063
|
-
// is used with production (non-profiling) bundle of schedule/
|
|
8064
|
-
!(__interactionsRef != null && __interactionsRef.current != null) ? invariant(false, 'It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `schedule/
|
|
8063
|
+
// is used with production (non-profiling) bundle of schedule/tracing
|
|
8064
|
+
!(__interactionsRef != null && __interactionsRef.current != null) ? invariant(false, 'It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `schedule/tracing` module with `schedule/tracing-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling') : void 0;
|
|
8065
8065
|
}
|
|
8066
8066
|
|
|
8067
8067
|
{
|
|
@@ -8399,8 +8399,8 @@ function commitRoot(root, finishedWork) {
|
|
|
8399
8399
|
markCommittedPriorityLevels(root, earliestRemainingTimeBeforeCommit);
|
|
8400
8400
|
|
|
8401
8401
|
var prevInteractions = null;
|
|
8402
|
-
var committedInteractions =
|
|
8403
|
-
if (
|
|
8402
|
+
var committedInteractions = enableSchedulerTracing ? [] : null;
|
|
8403
|
+
if (enableSchedulerTracing) {
|
|
8404
8404
|
// Restore any pending interactions at this point,
|
|
8405
8405
|
// So that cascading work triggered during the render phase will be accounted for.
|
|
8406
8406
|
prevInteractions = __interactionsRef.current;
|
|
@@ -8552,7 +8552,7 @@ function commitRoot(root, finishedWork) {
|
|
|
8552
8552
|
}
|
|
8553
8553
|
onCommit(root, earliestRemainingTimeAfterCommit);
|
|
8554
8554
|
|
|
8555
|
-
if (
|
|
8555
|
+
if (enableSchedulerTracing) {
|
|
8556
8556
|
__interactionsRef.current = prevInteractions;
|
|
8557
8557
|
|
|
8558
8558
|
var subscriber = void 0;
|
|
@@ -8915,8 +8915,8 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
8915
8915
|
var expirationTime = root.nextExpirationTimeToWorkOn;
|
|
8916
8916
|
|
|
8917
8917
|
var prevInteractions = null;
|
|
8918
|
-
if (
|
|
8919
|
-
// We're about to start new
|
|
8918
|
+
if (enableSchedulerTracing) {
|
|
8919
|
+
// We're about to start new traced work.
|
|
8920
8920
|
// Restore pending interactions so cascading work triggered during the render phase will be accounted for.
|
|
8921
8921
|
prevInteractions = __interactionsRef.current;
|
|
8922
8922
|
__interactionsRef.current = root.memoizedInteractions;
|
|
@@ -8932,7 +8932,7 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
8932
8932
|
nextUnitOfWork = createWorkInProgress(nextRoot.current, null, nextRenderExpirationTime);
|
|
8933
8933
|
root.pendingCommitExpirationTime = NoWork;
|
|
8934
8934
|
|
|
8935
|
-
if (
|
|
8935
|
+
if (enableSchedulerTracing) {
|
|
8936
8936
|
// Determine which interactions this batch of work currently includes,
|
|
8937
8937
|
// So that we can accurately attribute time spent working on it,
|
|
8938
8938
|
var interactions = new Set();
|
|
@@ -8957,7 +8957,7 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
8957
8957
|
try {
|
|
8958
8958
|
subscriber.onWorkStarted(interactions, threadID);
|
|
8959
8959
|
} catch (error) {
|
|
8960
|
-
// Work thrown by an interaction
|
|
8960
|
+
// Work thrown by an interaction tracing subscriber should be rethrown,
|
|
8961
8961
|
// But only once it's safe (to avoid leaveing the scheduler in an invalid state).
|
|
8962
8962
|
// Store the error for now and we'll re-throw in finishRendering().
|
|
8963
8963
|
if (!hasUnhandledError) {
|
|
@@ -9020,8 +9020,8 @@ function renderRoot(root, isYieldy, isExpired) {
|
|
|
9020
9020
|
break;
|
|
9021
9021
|
} while (true);
|
|
9022
9022
|
|
|
9023
|
-
if (
|
|
9024
|
-
//
|
|
9023
|
+
if (enableSchedulerTracing) {
|
|
9024
|
+
// Traced work is done for now; restore the previous interactions.
|
|
9025
9025
|
__interactionsRef.current = prevInteractions;
|
|
9026
9026
|
}
|
|
9027
9027
|
|
|
@@ -9251,7 +9251,7 @@ function retrySuspendedRoot(root, fiber, suspendedTime) {
|
|
|
9251
9251
|
scheduleWorkToRoot(fiber, retryTime);
|
|
9252
9252
|
var rootExpirationTime = root.expirationTime;
|
|
9253
9253
|
if (rootExpirationTime !== NoWork) {
|
|
9254
|
-
if (
|
|
9254
|
+
if (enableSchedulerTracing) {
|
|
9255
9255
|
// Restore previous interactions so that new work is associated with them.
|
|
9256
9256
|
var prevInteractions = __interactionsRef.current;
|
|
9257
9257
|
__interactionsRef.current = root.memoizedInteractions;
|
|
@@ -9300,7 +9300,7 @@ function scheduleWorkToRoot(fiber, expirationTime) {
|
|
|
9300
9300
|
}
|
|
9301
9301
|
|
|
9302
9302
|
function storeInteractionsForExpirationTime(root, expirationTime, updateInteractionCounts) {
|
|
9303
|
-
if (!
|
|
9303
|
+
if (!enableSchedulerTracing) {
|
|
9304
9304
|
return;
|
|
9305
9305
|
}
|
|
9306
9306
|
|
|
@@ -9353,7 +9353,7 @@ function scheduleWork(fiber, expirationTime) {
|
|
|
9353
9353
|
return;
|
|
9354
9354
|
}
|
|
9355
9355
|
|
|
9356
|
-
if (
|
|
9356
|
+
if (enableSchedulerTracing) {
|
|
9357
9357
|
storeInteractionsForExpirationTime(root, expirationTime, true);
|
|
9358
9358
|
}
|
|
9359
9359
|
|
|
@@ -9493,7 +9493,7 @@ function onTimeout(root, finishedWork, suspendedExpirationTime) {
|
|
|
9493
9493
|
recomputeCurrentRendererTime();
|
|
9494
9494
|
currentSchedulerTime = currentRendererTime;
|
|
9495
9495
|
|
|
9496
|
-
if (
|
|
9496
|
+
if (enableSchedulerTracing) {
|
|
9497
9497
|
// Don't update pending interaction counts for suspense timeouts,
|
|
9498
9498
|
// Because we know we still need to do more work in this case.
|
|
9499
9499
|
suspenseDidTimeout = true;
|
|
@@ -10180,7 +10180,7 @@ function batchedUpdates$1(fn, bookkeeping) {
|
|
|
10180
10180
|
|
|
10181
10181
|
// TODO: this is special because it gets imported during build.
|
|
10182
10182
|
|
|
10183
|
-
var ReactVersion = '16.5.
|
|
10183
|
+
var ReactVersion = '16.5.2';
|
|
10184
10184
|
|
|
10185
10185
|
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
10186
10186
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.5.
|
|
1
|
+
/** @license React v16.5.2
|
|
2
2
|
* react-test-renderer.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -107,4 +107,4 @@ a.tag&&2>Nb(a).length)break;return Pb(a)}a=a.return}return null}},{key:"children
|
|
|
107
107
|
null:1===e.children.length?Mb(e.children[0]):e.children.map(Mb)},toTree:function(){return null==f||null==f.current?null:gb(f.current)},update:function(a){null!=f&&null!=f.current&&Lb(a,f,null,null)},unmount:function(){null!=f&&null!=f.current&&(Lb(null,f,null,null),f=e=null)},getInstance:function(){if(null==f||null==f.current)return null;a:{var a=f.current;if(a.child)switch(a.child.tag){case 7:a=Ea(a.child.stateNode);break a;default:a=a.child.stateNode}else a=null}return a},unstable_flushAll:fd,unstable_flushSync:function(a){kb();
|
|
108
108
|
a:{ka?m("187"):void 0;var b=Ya;Ya=!0;try{b:{var c=za;za=1;try{var d=a(void 0,void 0,void 0,void 0);break b}finally{za=c}d=void 0}break a}finally{Ya=b,Ib(1,null)}d=void 0}return d},unstable_flushNumberOfYields:gd,unstable_clearYields:kb};Object.defineProperty(a,"root",{configurable:!0,enumerable:!0,get:function(){if(null===f)throw Error("Can't access .root on unmounted test renderer");var a=Nb(f.current);if(0===a.length)throw Error("Can't access .root on unmounted test renderer");return 1===a.length?
|
|
109
109
|
a[0]:Pb(f.current)}});return a},unstable_yield:function(a){O.push(a)},unstable_clearYields:kb,unstable_batchedUpdates:function(a,b){if(Tb)return a(b);Tb=!0;try{return a(b)}finally{if(Tb=!1,(null!==ib||null!==Sb)&&ib&&(b=ib,a=Sb,Sb=ib=null,Yc(b),a))for(b=0;b<a.length;b++)Yc(a[b])}},unstable_setNowImplementation:function(a){$a=a}},Rb=new WeakMap;(function(a){var b=a.findFiberByHostInstance;return id(E({},a,{findHostInstanceByFiber:function(a){a=ed(a);return null===a?null:a.stateNode},findFiberByHostInstance:function(a){return b?
|
|
110
|
-
b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.5.
|
|
110
|
+
b(a):null}}))})({findFiberByHostInstance:function(){throw Error("TestRenderer does not support findFiberByHostInstance()");},bundleType:0,version:"16.5.2",rendererPackageName:"react-test-renderer"});var cd={default:bd},dd=cd&&bd||cd;return dd.default||dd});
|