Skip to content

Commit c7d703e

Browse files
committed
Remove useMutableSource (#27011)
## Summary This PR cleans up `useMutableSource`. This has been blocked by a remaining dependency internally at Meta, but that has now been deleted. <!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? --> ## How did you test this change? ``` yarn flow yarn lint yarn test --prod ``` <!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. How exactly did you verify that your PR solves the issue you wanted to solve? If you leave this empty, your PR will very likely be closed. --> DiffTrain build for [80d9a40](80d9a40)
1 parent b52e425 commit c7d703e

30 files changed

+557
-4705
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
70e998a1064cc1e8e8f9103e0c00d37fbbcf71c1
1+
80d9a40114bb43c07d021e8254790852f450bd2b

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-classic-3cdb3aa3";
30+
var ReactVersion = "18.3.0-www-classic-70d18c58";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,
@@ -1994,10 +1994,6 @@ function useId() {
19941994
var dispatcher = resolveDispatcher();
19951995
return dispatcher.useId();
19961996
}
1997-
function useMutableSource(source, getSnapshot, subscribe) {
1998-
var dispatcher = resolveDispatcher();
1999-
return dispatcher.useMutableSource(source, getSnapshot, subscribe);
2000-
}
20011997
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
20021998
var dispatcher = resolveDispatcher();
20031999
return dispatcher.useSyncExternalStore(
@@ -3018,26 +3014,6 @@ function createServerContext(globalName, defaultValue) {
30183014
return context;
30193015
}
30203016

3021-
function createMutableSource(source, getVersion) {
3022-
var mutableSource = {
3023-
_getVersion: getVersion,
3024-
_source: source,
3025-
_workInProgressVersionPrimary: null,
3026-
_workInProgressVersionSecondary: null
3027-
};
3028-
3029-
{
3030-
mutableSource._currentPrimaryRenderer = null;
3031-
mutableSource._currentSecondaryRenderer = null; // Used to detect side effects that update a mutable source during render.
3032-
// See https://github.com/facebook/react/issues/19948
3033-
3034-
mutableSource._currentlyRenderingFiber = null;
3035-
mutableSource._initialVersionAsOfFirstRender = null;
3036-
}
3037-
3038-
return mutableSource;
3039-
}
3040-
30413017
function startTransition(scope, options) {
30423018
var prevTransition = ReactCurrentBatchConfig.transition;
30433019
ReactCurrentBatchConfig.transition = {};
@@ -4175,7 +4151,6 @@ exports.cloneElement = cloneElement;
41754151
exports.createContext = createContext;
41764152
exports.createElement = createElement;
41774153
exports.createFactory = createFactory;
4178-
exports.createMutableSource = createMutableSource;
41794154
exports.createRef = createRef;
41804155
exports.createServerContext = createServerContext;
41814156
exports.experimental_useEffectEvent = useEffectEvent;
@@ -4196,14 +4171,12 @@ exports.unstable_Scope = REACT_SCOPE_TYPE;
41964171
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
41974172
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
41984173
exports.unstable_act = act;
4199-
exports.unstable_createMutableSource = createMutableSource;
42004174
exports.unstable_getCacheForType = getCacheForType;
42014175
exports.unstable_getCacheSignal = getCacheSignal;
42024176
exports.unstable_startTransition = startTransition;
42034177
exports.unstable_useCacheRefresh = useCacheRefresh;
42044178
exports.unstable_useDeferredValue = useDeferredValue;
42054179
exports.unstable_useMemoCache = useMemoCache;
4206-
exports.unstable_useMutableSource = useMutableSource;
42074180
exports.unstable_useTransition = useTransition;
42084181
exports.use = use;
42094182
exports.useCallback = useCallback;
@@ -4216,7 +4189,6 @@ exports.useImperativeHandle = useImperativeHandle;
42164189
exports.useInsertionEffect = useInsertionEffect;
42174190
exports.useLayoutEffect = useLayoutEffect;
42184191
exports.useMemo = useMemo;
4219-
exports.useMutableSource = useMutableSource;
42204192
exports.useReducer = useReducer;
42214193
exports.useRef = useRef;
42224194
exports.useState = useState;

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-www-modern-df20a6fc";
30+
var ReactVersion = "18.3.0-www-modern-6b726e24";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,
@@ -1994,10 +1994,6 @@ function useId() {
19941994
var dispatcher = resolveDispatcher();
19951995
return dispatcher.useId();
19961996
}
1997-
function useMutableSource(source, getSnapshot, subscribe) {
1998-
var dispatcher = resolveDispatcher();
1999-
return dispatcher.useMutableSource(source, getSnapshot, subscribe);
2000-
}
20011997
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
20021998
var dispatcher = resolveDispatcher();
20031999
return dispatcher.useSyncExternalStore(
@@ -2984,26 +2980,6 @@ function createServerContext(globalName, defaultValue) {
29842980
return context;
29852981
}
29862982

2987-
function createMutableSource(source, getVersion) {
2988-
var mutableSource = {
2989-
_getVersion: getVersion,
2990-
_source: source,
2991-
_workInProgressVersionPrimary: null,
2992-
_workInProgressVersionSecondary: null
2993-
};
2994-
2995-
{
2996-
mutableSource._currentPrimaryRenderer = null;
2997-
mutableSource._currentSecondaryRenderer = null; // Used to detect side effects that update a mutable source during render.
2998-
// See https://github.com/facebook/react/issues/19948
2999-
3000-
mutableSource._currentlyRenderingFiber = null;
3001-
mutableSource._initialVersionAsOfFirstRender = null;
3002-
}
3003-
3004-
return mutableSource;
3005-
}
3006-
30072983
function startTransition(scope, options) {
30082984
var prevTransition = ReactCurrentBatchConfig.transition;
30092985
ReactCurrentBatchConfig.transition = {};
@@ -4139,7 +4115,6 @@ exports.cache = cache;
41394115
exports.cloneElement = cloneElement;
41404116
exports.createContext = createContext;
41414117
exports.createElement = createElement;
4142-
exports.createMutableSource = createMutableSource;
41434118
exports.createRef = createRef;
41444119
exports.createServerContext = createServerContext;
41454120
exports.experimental_useEffectEvent = useEffectEvent;
@@ -4159,14 +4134,12 @@ exports.unstable_Offscreen = REACT_OFFSCREEN_TYPE;
41594134
exports.unstable_Scope = REACT_SCOPE_TYPE;
41604135
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
41614136
exports.unstable_act = act;
4162-
exports.unstable_createMutableSource = createMutableSource;
41634137
exports.unstable_getCacheForType = getCacheForType;
41644138
exports.unstable_getCacheSignal = getCacheSignal;
41654139
exports.unstable_startTransition = startTransition;
41664140
exports.unstable_useCacheRefresh = useCacheRefresh;
41674141
exports.unstable_useDeferredValue = useDeferredValue;
41684142
exports.unstable_useMemoCache = useMemoCache;
4169-
exports.unstable_useMutableSource = useMutableSource;
41704143
exports.unstable_useTransition = useTransition;
41714144
exports.use = use;
41724145
exports.useCallback = useCallback;
@@ -4179,7 +4152,6 @@ exports.useImperativeHandle = useImperativeHandle;
41794152
exports.useInsertionEffect = useInsertionEffect;
41804153
exports.useLayoutEffect = useLayoutEffect;
41814154
exports.useMemo = useMemo;
4182-
exports.useMutableSource = useMutableSource;
41834155
exports.useReducer = useReducer;
41844156
exports.useRef = useRef;
41854157
exports.useState = useState;

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,6 @@ function useTransition() {
289289
function useDeferredValue(value) {
290290
return ReactCurrentDispatcher.current.useDeferredValue(value);
291291
}
292-
function useMutableSource(source, getSnapshot, subscribe) {
293-
return ReactCurrentDispatcher.current.useMutableSource(
294-
source,
295-
getSnapshot,
296-
subscribe
297-
);
298-
}
299292
var ReactCurrentBatchConfig = { transition: null },
300293
ReactSharedInternals = {
301294
ReactCurrentDispatcher: ReactCurrentDispatcher,
@@ -305,14 +298,6 @@ var ReactCurrentBatchConfig = { transition: null },
305298
ContextRegistry: {}
306299
},
307300
ContextRegistry = ReactSharedInternals.ContextRegistry;
308-
function createMutableSource(source, getVersion) {
309-
return {
310-
_getVersion: getVersion,
311-
_source: source,
312-
_workInProgressVersionPrimary: null,
313-
_workInProgressVersionSecondary: null
314-
};
315-
}
316301
function startTransition(scope, options) {
317302
var prevTransition = ReactCurrentBatchConfig.transition;
318303
ReactCurrentBatchConfig.transition = {};
@@ -499,7 +484,6 @@ exports.createFactory = function (type) {
499484
factory.type = type;
500485
return factory;
501486
};
502-
exports.createMutableSource = createMutableSource;
503487
exports.createRef = function () {
504488
return { current: null };
505489
};
@@ -571,7 +555,6 @@ exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
571555
exports.unstable_act = function () {
572556
throw Error("act(...) is not supported in production builds of React.");
573557
};
574-
exports.unstable_createMutableSource = createMutableSource;
575558
exports.unstable_getCacheForType = function (resourceType) {
576559
var dispatcher = ReactCurrentCache.current;
577560
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
@@ -596,7 +579,6 @@ exports.unstable_useDeferredValue = useDeferredValue;
596579
exports.unstable_useMemoCache = function (size) {
597580
return ReactCurrentDispatcher.current.useMemoCache(size);
598581
};
599-
exports.unstable_useMutableSource = useMutableSource;
600582
exports.unstable_useTransition = useTransition;
601583
exports.use = function (usable) {
602584
return ReactCurrentDispatcher.current.use(usable);
@@ -627,7 +609,6 @@ exports.useLayoutEffect = function (create, deps) {
627609
exports.useMemo = function (create, deps) {
628610
return ReactCurrentDispatcher.current.useMemo(create, deps);
629611
};
630-
exports.useMutableSource = useMutableSource;
631612
exports.useReducer = function (reducer, initialArg, init) {
632613
return ReactCurrentDispatcher.current.useReducer(reducer, initialArg, init);
633614
};
@@ -649,4 +630,4 @@ exports.useSyncExternalStore = function (
649630
);
650631
};
651632
exports.useTransition = useTransition;
652-
exports.version = "18.3.0-www-classic-6b556dd3";
633+
exports.version = "18.3.0-www-classic-89dfcb69";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,6 @@ function useTransition() {
256256
function useDeferredValue(value) {
257257
return ReactCurrentDispatcher.current.useDeferredValue(value);
258258
}
259-
function useMutableSource(source, getSnapshot, subscribe) {
260-
return ReactCurrentDispatcher.current.useMutableSource(
261-
source,
262-
getSnapshot,
263-
subscribe
264-
);
265-
}
266259
var ReactCurrentBatchConfig = { transition: null },
267260
ReactSharedInternals = {
268261
ReactCurrentDispatcher: ReactCurrentDispatcher,
@@ -272,14 +265,6 @@ var ReactCurrentBatchConfig = { transition: null },
272265
ContextRegistry: {}
273266
},
274267
ContextRegistry = ReactSharedInternals.ContextRegistry;
275-
function createMutableSource(source, getVersion) {
276-
return {
277-
_getVersion: getVersion,
278-
_source: source,
279-
_workInProgressVersionPrimary: null,
280-
_workInProgressVersionSecondary: null
281-
};
282-
}
283268
function startTransition(scope, options) {
284269
var prevTransition = ReactCurrentBatchConfig.transition;
285270
ReactCurrentBatchConfig.transition = {};
@@ -492,7 +477,6 @@ exports.createElement = function (type, config, children) {
492477
_owner: ReactCurrentOwner$1.current
493478
};
494479
};
495-
exports.createMutableSource = createMutableSource;
496480
exports.createRef = function () {
497481
return { current: null };
498482
};
@@ -563,7 +547,6 @@ exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
563547
exports.unstable_act = function () {
564548
throw Error("act(...) is not supported in production builds of React.");
565549
};
566-
exports.unstable_createMutableSource = createMutableSource;
567550
exports.unstable_getCacheForType = function (resourceType) {
568551
var dispatcher = ReactCurrentCache.current;
569552
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
@@ -588,7 +571,6 @@ exports.unstable_useDeferredValue = useDeferredValue;
588571
exports.unstable_useMemoCache = function (size) {
589572
return ReactCurrentDispatcher.current.useMemoCache(size);
590573
};
591-
exports.unstable_useMutableSource = useMutableSource;
592574
exports.unstable_useTransition = useTransition;
593575
exports.use = function (usable) {
594576
return ReactCurrentDispatcher.current.use(usable);
@@ -619,7 +601,6 @@ exports.useLayoutEffect = function (create, deps) {
619601
exports.useMemo = function (create, deps) {
620602
return ReactCurrentDispatcher.current.useMemo(create, deps);
621603
};
622-
exports.useMutableSource = useMutableSource;
623604
exports.useReducer = function (reducer, initialArg, init) {
624605
return ReactCurrentDispatcher.current.useReducer(reducer, initialArg, init);
625606
};
@@ -641,4 +622,4 @@ exports.useSyncExternalStore = function (
641622
);
642623
};
643624
exports.useTransition = useTransition;
644-
exports.version = "18.3.0-www-modern-f3a022db";
625+
exports.version = "18.3.0-www-modern-ad08fdeb";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,6 @@ function useTransition() {
300300
function useDeferredValue(value) {
301301
return ReactCurrentDispatcher.current.useDeferredValue(value);
302302
}
303-
function useMutableSource(source, getSnapshot, subscribe) {
304-
return ReactCurrentDispatcher.current.useMutableSource(
305-
source,
306-
getSnapshot,
307-
subscribe
308-
);
309-
}
310303
var ReactCurrentBatchConfig = { transition: null },
311304
ReactSharedInternals = {
312305
ReactCurrentDispatcher: ReactCurrentDispatcher,
@@ -316,14 +309,6 @@ var ReactCurrentBatchConfig = { transition: null },
316309
ContextRegistry: {}
317310
},
318311
ContextRegistry = ReactSharedInternals.ContextRegistry;
319-
function createMutableSource(source, getVersion) {
320-
return {
321-
_getVersion: getVersion,
322-
_source: source,
323-
_workInProgressVersionPrimary: null,
324-
_workInProgressVersionSecondary: null
325-
};
326-
}
327312
function startTransition(scope, options) {
328313
var prevTransition = ReactCurrentBatchConfig.transition;
329314
ReactCurrentBatchConfig.transition = {};
@@ -510,7 +495,6 @@ exports.createFactory = function (type) {
510495
factory.type = type;
511496
return factory;
512497
};
513-
exports.createMutableSource = createMutableSource;
514498
exports.createRef = function () {
515499
return { current: null };
516500
};
@@ -582,7 +566,6 @@ exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
582566
exports.unstable_act = function () {
583567
throw Error("act(...) is not supported in production builds of React.");
584568
};
585-
exports.unstable_createMutableSource = createMutableSource;
586569
exports.unstable_getCacheForType = function (resourceType) {
587570
var dispatcher = ReactCurrentCache.current;
588571
return dispatcher ? dispatcher.getCacheForType(resourceType) : resourceType();
@@ -607,7 +590,6 @@ exports.unstable_useDeferredValue = useDeferredValue;
607590
exports.unstable_useMemoCache = function (size) {
608591
return ReactCurrentDispatcher.current.useMemoCache(size);
609592
};
610-
exports.unstable_useMutableSource = useMutableSource;
611593
exports.unstable_useTransition = useTransition;
612594
exports.use = function (usable) {
613595
return ReactCurrentDispatcher.current.use(usable);
@@ -638,7 +620,6 @@ exports.useLayoutEffect = function (create, deps) {
638620
exports.useMemo = function (create, deps) {
639621
return ReactCurrentDispatcher.current.useMemo(create, deps);
640622
};
641-
exports.useMutableSource = useMutableSource;
642623
exports.useReducer = function (reducer, initialArg, init) {
643624
return ReactCurrentDispatcher.current.useReducer(reducer, initialArg, init);
644625
};
@@ -660,7 +641,7 @@ exports.useSyncExternalStore = function (
660641
);
661642
};
662643
exports.useTransition = useTransition;
663-
exports.version = "18.3.0-www-classic-e9e36727";
644+
exports.version = "18.3.0-www-classic-5a120705";
664645

665646
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
666647
if (

0 commit comments

Comments
 (0)