Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions Libraries/Renderer/oss/ReactFabric-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var deepFreezeAndThrowOnMutationInDev = require("deepFreezeAndThrowOnMutationInD
var TextInputState = require("TextInputState");
var FabricUIManager = require("FabricUIManager");
var checkPropTypes = require("prop-types/checkPropTypes");
var tracking = require("schedule/tracking");
var tracing = require("schedule/tracing");
var ExceptionsManager = require("ExceptionsManager");

/**
Expand Down Expand Up @@ -5502,7 +5502,7 @@ function createFiberRoot(containerInfo, isAsync, hydrate) {
firstBatch: null,
nextScheduledRoot: null,

interactionThreadID: tracking.unstable_getThreadID(),
interactionThreadID: tracing.unstable_getThreadID(),
memoizedInteractions: new Set(),
pendingInteractionMap: new Map()
};
Expand Down Expand Up @@ -12885,12 +12885,12 @@ var warnAboutInvalidUpdates = void 0;

if (enableSchedulerTracking) {
// Provide explicit error message when production+profiling bundle of e.g. react-dom
// is used with production (non-profiling) bundle of schedule/tracking
// is used with production (non-profiling) bundle of schedule/tracing
invariant(
tracking.__interactionsRef != null &&
tracking.__interactionsRef.current != null,
tracing.__interactionsRef != null &&
tracing.__interactionsRef.current != null,
"It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) " +
"without also replacing the `schedule/tracking` module with `schedule/tracking-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"
);
Expand Down Expand Up @@ -13276,8 +13276,8 @@ function commitRoot(root, finishedWork) {
if (enableSchedulerTracking) {
// Restore any pending interactions at this point,
// So that cascading work triggered during the render phase will be accounted for.
prevInteractions = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;

// We are potentially finished with the current batch of interactions.
// So we should clear them out of the pending interaction map.
Expand Down Expand Up @@ -13455,12 +13455,12 @@ function commitRoot(root, finishedWork) {
onCommit(root, earliestRemainingTimeAfterCommit);

if (enableSchedulerTracking) {
tracking.__interactionsRef.current = prevInteractions;
tracing.__interactionsRef.current = prevInteractions;

var subscriber = void 0;

try {
subscriber = tracking.__subscriberRef.current;
subscriber = tracing.__subscriberRef.current;
if (subscriber !== null && root.memoizedInteractions.size > 0) {
var threadID = computeThreadID(
committedExpirationTime,
Expand Down Expand Up @@ -13858,8 +13858,8 @@ function renderRoot(root, isYieldy, isExpired) {
if (enableSchedulerTracking) {
// We're about to start new tracked work.
// Restore pending interactions so cascading work triggered during the render phase will be accounted for.
prevInteractions = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;
}

// Check if we're starting from a fresh stack, or if we're resuming from
Expand Down Expand Up @@ -13902,7 +13902,7 @@ function renderRoot(root, isYieldy, isExpired) {
root.memoizedInteractions = interactions;

if (interactions.size > 0) {
var subscriber = tracking.__subscriberRef.current;
var subscriber = tracing.__subscriberRef.current;
if (subscriber !== null) {
var threadID = computeThreadID(
expirationTime,
Expand Down Expand Up @@ -13987,7 +13987,7 @@ function renderRoot(root, isYieldy, isExpired) {

if (enableSchedulerTracking) {
// Tracked work is done for now; restore the previous interactions.
tracking.__interactionsRef.current = prevInteractions;
tracing.__interactionsRef.current = prevInteractions;
}

// We're done performing work. Time to clean up.
Expand Down Expand Up @@ -14267,13 +14267,13 @@ function retrySuspendedRoot(root, fiber, suspendedTime) {
if (rootExpirationTime !== NoWork) {
if (enableSchedulerTracking) {
// Restore previous interactions so that new work is associated with them.
var prevInteractions = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
var prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;
// Because suspense timeouts do not decrement the interaction count,
// Continued suspense work should also not increment the count.
storeInteractionsForExpirationTime(root, rootExpirationTime, false);
requestWork(root, rootExpirationTime);
tracking.__interactionsRef.current = prevInteractions;
tracing.__interactionsRef.current = prevInteractions;
} else {
requestWork(root, rootExpirationTime);
}
Expand Down Expand Up @@ -14340,7 +14340,7 @@ function storeInteractionsForExpirationTime(
return;
}

var interactions = tracking.__interactionsRef.current;
var interactions = tracing.__interactionsRef.current;
if (interactions.size > 0) {
var pendingInteractions = root.pendingInteractionMap.get(expirationTime);
if (pendingInteractions != null) {
Expand All @@ -14363,7 +14363,7 @@ function storeInteractionsForExpirationTime(
}
}

var subscriber = tracking.__subscriberRef.current;
var subscriber = tracing.__subscriberRef.current;
if (subscriber !== null) {
var threadID = computeThreadID(expirationTime, root.interactionThreadID);
subscriber.onWorkScheduled(interactions, threadID);
Expand Down
30 changes: 15 additions & 15 deletions Libraries/Renderer/oss/ReactFabric-profiling.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var ReactNativeViewConfigRegistry = require("ReactNativeViewConfigRegistry"),
flattenStyle = require("flattenStyle"),
TextInputState = require("TextInputState"),
FabricUIManager = require("FabricUIManager"),
tracking = require("schedule/tracking"),
tracing = require("schedule/tracing"),
ExceptionsManager = require("ExceptionsManager");
function invariant(condition, format, a, b, c, d, e, f) {
if (!condition) {
Expand Down Expand Up @@ -4509,9 +4509,9 @@ function unwindWork(workInProgress) {
var Dispatcher = { readContext: readContext },
ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner;
invariant(
null != tracking.__interactionsRef &&
null != tracking.__interactionsRef.current,
"It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) without also replacing the `schedule/tracking` module with `schedule/tracking-profiling`. Your bundler might have a setting for aliasing both modules. Learn more at http://fb.me/react-profiling"
null != tracing.__interactionsRef &&
null != tracing.__interactionsRef.current,
"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"
);
var isWorking = !1,
nextUnitOfWork = null,
Expand Down Expand Up @@ -4810,8 +4810,8 @@ function commitRoot(root, finishedWork) {
);
updateExpirationTimeBeforeCommit = null;
var committedInteractions = [];
updateExpirationTimeBeforeCommit = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
updateExpirationTimeBeforeCommit = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;
root.pendingInteractionMap.forEach(function(
scheduledInteractions,
scheduledExpirationTime
Expand Down Expand Up @@ -4893,11 +4893,11 @@ function commitRoot(root, finishedWork) {
: childExpirationTimeBeforeCommit;
0 === finishedWork && (legacyErrorBoundariesThatAlreadyFailed = null);
onCommit(root, finishedWork);
tracking.__interactionsRef.current = updateExpirationTimeBeforeCommit;
tracing.__interactionsRef.current = updateExpirationTimeBeforeCommit;
var subscriber = void 0;
try {
if (
((subscriber = tracking.__subscriberRef.current),
((subscriber = tracing.__subscriberRef.current),
null !== subscriber && 0 < root.memoizedInteractions.size)
)
subscriber.onWorkStopped(
Expand Down Expand Up @@ -5182,8 +5182,8 @@ function renderRoot(root, isYieldy, isExpired) {
ReactCurrentOwner$2.currentDispatcher = Dispatcher;
var expirationTime = root.nextExpirationTimeToWorkOn,
prevInteractions = null;
prevInteractions = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;
if (
expirationTime !== nextRenderExpirationTime ||
root !== nextRoot ||
Expand All @@ -5210,7 +5210,7 @@ function renderRoot(root, isYieldy, isExpired) {
});
root.memoizedInteractions = interactions;
if (0 < interactions.size) {
var subscriber = tracking.__subscriberRef.current;
var subscriber = tracing.__subscriberRef.current;
if (null !== subscriber) {
var threadID = 1e3 * expirationTime + root.interactionThreadID;
try {
Expand Down Expand Up @@ -5258,7 +5258,7 @@ function renderRoot(root, isYieldy, isExpired) {
}
break;
} while (1);
tracking.__interactionsRef.current = prevInteractions;
tracing.__interactionsRef.current = prevInteractions;
isWorking = !1;
lastContextWithAllBitsObserved = lastContextDependency = currentlyRenderingFiber = ReactCurrentOwner$2.currentDispatcher = null;
if (subscriber) (nextRoot = null), (root.finishedWork = null);
Expand Down Expand Up @@ -5363,7 +5363,7 @@ function storeInteractionsForExpirationTime(
expirationTime,
updateInteractionCounts
) {
var interactions = tracking.__interactionsRef.current;
var interactions = tracing.__interactionsRef.current;
if (0 < interactions.size) {
var pendingInteractions = root.pendingInteractionMap.get(expirationTime);
null != pendingInteractions
Expand All @@ -5378,7 +5378,7 @@ function storeInteractionsForExpirationTime(
interactions.forEach(function(interaction) {
interaction.__count++;
}));
var subscriber = tracking.__subscriberRef.current;
var subscriber = tracing.__subscriberRef.current;
if (null !== subscriber)
subscriber.onWorkScheduled(
interactions,
Expand Down Expand Up @@ -5961,7 +5961,7 @@ var roots = new Map(),
expirationTime: 0,
firstBatch: null,
nextScheduledRoot: null,
interactionThreadID: tracking.unstable_getThreadID(),
interactionThreadID: tracing.unstable_getThreadID(),
memoizedInteractions: new Set(),
pendingInteractionMap: new Map()
};
Expand Down
38 changes: 19 additions & 19 deletions Libraries/Renderer/oss/ReactNativeRenderer-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var deepDiffer = require("deepDiffer");
var flattenStyle = require("flattenStyle");
var TextInputState = require("TextInputState");
var checkPropTypes = require("prop-types/checkPropTypes");
var tracking = require("schedule/tracking");
var tracing = require("schedule/tracing");
var ExceptionsManager = require("ExceptionsManager");

/**
Expand Down Expand Up @@ -5796,7 +5796,7 @@ function createFiberRoot(containerInfo, isAsync, hydrate) {
firstBatch: null,
nextScheduledRoot: null,

interactionThreadID: tracking.unstable_getThreadID(),
interactionThreadID: tracing.unstable_getThreadID(),
memoizedInteractions: new Set(),
pendingInteractionMap: new Map()
};
Expand Down Expand Up @@ -13178,12 +13178,12 @@ var warnAboutInvalidUpdates = void 0;

if (enableSchedulerTracking) {
// Provide explicit error message when production+profiling bundle of e.g. react-dom
// is used with production (non-profiling) bundle of schedule/tracking
// is used with production (non-profiling) bundle of schedule/tracing
invariant(
tracking.__interactionsRef != null &&
tracking.__interactionsRef.current != null,
tracing.__interactionsRef != null &&
tracing.__interactionsRef.current != null,
"It is not supported to run the profiling version of a renderer (for example, `react-dom/profiling`) " +
"without also replacing the `schedule/tracking` module with `schedule/tracking-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"
);
Expand Down Expand Up @@ -13569,8 +13569,8 @@ function commitRoot(root, finishedWork) {
if (enableSchedulerTracking) {
// Restore any pending interactions at this point,
// So that cascading work triggered during the render phase will be accounted for.
prevInteractions = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;

// We are potentially finished with the current batch of interactions.
// So we should clear them out of the pending interaction map.
Expand Down Expand Up @@ -13748,12 +13748,12 @@ function commitRoot(root, finishedWork) {
onCommit(root, earliestRemainingTimeAfterCommit);

if (enableSchedulerTracking) {
tracking.__interactionsRef.current = prevInteractions;
tracing.__interactionsRef.current = prevInteractions;

var subscriber = void 0;

try {
subscriber = tracking.__subscriberRef.current;
subscriber = tracing.__subscriberRef.current;
if (subscriber !== null && root.memoizedInteractions.size > 0) {
var threadID = computeThreadID(
committedExpirationTime,
Expand Down Expand Up @@ -14151,8 +14151,8 @@ function renderRoot(root, isYieldy, isExpired) {
if (enableSchedulerTracking) {
// We're about to start new tracked work.
// Restore pending interactions so cascading work triggered during the render phase will be accounted for.
prevInteractions = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;
}

// Check if we're starting from a fresh stack, or if we're resuming from
Expand Down Expand Up @@ -14195,7 +14195,7 @@ function renderRoot(root, isYieldy, isExpired) {
root.memoizedInteractions = interactions;

if (interactions.size > 0) {
var subscriber = tracking.__subscriberRef.current;
var subscriber = tracing.__subscriberRef.current;
if (subscriber !== null) {
var threadID = computeThreadID(
expirationTime,
Expand Down Expand Up @@ -14280,7 +14280,7 @@ function renderRoot(root, isYieldy, isExpired) {

if (enableSchedulerTracking) {
// Tracked work is done for now; restore the previous interactions.
tracking.__interactionsRef.current = prevInteractions;
tracing.__interactionsRef.current = prevInteractions;
}

// We're done performing work. Time to clean up.
Expand Down Expand Up @@ -14560,13 +14560,13 @@ function retrySuspendedRoot(root, fiber, suspendedTime) {
if (rootExpirationTime !== NoWork) {
if (enableSchedulerTracking) {
// Restore previous interactions so that new work is associated with them.
var prevInteractions = tracking.__interactionsRef.current;
tracking.__interactionsRef.current = root.memoizedInteractions;
var prevInteractions = tracing.__interactionsRef.current;
tracing.__interactionsRef.current = root.memoizedInteractions;
// Because suspense timeouts do not decrement the interaction count,
// Continued suspense work should also not increment the count.
storeInteractionsForExpirationTime(root, rootExpirationTime, false);
requestWork(root, rootExpirationTime);
tracking.__interactionsRef.current = prevInteractions;
tracing.__interactionsRef.current = prevInteractions;
} else {
requestWork(root, rootExpirationTime);
}
Expand Down Expand Up @@ -14633,7 +14633,7 @@ function storeInteractionsForExpirationTime(
return;
}

var interactions = tracking.__interactionsRef.current;
var interactions = tracing.__interactionsRef.current;
if (interactions.size > 0) {
var pendingInteractions = root.pendingInteractionMap.get(expirationTime);
if (pendingInteractions != null) {
Expand All @@ -14656,7 +14656,7 @@ function storeInteractionsForExpirationTime(
}
}

var subscriber = tracking.__subscriberRef.current;
var subscriber = tracing.__subscriberRef.current;
if (subscriber !== null) {
var threadID = computeThreadID(expirationTime, root.interactionThreadID);
subscriber.onWorkScheduled(interactions, threadID);
Expand Down
Loading