@samitouri / QOS-React-2 / commits / 4ecf11977c

Remove the Fundamental internals (#20745)

Dan Abramov committed Feb 5, 2021 at 20:36 UTC 4ecf11977c46966d3deedcdc71f1280a34607d1d
41 files changed +12 -1092
packages/react-art/src/ReactARTHostConfig.js
-20
@@ -428,26 +428,6 @@ export function clearContainer(container) {
428 // TODO Implement this
429 }
430
431 -export function getFundamentalComponentInstance(fundamentalInstance) {
432 - throw new Error('Not yet implemented.');
433 -}
434 -
435 -export function mountFundamentalComponent(fundamentalInstance) {
436 - throw new Error('Not yet implemented.');
437 -}
438 -
439 -export function shouldUpdateFundamentalComponent(fundamentalInstance) {
440 - throw new Error('Not yet implemented.');
441 -}
442 -
443 -export function updateFundamentalComponent(fundamentalInstance) {
444 - throw new Error('Not yet implemented.');
445 -}
446 -
447 -export function unmountFundamentalComponent(fundamentalInstance) {
448 - throw new Error('Not yet implemented.');
449 -}
450 -
431 export function getInstanceFromNode(node) {
432 throw new Error('Not yet implemented.');
433 }
packages/react-devtools-shared/src/backend/ReactSymbols.js
-3
@@ -34,9 +34,6 @@ export const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)';
34 export const FRAGMENT_NUMBER = 0xeacb;
35 export const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)';
36
37 -export const FUNDAMENTAL_NUMBER = 0xead5;
38 -export const FUNDAMENTAL_SYMBOL_STRING = 'Symbol(react.fundamental)';
39 -
37 export const LAZY_NUMBER = 0xead4;
38 export const LAZY_SYMBOL_STRING = 'Symbol(react.lazy)';
39
packages/react-dom/src/client/ReactDOMHostConfig.js
-64
@@ -16,7 +16,6 @@ import type {
16 } from 'react-reconciler/src/ReactTestSelectors';
17 import type {RootType} from './ReactDOMRoot';
18 import type {ReactScopeInstance} from 'shared/ReactTypes';
19 -import type {ReactDOMFundamentalComponentInstance} from '../shared/ReactDOMTypes';
19
20 import {
21 precacheFiberNode,
@@ -64,7 +63,6 @@ import {retryIfBlockedOn} from '../events/ReactDOMEventReplaying';
63
64 import {
65 enableSuspenseServerRenderer,
67 - enableFundamentalAPI,
66 enableCreateEventHandleAPI,
67 enableScopeAPI,
68 } from 'shared/ReactFeatureFlags';
@@ -988,68 +986,6 @@ export function didNotFindHydratableSuspenseInstance(
986 }
987 }
988
991 -export function getFundamentalComponentInstance(
992 - fundamentalInstance: ReactDOMFundamentalComponentInstance,
993 -): Instance {
994 - if (enableFundamentalAPI) {
995 - const {currentFiber, impl, props, state} = fundamentalInstance;
996 - const instance = impl.getInstance(null, props, state);
997 - precacheFiberNode(currentFiber, instance);
998 - return instance;
999 - }
1000 - // Because of the flag above, this gets around the Flow error;
1001 - return (null: any);
1002 -}
1003 -
1004 -export function mountFundamentalComponent(
1005 - fundamentalInstance: ReactDOMFundamentalComponentInstance,
1006 -): void {
1007 - if (enableFundamentalAPI) {
1008 - const {impl, instance, props, state} = fundamentalInstance;
1009 - const onMount = impl.onMount;
1010 - if (onMount !== undefined) {
1011 - onMount(null, instance, props, state);
1012 - }
1013 - }
1014 -}
1015 -
1016 -export function shouldUpdateFundamentalComponent(
1017 - fundamentalInstance: ReactDOMFundamentalComponentInstance,
1018 -): boolean {
1019 - if (enableFundamentalAPI) {
1020 - const {impl, prevProps, props, state} = fundamentalInstance;
1021 - const shouldUpdate = impl.shouldUpdate;
1022 - if (shouldUpdate !== undefined) {
1023 - return shouldUpdate(null, prevProps, props, state);
1024 - }
1025 - }
1026 - return true;
1027 -}
1028 -
1029 -export function updateFundamentalComponent(
1030 - fundamentalInstance: ReactDOMFundamentalComponentInstance,
1031 -): void {
1032 - if (enableFundamentalAPI) {
1033 - const {impl, instance, prevProps, props, state} = fundamentalInstance;
1034 - const onUpdate = impl.onUpdate;
1035 - if (onUpdate !== undefined) {
1036 - onUpdate(null, instance, prevProps, props, state);
1037 - }
1038 - }
1039 -}
1040 -
1041 -export function unmountFundamentalComponent(
1042 - fundamentalInstance: ReactDOMFundamentalComponentInstance,
1043 -): void {
1044 - if (enableFundamentalAPI) {
1045 - const {impl, instance, props, state} = fundamentalInstance;
1046 - const onUnmount = impl.onUnmount;
1047 - if (onUnmount !== undefined) {
1048 - onUnmount(null, instance, props, state);
1049 - }
1050 - }
1051 -}
1052 -
989 export function getInstanceFromNode(node: HTMLElement): null | Object {
990 return getClosestInstanceFromNode(node) || null;
991 }
packages/react-dom/src/server/ReactPartialRenderer.js
-39
@@ -22,7 +22,6 @@ import {
22 disableLegacyContext,
23 disableModulePatternComponents,
24 enableSuspenseServerRenderer,
25 - enableFundamentalAPI,
25 enableScopeAPI,
26 } from 'shared/ReactFeatureFlags';
27
@@ -39,7 +38,6 @@ import {
38 REACT_CONTEXT_TYPE,
39 REACT_LAZY_TYPE,
40 REACT_MEMO_TYPE,
42 - REACT_FUNDAMENTAL_TYPE,
41 REACT_SCOPE_TYPE,
42 REACT_LEGACY_HIDDEN_TYPE,
43 } from 'shared/ReactSymbols';
@@ -1253,43 +1251,6 @@ class ReactDOMServerRenderer {
1251 return '';
1252 }
1253 // eslint-disable-next-line-no-fallthrough
1256 - case REACT_FUNDAMENTAL_TYPE: {
1257 - if (enableFundamentalAPI) {
1258 - const fundamentalImpl = elementType.impl;
1259 - const open = fundamentalImpl.getServerSideString(
1260 - null,
1261 - nextElement.props,
1262 - );
1263 - const getServerSideStringClose =
1264 - fundamentalImpl.getServerSideStringClose;
1265 - const close =
1266 - getServerSideStringClose !== undefined
1267 - ? getServerSideStringClose(null, nextElement.props)
1268 - : '';
1269 - const nextChildren =
1270 - fundamentalImpl.reconcileChildren !== false
1271 - ? toArray(((nextChild: any): ReactElement).props.children)
1272 - : [];
1273 - const frame: Frame = {
1274 - type: null,
1275 - domNamespace: parentNamespace,
1276 - children: nextChildren,
1277 - childIndex: 0,
1278 - context: context,
1279 - footer: close,
1280 - };
1281 - if (__DEV__) {
1282 - ((frame: any): FrameDev).debugElementStack = [];
1283 - }
1284 - this.stack.push(frame);
1285 - return open;
1286 - }
1287 - invariant(
1288 - false,
1289 - 'ReactDOMServer does not yet support the fundamental API.',
1290 - );
1291 - }
1292 - // eslint-disable-next-line-no-fallthrough
1254 case REACT_LAZY_TYPE: {
1255 const element: ReactElement = (nextChild: any);
1256 const lazyComponent: LazyComponent<any, any> = (nextChild: any)
packages/react-dom/src/shared/ReactDOMTypes.js
+1 -9
@@ -7,17 +7,9 @@
7 * @flow
8 */
9
10 -import type {
11 - ReactFundamentalComponentInstance,
12 - ReactScopeInstance,
13 -} from 'shared/ReactTypes';
10 +import type {ReactScopeInstance} from 'shared/ReactTypes';
11 import type {DOMEventName} from '../events/DOMEventNames';
12
16 -export type ReactDOMFundamentalComponentInstance = ReactFundamentalComponentInstance<
17 - any,
18 - any,
19 ->;
20 -
13 export type ReactDOMEventHandle = (
14 target: EventTarget | ReactScopeInstance,
15 callback: (SyntheticEvent<EventTarget>) => void,
packages/react-native-renderer/src/ReactFabricHostConfig.js
-24
@@ -438,30 +438,6 @@ export function replaceContainerChildren(
438 newChildren: ChildSet,
439 ): void {}
440
441 -export function getFundamentalComponentInstance(fundamentalInstance: any) {
442 - throw new Error('Not yet implemented.');
443 -}
444 -
445 -export function mountFundamentalComponent(fundamentalInstance: any) {
446 - throw new Error('Not yet implemented.');
447 -}
448 -
449 -export function shouldUpdateFundamentalComponent(fundamentalInstance: any) {
450 - throw new Error('Not yet implemented.');
451 -}
452 -
453 -export function updateFundamentalComponent(fundamentalInstance: any) {
454 - throw new Error('Not yet implemented.');
455 -}
456 -
457 -export function unmountFundamentalComponent(fundamentalInstance: any) {
458 - throw new Error('Not yet implemented.');
459 -}
460 -
461 -export function cloneFundamentalInstance(fundamentalInstance: any) {
462 - throw new Error('Not yet implemented.');
463 -}
464 -
441 export function getInstanceFromNode(node: any) {
442 throw new Error('Not yet implemented.');
443 }
packages/react-native-renderer/src/ReactNativeHostConfig.js
-20
@@ -495,26 +495,6 @@ export function unhideTextInstance(
495 throw new Error('Not yet implemented.');
496 }
497
498 -export function getFundamentalComponentInstance(fundamentalInstance: any) {
499 - throw new Error('Not yet implemented.');
500 -}
501 -
502 -export function mountFundamentalComponent(fundamentalInstance: any) {
503 - throw new Error('Not yet implemented.');
504 -}
505 -
506 -export function shouldUpdateFundamentalComponent(fundamentalInstance: any) {
507 - throw new Error('Not yet implemented.');
508 -}
509 -
510 -export function updateFundamentalComponent(fundamentalInstance: any) {
511 - throw new Error('Not yet implemented.');
512 -}
513 -
514 -export function unmountFundamentalComponent(fundamentalInstance: any) {
515 - throw new Error('Not yet implemented.');
516 -}
517 -
498 export function getInstanceFromNode(node: any) {
499 throw new Error('Not yet implemented.');
500 }
packages/react-noop-renderer/src/createReactNoop.js
-51
@@ -397,57 +397,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
397 warnsIfNotActing: true,
398 supportsHydration: false,
399
400 - getFundamentalComponentInstance(fundamentalInstance): Instance {
401 - const {impl, props, state} = fundamentalInstance;
402 - return impl.getInstance(null, props, state);
403 - },
404 -
405 - mountFundamentalComponent(fundamentalInstance): void {
406 - const {impl, instance, props, state} = fundamentalInstance;
407 - const onMount = impl.onUpdate;
408 - if (onMount !== undefined) {
409 - onMount(null, instance, props, state);
410 - }
411 - },
412 -
413 - shouldUpdateFundamentalComponent(fundamentalInstance): boolean {
414 - const {impl, instance, prevProps, props, state} = fundamentalInstance;
415 - const shouldUpdate = impl.shouldUpdate;
416 - if (shouldUpdate !== undefined) {
417 - return shouldUpdate(null, instance, prevProps, props, state);
418 - }
419 - return true;
420 - },
421 -
422 - updateFundamentalComponent(fundamentalInstance): void {
423 - const {impl, instance, prevProps, props, state} = fundamentalInstance;
424 - const onUpdate = impl.onUpdate;
425 - if (onUpdate !== undefined) {
426 - onUpdate(null, instance, prevProps, props, state);
427 - }
428 - },
429 -
430 - unmountFundamentalComponent(fundamentalInstance): void {
431 - const {impl, instance, props, state} = fundamentalInstance;
432 - const onUnmount = impl.onUnmount;
433 - if (onUnmount !== undefined) {
434 - onUnmount(null, instance, props, state);
435 - }
436 - },
437 -
438 - cloneFundamentalInstance(fundamentalInstance): Instance {
439 - const instance = fundamentalInstance.instance;
440 - return {
441 - children: [],
442 - text: instance.text,
443 - type: instance.type,
444 - prop: instance.prop,
445 - id: instance.id,
446 - context: instance.context,
447 - hidden: instance.hidden,
448 - };
449 - },
450 -
400 getInstanceFromNode() {
401 throw new Error('Not yet implemented.');
402 },
packages/react-reconciler/src/ReactFiber.new.js
+1 -34
@@ -8,12 +8,7 @@
8 */
9
10 import type {ReactElement} from 'shared/ReactElementType';
11 -import type {
12 - ReactFragment,
13 - ReactPortal,
14 - ReactFundamentalComponent,
15 - ReactScope,
16 -} from 'shared/ReactTypes';
11 +import type {ReactFragment, ReactPortal, ReactScope} from 'shared/ReactTypes';
12 import type {Fiber} from './ReactInternalTypes';
13 import type {RootTag} from './ReactRootTags';
14 import type {WorkTag} from './ReactWorkTags';
@@ -25,7 +20,6 @@ import type {OffscreenProps} from './ReactFiberOffscreenComponent';
20 import invariant from 'shared/invariant';
21 import {
22 enableProfilerTimer,
28 - enableFundamentalAPI,
23 enableScopeAPI,
24 enableCache,
25 } from 'shared/ReactFeatureFlags';
@@ -51,7 +45,6 @@ import {
45 MemoComponent,
46 SimpleMemoComponent,
47 LazyComponent,
54 - FundamentalComponent,
48 ScopeComponent,
49 OffscreenComponent,
50 LegacyHiddenComponent,
@@ -86,7 +79,6 @@ import {
79 REACT_SUSPENSE_LIST_TYPE,
80 REACT_MEMO_TYPE,
81 REACT_LAZY_TYPE,
89 - REACT_FUNDAMENTAL_TYPE,
82 REACT_SCOPE_TYPE,
83 REACT_OFFSCREEN_TYPE,
84 REACT_LEGACY_HIDDEN_TYPE,
@@ -525,17 +517,6 @@ export function createFiberFromTypeAndProps(
517 fiberTag = LazyComponent;
518 resolvedType = null;
519 break getTag;
528 - case REACT_FUNDAMENTAL_TYPE:
529 - if (enableFundamentalAPI) {
530 - return createFiberFromFundamental(
531 - type,
532 - pendingProps,
533 - mode,
534 - lanes,
535 - key,
536 - );
537 - }
538 - break;
520 }
521 }
522 let info = '';
@@ -618,20 +599,6 @@ export function createFiberFromFragment(
599 return fiber;
600 }
601
621 -export function createFiberFromFundamental(
622 - fundamentalComponent: ReactFundamentalComponent<any, any>,
623 - pendingProps: any,
624 - mode: TypeOfMode,
625 - lanes: Lanes,
626 - key: null | string,
627 -): Fiber {
628 - const fiber = createFiber(FundamentalComponent, pendingProps, key, mode);
629 - fiber.elementType = fundamentalComponent;
630 - fiber.type = fundamentalComponent;
631 - fiber.lanes = lanes;
632 - return fiber;
633 -}
634 -
602 function createFiberFromScope(
603 scope: ReactScope,
604 pendingProps: any,
packages/react-reconciler/src/ReactFiber.old.js
+1 -34
@@ -8,12 +8,7 @@
8 */
9
10 import type {ReactElement} from 'shared/ReactElementType';
11 -import type {
12 - ReactFragment,
13 - ReactPortal,
14 - ReactFundamentalComponent,
15 - ReactScope,
16 -} from 'shared/ReactTypes';
11 +import type {ReactFragment, ReactPortal, ReactScope} from 'shared/ReactTypes';
12 import type {Fiber} from './ReactInternalTypes';
13 import type {RootTag} from './ReactRootTags';
14 import type {WorkTag} from './ReactWorkTags';
@@ -25,7 +20,6 @@ import type {OffscreenProps} from './ReactFiberOffscreenComponent';
20 import invariant from 'shared/invariant';
21 import {
22 enableProfilerTimer,
28 - enableFundamentalAPI,
23 enableScopeAPI,
24 enableCache,
25 } from 'shared/ReactFeatureFlags';
@@ -51,7 +45,6 @@ import {
45 MemoComponent,
46 SimpleMemoComponent,
47 LazyComponent,
54 - FundamentalComponent,
48 ScopeComponent,
49 OffscreenComponent,
50 LegacyHiddenComponent,
@@ -86,7 +79,6 @@ import {
79 REACT_SUSPENSE_LIST_TYPE,
80 REACT_MEMO_TYPE,
81 REACT_LAZY_TYPE,
89 - REACT_FUNDAMENTAL_TYPE,
82 REACT_SCOPE_TYPE,
83 REACT_OFFSCREEN_TYPE,
84 REACT_LEGACY_HIDDEN_TYPE,
@@ -525,17 +517,6 @@ export function createFiberFromTypeAndProps(
517 fiberTag = LazyComponent;
518 resolvedType = null;
519 break getTag;
528 - case REACT_FUNDAMENTAL_TYPE:
529 - if (enableFundamentalAPI) {
530 - return createFiberFromFundamental(
531 - type,
532 - pendingProps,
533 - mode,
534 - lanes,
535 - key,
536 - );
537 - }
538 - break;
520 }
521 }
522 let info = '';
@@ -618,20 +599,6 @@ export function createFiberFromFragment(
599 return fiber;
600 }
601
621 -export function createFiberFromFundamental(
622 - fundamentalComponent: ReactFundamentalComponent<any, any>,
623 - pendingProps: any,
624 - mode: TypeOfMode,
625 - lanes: Lanes,
626 - key: null | string,
627 -): Fiber {
628 - const fiber = createFiber(FundamentalComponent, pendingProps, key, mode);
629 - fiber.elementType = fundamentalComponent;
630 - fiber.type = fundamentalComponent;
631 - fiber.lanes = lanes;
632 - return fiber;
633 -}
634 -
602 function createFiberFromScope(
603 scope: ReactScope,
604 pendingProps: any,
packages/react-reconciler/src/ReactFiberBeginWork.new.js
-20
@@ -52,7 +52,6 @@ import {
52 SimpleMemoComponent,
53 LazyComponent,
54 IncompleteClassComponent,
55 - FundamentalComponent,
55 ScopeComponent,
56 OffscreenComponent,
57 LegacyHiddenComponent,
@@ -79,7 +78,6 @@ import {
78 enableProfilerTimer,
79 enableSchedulerTracing,
80 enableSuspenseServerRenderer,
82 - enableFundamentalAPI,
81 warnAboutDefaultPropsOnFunctionComponents,
82 enableScopeAPI,
83 enableCache,
@@ -3063,18 +3061,6 @@ function updateContextConsumer(
3061 return workInProgress.child;
3062 }
3063
3066 -function updateFundamentalComponent(current, workInProgress, renderLanes) {
3067 - const fundamentalImpl = workInProgress.type.impl;
3068 - if (fundamentalImpl.reconcileChildren === false) {
3069 - return null;
3070 - }
3071 - const nextProps = workInProgress.pendingProps;
3072 - const nextChildren = nextProps.children;
3073 -
3074 - reconcileChildren(current, workInProgress, nextChildren, renderLanes);
3075 - return workInProgress.child;
3076 -}
3077 -
3064 function updateScopeComponent(current, workInProgress, renderLanes) {
3065 const nextProps = workInProgress.pendingProps;
3066 const nextChildren = nextProps.children;
@@ -3571,12 +3557,6 @@ function beginWork(
3557 case SuspenseListComponent: {
3558 return updateSuspenseListComponent(current, workInProgress, renderLanes);
3559 }
3574 - case FundamentalComponent: {
3575 - if (enableFundamentalAPI) {
3576 - return updateFundamentalComponent(current, workInProgress, renderLanes);
3577 - }
3578 - break;
3579 - }
3560 case ScopeComponent: {
3561 if (enableScopeAPI) {
3562 return updateScopeComponent(current, workInProgress, renderLanes);
packages/react-reconciler/src/ReactFiberBeginWork.old.js
-20
@@ -52,7 +52,6 @@ import {
52 SimpleMemoComponent,
53 LazyComponent,
54 IncompleteClassComponent,
55 - FundamentalComponent,
55 ScopeComponent,
56 OffscreenComponent,
57 LegacyHiddenComponent,
@@ -79,7 +78,6 @@ import {
78 enableProfilerTimer,
79 enableSchedulerTracing,
80 enableSuspenseServerRenderer,
82 - enableFundamentalAPI,
81 warnAboutDefaultPropsOnFunctionComponents,
82 enableScopeAPI,
83 enableCache,
@@ -3063,18 +3061,6 @@ function updateContextConsumer(
3061 return workInProgress.child;
3062 }
3063
3066 -function updateFundamentalComponent(current, workInProgress, renderLanes) {
3067 - const fundamentalImpl = workInProgress.type.impl;
3068 - if (fundamentalImpl.reconcileChildren === false) {
3069 - return null;
3070 - }
3071 - const nextProps = workInProgress.pendingProps;
3072 - const nextChildren = nextProps.children;
3073 -
3074 - reconcileChildren(current, workInProgress, nextChildren, renderLanes);
3075 - return workInProgress.child;
3076 -}
3077 -
3064 function updateScopeComponent(current, workInProgress, renderLanes) {
3065 const nextProps = workInProgress.pendingProps;
3066 const nextChildren = nextProps.children;
@@ -3571,12 +3557,6 @@ function beginWork(
3557 case SuspenseListComponent: {
3558 return updateSuspenseListComponent(current, workInProgress, renderLanes);
3559 }
3574 - case FundamentalComponent: {
3575 - if (enableFundamentalAPI) {
3576 - return updateFundamentalComponent(current, workInProgress, renderLanes);
3577 - }
3578 - break;
3579 - }
3560 case ScopeComponent: {
3561 if (enableScopeAPI) {
3562 return updateScopeComponent(current, workInProgress, renderLanes);
packages/react-reconciler/src/ReactFiberCommitWork.new.js
+3 -58
@@ -33,7 +33,6 @@ import {
33 enableProfilerCommitHooks,
34 enableProfilerNestedUpdatePhase,
35 enableSuspenseServerRenderer,
36 - enableFundamentalAPI,
36 enableSuspenseCallback,
37 enableScopeAPI,
38 enableDoubleInvokingEffects,
@@ -53,7 +52,6 @@ import {
52 MemoComponent,
53 SimpleMemoComponent,
54 SuspenseListComponent,
56 - FundamentalComponent,
55 ScopeComponent,
56 OffscreenComponent,
57 LegacyHiddenComponent,
@@ -124,8 +122,6 @@ import {
122 hideTextInstance,
123 unhideInstance,
124 unhideTextInstance,
127 - unmountFundamentalComponent,
128 - updateFundamentalComponent,
125 commitHydratedContainer,
126 commitHydratedSuspenseInstance,
127 clearContainer,
@@ -909,7 +905,6 @@ function commitLayoutEffectOnFiber(
905 }
906 case SuspenseListComponent:
907 case IncompleteClassComponent:
912 - case FundamentalComponent:
908 case ScopeComponent:
909 case OffscreenComponent:
910 case LegacyHiddenComponent:
@@ -1133,16 +1128,6 @@ function commitUnmount(
1128 }
1129 return;
1130 }
1136 - case FundamentalComponent: {
1137 - if (enableFundamentalAPI) {
1138 - const fundamentalInstance = current.stateNode;
1139 - if (fundamentalInstance !== null) {
1140 - unmountFundamentalComponent(fundamentalInstance);
1141 - current.stateNode = null;
1142 - }
1143 - }
1144 - return;
1145 - }
1131 case DehydratedFragment: {
1132 if (enableSuspenseCallback) {
1133 const hydrationCallbacks = finishedRoot.hydrationCallbacks;
@@ -1271,8 +1256,7 @@ function commitContainer(finishedWork: Fiber) {
1256 switch (finishedWork.tag) {
1257 case ClassComponent:
1258 case HostComponent:
1274 - case HostText:
1275 - case FundamentalComponent: {
1259 + case HostText: {
1260 return;
1261 }
1262 case HostRoot:
@@ -1388,11 +1372,6 @@ function commitPlacement(finishedWork: Fiber): void {
1372 parent = parentStateNode.containerInfo;
1373 isContainer = true;
1374 break;
1391 - case FundamentalComponent:
1392 - if (enableFundamentalAPI) {
1393 - parent = parentStateNode.instance;
1394 - isContainer = false;
1395 - }
1375 // eslint-disable-next-line-no-fallthrough
1376 default:
1377 invariant(
@@ -1425,7 +1404,7 @@ function insertOrAppendPlacementNodeIntoContainer(
1404 ): void {
1405 const {tag} = node;
1406 const isHost = tag === HostComponent || tag === HostText;
1428 - if (isHost || (enableFundamentalAPI && tag === FundamentalComponent)) {
1407 + if (isHost) {
1408 const stateNode = isHost ? node.stateNode : node.stateNode.instance;
1409 if (before) {
1410 insertInContainerBefore(parent, stateNode, before);
@@ -1456,7 +1435,7 @@ function insertOrAppendPlacementNode(
1435 ): void {
1436 const {tag} = node;
1437 const isHost = tag === HostComponent || tag === HostText;
1459 - if (isHost || (enableFundamentalAPI && tag === FundamentalComponent)) {
1438 + if (isHost) {
1439 const stateNode = isHost ? node.stateNode : node.stateNode.instance;
1440 if (before) {
1441 insertBefore(parent, stateNode, before);
@@ -1521,11 +1500,6 @@ function unmountHostComponents(
1500 currentParent = parentStateNode.containerInfo;
1501 currentParentIsContainer = true;
1502 break findParent;
1524 - case FundamentalComponent:
1525 - if (enableFundamentalAPI) {
1526 - currentParent = parentStateNode.instance;
1527 - currentParentIsContainer = false;
1528 - }
1503 }
1504 parent = parent.return;
1505 }
@@ -1553,27 +1527,6 @@ function unmountHostComponents(
1527 );
1528 }
1529 // Don't visit children because we already visited them.
1556 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
1557 - const fundamentalNode = node.stateNode.instance;
1558 - commitNestedUnmounts(
1559 - finishedRoot,
1560 - node,
1561 - nearestMountedAncestor,
1562 - renderPriorityLevel,
1563 - );
1564 - // After all the children have unmounted, it is now safe to remove the
1565 - // node from the tree.
1566 - if (currentParentIsContainer) {
1567 - removeChildFromContainer(
1568 - ((currentParent: any): Container),
1569 - (fundamentalNode: Instance),
1570 - );
1571 - } else {
1572 - removeChild(
1573 - ((currentParent: any): Instance),
1574 - (fundamentalNode: Instance),
1575 - );
1576 - }
1530 } else if (
1531 enableSuspenseServerRenderer &&
1532 node.tag === DehydratedFragment
@@ -1849,14 +1802,6 @@ function commitWork(current: Fiber | null, finishedWork: Fiber): void {
1802 case IncompleteClassComponent: {
1803 return;
1804 }
1852 - case FundamentalComponent: {
1853 - if (enableFundamentalAPI) {
1854 - const fundamentalInstance = finishedWork.stateNode;
1855 - updateFundamentalComponent(fundamentalInstance);
1856 - return;
1857 - }
1858 - break;
1859 - }
1805 case ScopeComponent: {
1806 if (enableScopeAPI) {
1807 const scopeInstance = finishedWork.stateNode;
packages/react-reconciler/src/ReactFiberCommitWork.old.js
+3 -58
@@ -33,7 +33,6 @@ import {
33 enableProfilerCommitHooks,
34 enableProfilerNestedUpdatePhase,
35 enableSuspenseServerRenderer,
36 - enableFundamentalAPI,
36 enableSuspenseCallback,
37 enableScopeAPI,
38 enableDoubleInvokingEffects,
@@ -53,7 +52,6 @@ import {
52 MemoComponent,
53 SimpleMemoComponent,
54 SuspenseListComponent,
56 - FundamentalComponent,
55 ScopeComponent,
56 OffscreenComponent,
57 LegacyHiddenComponent,
@@ -124,8 +122,6 @@ import {
122 hideTextInstance,
123 unhideInstance,
124 unhideTextInstance,
127 - unmountFundamentalComponent,
128 - updateFundamentalComponent,
125 commitHydratedContainer,
126 commitHydratedSuspenseInstance,
127 clearContainer,
@@ -909,7 +905,6 @@ function commitLayoutEffectOnFiber(
905 }
906 case SuspenseListComponent:
907 case IncompleteClassComponent:
912 - case FundamentalComponent:
908 case ScopeComponent:
909 case OffscreenComponent:
910 case LegacyHiddenComponent:
@@ -1133,16 +1128,6 @@ function commitUnmount(
1128 }
1129 return;
1130 }
1136 - case FundamentalComponent: {
1137 - if (enableFundamentalAPI) {
1138 - const fundamentalInstance = current.stateNode;
1139 - if (fundamentalInstance !== null) {
1140 - unmountFundamentalComponent(fundamentalInstance);
1141 - current.stateNode = null;
1142 - }
1143 - }
1144 - return;
1145 - }
1131 case DehydratedFragment: {
1132 if (enableSuspenseCallback) {
1133 const hydrationCallbacks = finishedRoot.hydrationCallbacks;
@@ -1271,8 +1256,7 @@ function commitContainer(finishedWork: Fiber) {
1256 switch (finishedWork.tag) {
1257 case ClassComponent:
1258 case HostComponent:
1274 - case HostText:
1275 - case FundamentalComponent: {
1259 + case HostText: {
1260 return;
1261 }
1262 case HostRoot:
@@ -1388,11 +1372,6 @@ function commitPlacement(finishedWork: Fiber): void {
1372 parent = parentStateNode.containerInfo;
1373 isContainer = true;
1374 break;
1391 - case FundamentalComponent:
1392 - if (enableFundamentalAPI) {
1393 - parent = parentStateNode.instance;
1394 - isContainer = false;
1395 - }
1375 // eslint-disable-next-line-no-fallthrough
1376 default:
1377 invariant(
@@ -1425,7 +1404,7 @@ function insertOrAppendPlacementNodeIntoContainer(
1404 ): void {
1405 const {tag} = node;
1406 const isHost = tag === HostComponent || tag === HostText;
1428 - if (isHost || (enableFundamentalAPI && tag === FundamentalComponent)) {
1407 + if (isHost) {
1408 const stateNode = isHost ? node.stateNode : node.stateNode.instance;
1409 if (before) {
1410 insertInContainerBefore(parent, stateNode, before);
@@ -1456,7 +1435,7 @@ function insertOrAppendPlacementNode(
1435 ): void {
1436 const {tag} = node;
1437 const isHost = tag === HostComponent || tag === HostText;
1459 - if (isHost || (enableFundamentalAPI && tag === FundamentalComponent)) {
1438 + if (isHost) {
1439 const stateNode = isHost ? node.stateNode : node.stateNode.instance;
1440 if (before) {
1441 insertBefore(parent, stateNode, before);
@@ -1521,11 +1500,6 @@ function unmountHostComponents(
1500 currentParent = parentStateNode.containerInfo;
1501 currentParentIsContainer = true;
1502 break findParent;
1524 - case FundamentalComponent:
1525 - if (enableFundamentalAPI) {
1526 - currentParent = parentStateNode.instance;
1527 - currentParentIsContainer = false;
1528 - }
1503 }
1504 parent = parent.return;
1505 }
@@ -1553,27 +1527,6 @@ function unmountHostComponents(
1527 );
1528 }
1529 // Don't visit children because we already visited them.
1556 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
1557 - const fundamentalNode = node.stateNode.instance;
1558 - commitNestedUnmounts(
1559 - finishedRoot,
1560 - node,
1561 - nearestMountedAncestor,
1562 - renderPriorityLevel,
1563 - );
1564 - // After all the children have unmounted, it is now safe to remove the
1565 - // node from the tree.
1566 - if (currentParentIsContainer) {
1567 - removeChildFromContainer(
1568 - ((currentParent: any): Container),
1569 - (fundamentalNode: Instance),
1570 - );
1571 - } else {
1572 - removeChild(
1573 - ((currentParent: any): Instance),
1574 - (fundamentalNode: Instance),
1575 - );
1576 - }
1530 } else if (
1531 enableSuspenseServerRenderer &&
1532 node.tag === DehydratedFragment
@@ -1849,14 +1802,6 @@ function commitWork(current: Fiber | null, finishedWork: Fiber): void {
1802 case IncompleteClassComponent: {
1803 return;
1804 }
1852 - case FundamentalComponent: {
1853 - if (enableFundamentalAPI) {
1854 - const fundamentalInstance = finishedWork.stateNode;
1855 - updateFundamentalComponent(fundamentalInstance);
1856 - return;
1857 - }
1858 - break;
1859 - }
1805 case ScopeComponent: {
1806 if (enableScopeAPI) {
1807 const scopeInstance = finishedWork.stateNode;
packages/react-reconciler/src/ReactFiberCompleteWork.new.js
+1 -85
@@ -9,11 +9,7 @@
9
10 import type {Fiber} from './ReactInternalTypes';
11 import type {Lanes, Lane} from './ReactFiberLane.new';
12 -import type {
13 - ReactFundamentalComponentInstance,
14 - ReactScopeInstance,
15 - ReactContext,
16 -} from 'shared/ReactTypes';
12 +import type {ReactScopeInstance, ReactContext} from 'shared/ReactTypes';
13 import type {FiberRoot} from './ReactInternalTypes';
14 import type {
15 Instance,
@@ -54,7 +50,6 @@ import {
50 SimpleMemoComponent,
51 LazyComponent,
52 IncompleteClassComponent,
57 - FundamentalComponent,
53 ScopeComponent,
54 OffscreenComponent,
55 LegacyHiddenComponent,
@@ -92,10 +87,6 @@ import {
87 createContainerChildSet,
88 appendChildToContainerChildSet,
89 finalizeContainerChildren,
95 - getFundamentalComponentInstance,
96 - mountFundamentalComponent,
97 - cloneFundamentalInstance,
98 - shouldUpdateFundamentalComponent,
90 preparePortalMount,
91 prepareScopeUpdate,
92 } from './ReactFiberHostConfig';
@@ -134,7 +125,6 @@ import {
125 enableSchedulerTracing,
126 enableSuspenseCallback,
127 enableSuspenseServerRenderer,
137 - enableFundamentalAPI,
128 enableScopeAPI,
129 enableProfilerTimer,
130 enableCache,
@@ -148,7 +138,6 @@ import {
138 getRenderTargetTime,
139 subtreeRenderLanes,
140 } from './ReactFiberWorkLoop.new';
151 -import {createFundamentalStateInstance} from './ReactFiberFundamental.new';
141 import {
142 OffscreenLane,
143 SomeRetryLane,
@@ -219,8 +208,6 @@ if (supportsMutation) {
208 while (node !== null) {
209 if (node.tag === HostComponent || node.tag === HostText) {
210 appendInitialChild(parent, node.stateNode);
222 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
223 - appendInitialChild(parent, node.stateNode.instance);
211 } else if (node.tag === HostPortal) {
212 // If we have a portal child, then we don't want to traverse
213 // down its children. Instead, we'll get insertions from each child in
@@ -330,15 +317,6 @@ if (supportsMutation) {
317 instance = cloneHiddenTextInstance(instance, text, node);
318 }
319 appendInitialChild(parent, instance);
333 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
334 - let instance = node.stateNode.instance;
335 - if (needsVisibilityToggle && isHidden) {
336 - // This child is inside a timed out tree. Hide it.
337 - const props = node.memoizedProps;
338 - const type = node.type;
339 - instance = cloneHiddenInstance(instance, type, props, node);
340 - }
341 - appendInitialChild(parent, instance);
320 } else if (node.tag === HostPortal) {
321 // If we have a portal child, then we don't want to traverse
322 // down its children. Instead, we'll get insertions from each child in
@@ -424,15 +402,6 @@ if (supportsMutation) {
402 instance = cloneHiddenTextInstance(instance, text, node);
403 }
404 appendChildToContainerChildSet(containerChildSet, instance);
427 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
428 - let instance = node.stateNode.instance;
429 - if (needsVisibilityToggle && isHidden) {
430 - // This child is inside a timed out tree. Hide it.
431 - const props = node.memoizedProps;
432 - const type = node.type;
433 - instance = cloneHiddenInstance(instance, type, props, node);
434 - }
435 - appendChildToContainerChildSet(containerChildSet, instance);
405 } else if (node.tag === HostPortal) {
406 // If we have a portal child, then we don't want to traverse
407 // down its children. Instead, we'll get insertions from each child in
@@ -1406,59 +1375,6 @@ function completeWork(
1375 bubbleProperties(workInProgress);
1376 return null;
1377 }
1409 - case FundamentalComponent: {
1410 - if (enableFundamentalAPI) {
1411 - const fundamentalImpl = workInProgress.type.impl;
1412 - let fundamentalInstance: ReactFundamentalComponentInstance<
1413 - any,
1414 - any,
1415 - > | null = workInProgress.stateNode;
1416 -
1417 - if (fundamentalInstance === null) {
1418 - const getInitialState = fundamentalImpl.getInitialState;
1419 - let fundamentalState;
1420 - if (getInitialState !== undefined) {
1421 - fundamentalState = getInitialState(newProps);
1422 - }
1423 - fundamentalInstance = workInProgress.stateNode = createFundamentalStateInstance(
1424 - workInProgress,
1425 - newProps,
1426 - fundamentalImpl,
1427 - fundamentalState || {},
1428 - );
1429 - const instance = ((getFundamentalComponentInstance(
1430 - fundamentalInstance,
1431 - ): any): Instance);
1432 - fundamentalInstance.instance = instance;
1433 - if (fundamentalImpl.reconcileChildren === false) {
1434 - bubbleProperties(workInProgress);
1435 - return null;
1436 - }
1437 - appendAllChildren(instance, workInProgress, false, false);
1438 - mountFundamentalComponent(fundamentalInstance);
1439 - } else {
1440 - // We fire update in commit phase
1441 - const prevProps = fundamentalInstance.props;
1442 - fundamentalInstance.prevProps = prevProps;
1443 - fundamentalInstance.props = newProps;
1444 - fundamentalInstance.currentFiber = workInProgress;
1445 - if (supportsPersistence) {
1446 - const instance = cloneFundamentalInstance(fundamentalInstance);
1447 - fundamentalInstance.instance = instance;
1448 - appendAllChildren(instance, workInProgress, false, false);
1449 - }
1450 - const shouldUpdate = shouldUpdateFundamentalComponent(
1451 - fundamentalInstance,
1452 - );
1453 - if (shouldUpdate) {
1454 - markUpdate(workInProgress);
1455 - }
1456 - }
1457 - bubbleProperties(workInProgress);
1458 - return null;
1459 - }
1460 - break;
1461 - }
1378 case ScopeComponent: {
1379 if (enableScopeAPI) {
1380 if (current === null) {
packages/react-reconciler/src/ReactFiberCompleteWork.old.js
+1 -85
@@ -9,11 +9,7 @@
9
10 import type {Fiber} from './ReactInternalTypes';
11 import type {Lanes, Lane} from './ReactFiberLane.old';
12 -import type {
13 - ReactFundamentalComponentInstance,
14 - ReactScopeInstance,
15 - ReactContext,
16 -} from 'shared/ReactTypes';
12 +import type {ReactScopeInstance, ReactContext} from 'shared/ReactTypes';
13 import type {FiberRoot} from './ReactInternalTypes';
14 import type {
15 Instance,
@@ -54,7 +50,6 @@ import {
50 SimpleMemoComponent,
51 LazyComponent,
52 IncompleteClassComponent,
57 - FundamentalComponent,
53 ScopeComponent,
54 OffscreenComponent,
55 LegacyHiddenComponent,
@@ -92,10 +87,6 @@ import {
87 createContainerChildSet,
88 appendChildToContainerChildSet,
89 finalizeContainerChildren,
95 - getFundamentalComponentInstance,
96 - mountFundamentalComponent,
97 - cloneFundamentalInstance,
98 - shouldUpdateFundamentalComponent,
90 preparePortalMount,
91 prepareScopeUpdate,
92 } from './ReactFiberHostConfig';
@@ -134,7 +125,6 @@ import {
125 enableSchedulerTracing,
126 enableSuspenseCallback,
127 enableSuspenseServerRenderer,
137 - enableFundamentalAPI,
128 enableScopeAPI,
129 enableProfilerTimer,
130 enableCache,
@@ -148,7 +138,6 @@ import {
138 getRenderTargetTime,
139 subtreeRenderLanes,
140 } from './ReactFiberWorkLoop.old';
151 -import {createFundamentalStateInstance} from './ReactFiberFundamental.old';
141 import {
142 OffscreenLane,
143 SomeRetryLane,
@@ -219,8 +208,6 @@ if (supportsMutation) {
208 while (node !== null) {
209 if (node.tag === HostComponent || node.tag === HostText) {
210 appendInitialChild(parent, node.stateNode);
222 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
223 - appendInitialChild(parent, node.stateNode.instance);
211 } else if (node.tag === HostPortal) {
212 // If we have a portal child, then we don't want to traverse
213 // down its children. Instead, we'll get insertions from each child in
@@ -330,15 +317,6 @@ if (supportsMutation) {
317 instance = cloneHiddenTextInstance(instance, text, node);
318 }
319 appendInitialChild(parent, instance);
333 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
334 - let instance = node.stateNode.instance;
335 - if (needsVisibilityToggle && isHidden) {
336 - // This child is inside a timed out tree. Hide it.
337 - const props = node.memoizedProps;
338 - const type = node.type;
339 - instance = cloneHiddenInstance(instance, type, props, node);
340 - }
341 - appendInitialChild(parent, instance);
320 } else if (node.tag === HostPortal) {
321 // If we have a portal child, then we don't want to traverse
322 // down its children. Instead, we'll get insertions from each child in
@@ -424,15 +402,6 @@ if (supportsMutation) {
402 instance = cloneHiddenTextInstance(instance, text, node);
403 }
404 appendChildToContainerChildSet(containerChildSet, instance);
427 - } else if (enableFundamentalAPI && node.tag === FundamentalComponent) {
428 - let instance = node.stateNode.instance;
429 - if (needsVisibilityToggle && isHidden) {
430 - // This child is inside a timed out tree. Hide it.
431 - const props = node.memoizedProps;
432 - const type = node.type;
433 - instance = cloneHiddenInstance(instance, type, props, node);
434 - }
435 - appendChildToContainerChildSet(containerChildSet, instance);
405 } else if (node.tag === HostPortal) {
406 // If we have a portal child, then we don't want to traverse
407 // down its children. Instead, we'll get insertions from each child in
@@ -1406,59 +1375,6 @@ function completeWork(
1375 bubbleProperties(workInProgress);
1376 return null;
1377 }
1409 - case FundamentalComponent: {
1410 - if (enableFundamentalAPI) {
1411 - const fundamentalImpl = workInProgress.type.impl;
1412 - let fundamentalInstance: ReactFundamentalComponentInstance<
1413 - any,
1414 - any,
1415 - > | null = workInProgress.stateNode;
1416 -
1417 - if (fundamentalInstance === null) {
1418 - const getInitialState = fundamentalImpl.getInitialState;
1419 - let fundamentalState;
1420 - if (getInitialState !== undefined) {
1421 - fundamentalState = getInitialState(newProps);
1422 - }
1423 - fundamentalInstance = workInProgress.stateNode = createFundamentalStateInstance(
1424 - workInProgress,
1425 - newProps,
1426 - fundamentalImpl,
1427 - fundamentalState || {},
1428 - );
1429 - const instance = ((getFundamentalComponentInstance(
1430 - fundamentalInstance,
1431 - ): any): Instance);
1432 - fundamentalInstance.instance = instance;
1433 - if (fundamentalImpl.reconcileChildren === false) {
1434 - bubbleProperties(workInProgress);
1435 - return null;
1436 - }
1437 - appendAllChildren(instance, workInProgress, false, false);
1438 - mountFundamentalComponent(fundamentalInstance);
1439 - } else {
1440 - // We fire update in commit phase
1441 - const prevProps = fundamentalInstance.props;
1442 - fundamentalInstance.prevProps = prevProps;
1443 - fundamentalInstance.props = newProps;
1444 - fundamentalInstance.currentFiber = workInProgress;
1445 - if (supportsPersistence) {
1446 - const instance = cloneFundamentalInstance(fundamentalInstance);
1447 - fundamentalInstance.instance = instance;
1448 - appendAllChildren(instance, workInProgress, false, false);
1449 - }
1450 - const shouldUpdate = shouldUpdateFundamentalComponent(
1451 - fundamentalInstance,
1452 - );
1453 - if (shouldUpdate) {
1454 - markUpdate(workInProgress);
1455 - }
1456 - }
1457 - bubbleProperties(workInProgress);
1458 - return null;
1459 - }
1460 - break;
1461 - }
1378 case ScopeComponent: {
1379 if (enableScopeAPI) {
1380 if (current === null) {
packages/react-reconciler/src/ReactFiberFundamental.new.js deleted
-30
@@ -1,30 +0,0 @@
1 -/**
2 - * Copyright (c) Facebook, Inc. and its affiliates.
3 - *
4 - * This source code is licensed under the MIT license found in the
5 - * LICENSE file in the root directory of this source tree.
6 - *
7 - * @flow
8 - */
9 -
10 -import type {Fiber} from './ReactInternalTypes';
11 -import type {
12 - ReactFundamentalImpl,
13 - ReactFundamentalComponentInstance,
14 -} from 'shared/ReactTypes';
15 -
16 -export function createFundamentalStateInstance<C, H>(
17 - currentFiber: Fiber,
18 - props: Object,
19 - impl: ReactFundamentalImpl<C, H>,
20 - state: Object,
21 -): ReactFundamentalComponentInstance<C, H> {
22 - return {
23 - currentFiber,
24 - impl,
25 - instance: null,
26 - prevProps: null,
27 - props,
28 - state,
29 - };
30 -}
packages/react-reconciler/src/ReactFiberFundamental.old.js deleted
-30
@@ -1,30 +0,0 @@
1 -/**
2 - * Copyright (c) Facebook, Inc. and its affiliates.
3 - *
4 - * This source code is licensed under the MIT license found in the
5 - * LICENSE file in the root directory of this source tree.
6 - *
7 - * @flow
8 - */
9 -
10 -import type {Fiber} from './ReactInternalTypes';
11 -import type {
12 - ReactFundamentalImpl,
13 - ReactFundamentalComponentInstance,
14 -} from 'shared/ReactTypes';
15 -
16 -export function createFundamentalStateInstance<C, H>(
17 - currentFiber: Fiber,
18 - props: Object,
19 - impl: ReactFundamentalImpl<C, H>,
20 - state: Object,
21 -): ReactFundamentalComponentInstance<C, H> {
22 - return {
23 - currentFiber,
24 - impl,
25 - instance: null,
26 - prevProps: null,
27 - props,
28 - state,
29 - };
30 -}
packages/react-reconciler/src/ReactFiberHostConfigWithNoPersistence.js
-1
@@ -24,7 +24,6 @@ function shim(...args: any) {
24 // Persistence (when unsupported)
25 export const supportsPersistence = false;
26 export const cloneInstance = shim;
27 -export const cloneFundamentalInstance = shim;
27 export const createContainerChildSet = shim;
28 export const appendChildToContainerChildSet = shim;
29 export const finalizeContainerChildren = shim;
packages/react-reconciler/src/ReactFiberReconciler.new.js
-4
@@ -17,7 +17,6 @@ import type {
17 PublicInstance,
18 } from './ReactFiberHostConfig';
19 import type {RendererInspectionConfig} from './ReactFiberHostConfig';
20 -import {FundamentalComponent} from './ReactWorkTags';
20 import type {ReactNodeList} from 'shared/ReactTypes';
21 import type {Lane, LanePriority} from './ReactFiberLane.new';
22 import type {SuspenseState} from './ReactFiberSuspenseComponent.new';
@@ -460,9 +459,6 @@ export function findHostInstanceWithNoPortals(
459 if (hostFiber === null) {
460 return null;
461 }
463 - if (hostFiber.tag === FundamentalComponent) {
464 - return hostFiber.stateNode.instance;
465 - }
462 return hostFiber.stateNode;
463 }
464
packages/react-reconciler/src/ReactFiberReconciler.old.js
-4
@@ -17,7 +17,6 @@ import type {
17 PublicInstance,
18 } from './ReactFiberHostConfig';
19 import type {RendererInspectionConfig} from './ReactFiberHostConfig';
20 -import {FundamentalComponent} from './ReactWorkTags';
20 import type {ReactNodeList} from 'shared/ReactTypes';
21 import type {Lane, LanePriority} from './ReactFiberLane.old';
22 import type {SuspenseState} from './ReactFiberSuspenseComponent.old';
@@ -460,9 +459,6 @@ export function findHostInstanceWithNoPortals(
459 if (hostFiber === null) {
460 return null;
461 }
463 - if (hostFiber.tag === FundamentalComponent) {
464 - return hostFiber.stateNode.instance;
465 - }
462 return hostFiber.stateNode;
463 }
464
packages/react-reconciler/src/ReactFiberTreeReflection.js
+1 -7
@@ -22,11 +22,9 @@ import {
22 HostRoot,
23 HostPortal,
24 HostText,
25 - FundamentalComponent,
25 SuspenseComponent,
26 } from './ReactWorkTags';
27 import {NoFlags, Placement, Hydrating} from './ReactFiberFlags';
29 -import {enableFundamentalAPI} from 'shared/ReactFeatureFlags';
28
29 const ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
30
@@ -297,11 +295,7 @@ export function findCurrentHostFiberWithNoPortals(parent: Fiber): Fiber | null {
295
296 function findCurrentHostFiberWithNoPortalsImpl(node: Fiber) {
297 // Next we'll drill down this component to find the first HostComponent/Text.
300 - if (
301 - node.tag === HostComponent ||
302 - node.tag === HostText ||
303 - (enableFundamentalAPI && node.tag === FundamentalComponent)
304 - ) {
298 + if (node.tag === HostComponent || node.tag === HostText) {
299 return node;
300 }
301
packages/react-reconciler/src/ReactWorkTags.js
-1
@@ -54,7 +54,6 @@ export const LazyComponent = 16;
54 export const IncompleteClassComponent = 17;
55 export const DehydratedFragment = 18;
56 export const SuspenseListComponent = 19;
57 -export const FundamentalComponent = 20;
57 export const ScopeComponent = 21;
58 export const OffscreenComponent = 22;
59 export const LegacyHiddenComponent = 23;
packages/react-reconciler/src/__tests__/ReactFiberFundamental-test.internal.js deleted
-231
@@ -1,231 +0,0 @@
1 -/**
2 - * Copyright (c) Facebook, Inc. and its affiliates.
3 - *
4 - * This source code is licensed under the MIT license found in the
5 - * LICENSE file in the root directory of this source tree.
6 - *
7 - * @emails react-core
8 - */
9 -
10 -'use strict';
11 -
12 -let React;
13 -let ReactNoop;
14 -let Scheduler;
15 -let ReactFeatureFlags;
16 -let ReactTestRenderer;
17 -let ReactDOM;
18 -let ReactDOMServer;
19 -
20 -function createReactFundamentalComponent(fundamentalImpl) {
21 - return React.unstable_createFundamental(fundamentalImpl);
22 -}
23 -
24 -function init() {
25 - jest.resetModules();
26 - ReactFeatureFlags = require('shared/ReactFeatureFlags');
27 - ReactFeatureFlags.enableFundamentalAPI = true;
28 - React = require('react');
29 - Scheduler = require('scheduler');
30 -}
31 -
32 -function initNoopRenderer() {
33 - init();
34 - ReactNoop = require('react-noop-renderer');
35 -}
36 -
37 -function initTestRenderer() {
38 - init();
39 - ReactTestRenderer = require('react-test-renderer');
40 -}
41 -
42 -function initReactDOM() {
43 - init();
44 - ReactDOM = require('react-dom');
45 -}
46 -
47 -function initReactDOMServer() {
48 - init();
49 - ReactDOMServer = require('react-dom/server');
50 -}
51 -
52 -describe('ReactFiberFundamental', () => {
53 - describe('NoopRenderer', () => {
54 - beforeEach(() => {
55 - initNoopRenderer();
56 - });
57 -
58 - // @gate experimental
59 - it('should render a simple fundamental component with a single child', () => {
60 - const FundamentalComponent = createReactFundamentalComponent({
61 - reconcileChildren: true,
62 - getInstance(context, props, state) {
63 - const instance = {
64 - children: [],
65 - text: null,
66 - type: 'test',
67 - };
68 - return instance;
69 - },
70 - });
71 -
72 - const Test = ({children}) => (
73 - <FundamentalComponent>{children}</FundamentalComponent>
74 - );
75 -
76 - ReactNoop.render(<Test>Hello world</Test>);
77 - expect(Scheduler).toFlushWithoutYielding();
78 - expect(ReactNoop).toMatchRenderedOutput(<test>Hello world</test>);
79 - ReactNoop.render(<Test>Hello world again</Test>);
80 - expect(Scheduler).toFlushWithoutYielding();
81 - expect(ReactNoop).toMatchRenderedOutput(<test>Hello world again</test>);
82 - ReactNoop.render(null);
83 - expect(Scheduler).toFlushWithoutYielding();
84 - expect(ReactNoop).toMatchRenderedOutput(null);
85 - });
86 - });
87 -
88 - describe('NoopTestRenderer', () => {
89 - beforeEach(() => {
90 - initTestRenderer();
91 - });
92 -
93 - // @gate experimental
94 - it('should render a simple fundamental component with a single child', () => {
95 - const FundamentalComponent = createReactFundamentalComponent({
96 - reconcileChildren: true,
97 - getInstance(context, props, state) {
98 - const instance = {
99 - children: [],
100 - props,
101 - type: 'test',
102 - tag: 'INSTANCE',
103 - };
104 - return instance;
105 - },
106 - });
107 -
108 - const Test = ({children}) => (
109 - <FundamentalComponent>{children}</FundamentalComponent>
110 - );
111 -
112 - const root = ReactTestRenderer.create(null);
113 - root.update(<Test>Hello world</Test>);
114 - expect(Scheduler).toFlushWithoutYielding();
115 - expect(root).toMatchRenderedOutput(<test>Hello world</test>);
116 - root.update(<Test>Hello world again</Test>);
117 - expect(Scheduler).toFlushWithoutYielding();
118 - expect(root).toMatchRenderedOutput(<test>Hello world again</test>);
119 - root.update(null);
120 - expect(Scheduler).toFlushWithoutYielding();
121 - expect(root).toMatchRenderedOutput(null);
122 - });
123 - });
124 -
125 - describe('ReactDOM', () => {
126 - beforeEach(() => {
127 - initReactDOM();
128 - });
129 -
130 - // @gate experimental
131 - it('should render a simple fundamental component with a single child', () => {
132 - const FundamentalComponent = createReactFundamentalComponent({
133 - reconcileChildren: true,
134 - getInstance(context, props, state) {
135 - const instance = document.createElement('div');
136 - return instance;
137 - },
138 - });
139 -
140 - const Test = ({children}) => (
141 - <FundamentalComponent>{children}</FundamentalComponent>
142 - );
143 -
144 - const container = document.createElement('div');
145 - ReactDOM.render(<Test>Hello world</Test>, container);
146 - expect(Scheduler).toFlushWithoutYielding();
147 - expect(container.innerHTML).toBe('<div>Hello world</div>');
148 - ReactDOM.render(<Test>Hello world again</Test>, container);
149 - expect(Scheduler).toFlushWithoutYielding();
150 - expect(container.innerHTML).toBe('<div>Hello world again</div>');
151 - ReactDOM.render(null, container);
152 - expect(Scheduler).toFlushWithoutYielding();
153 - expect(container.innerHTML).toBe('');
154 - });
155 -
156 - // @gate experimental
157 - it('should render a simple fundamental component without reconcileChildren', () => {
158 - const FundamentalComponent = createReactFundamentalComponent({
159 - reconcileChildren: false,
160 - getInstance(context, props, state) {
161 - const instance = document.createElement('div');
162 - instance.textContent = 'Hello world';
163 - return instance;
164 - },
165 - });
166 -
167 - const Test = () => <FundamentalComponent />;
168 -
169 - const container = document.createElement('div');
170 - ReactDOM.render(<Test />, container);
171 - expect(Scheduler).toFlushWithoutYielding();
172 - expect(container.innerHTML).toBe('<div>Hello world</div>');
173 - // Children should be ignored
174 - ReactDOM.render(<Test>Hello world again</Test>, container);
175 - expect(Scheduler).toFlushWithoutYielding();
176 - expect(container.innerHTML).toBe('<div>Hello world</div>');
177 - ReactDOM.render(null, container);
178 - expect(Scheduler).toFlushWithoutYielding();
179 - expect(container.innerHTML).toBe('');
180 - });
181 - });
182 -
183 - describe('ReactDOMServer', () => {
184 - beforeEach(() => {
185 - initReactDOMServer();
186 - });
187 -
188 - // @gate experimental
189 - it('should render a simple fundamental component with a single child', () => {
190 - const getInstance = jest.fn();
191 - const FundamentalComponent = createReactFundamentalComponent({
192 - reconcileChildren: true,
193 - getInstance,
194 - getServerSideString(context, props) {
195 - return `<div>`;
196 - },
197 - getServerSideStringClose(context, props) {
198 - return `</div>`;
199 - },
200 - });
201 -
202 - const Test = ({children}) => (
203 - <FundamentalComponent>{children}</FundamentalComponent>
204 - );
205 -
206 - expect(getInstance).not.toBeCalled();
207 - let output = ReactDOMServer.renderToString(<Test>Hello world</Test>);
208 - expect(output).toBe('<div>Hello world</div>');
209 - output = ReactDOMServer.renderToString(<Test>Hello world again</Test>);
210 - expect(output).toBe('<div>Hello world again</div>');
211 - });
212 -
213 - // @gate experimental
214 - it('should render a simple fundamental component without reconcileChildren', () => {
215 - const FundamentalComponent = createReactFundamentalComponent({
216 - reconcileChildren: false,
217 - getServerSideString(context, props) {
218 - return `<div>Hello world</div>`;
219 - },
220 - });
221 -
222 - const Test = () => <FundamentalComponent />;
223 -
224 - let output = ReactDOMServer.renderToString(<Test />);
225 - expect(output).toBe('<div>Hello world</div>');
226 - // Children should be ignored
227 - output = ReactDOMServer.renderToString(<Test>Hello world again</Test>);
228 - expect(output).toBe('<div>Hello world</div>');
229 - });
230 - });
231 -});
packages/react-reconciler/src/forks/ReactFiberHostConfig.custom.js
-11
@@ -62,12 +62,6 @@ export const warnsIfNotActing = $$$hostConfig.warnsIfNotActing;
62 export const supportsMutation = $$$hostConfig.supportsMutation;
63 export const supportsPersistence = $$$hostConfig.supportsPersistence;
64 export const supportsHydration = $$$hostConfig.supportsHydration;
65 -export const getFundamentalComponentInstance =
66 - $$$hostConfig.getFundamentalComponentInstance;
67 -export const mountFundamentalComponent =
68 - $$$hostConfig.mountFundamentalComponent;
69 -export const shouldUpdateFundamentalComponent =
70 - $$$hostConfig.shouldUpdateFundamentalComponent;
65 export const getInstanceFromNode = $$$hostConfig.getInstanceFromNode;
66 export const isOpaqueHydratingObject = $$$hostConfig.isOpaqueHydratingObject;
67 export const makeOpaqueHydratingObject =
@@ -112,10 +106,6 @@ export const hideInstance = $$$hostConfig.hideInstance;
106 export const hideTextInstance = $$$hostConfig.hideTextInstance;
107 export const unhideInstance = $$$hostConfig.unhideInstance;
108 export const unhideTextInstance = $$$hostConfig.unhideTextInstance;
115 -export const updateFundamentalComponent =
116 - $$$hostConfig.updateFundamentalComponent;
117 -export const unmountFundamentalComponent =
118 - $$$hostConfig.unmountFundamentalComponent;
109 export const clearContainer = $$$hostConfig.clearContainer;
110
111 // -------------------
@@ -131,7 +121,6 @@ export const finalizeContainerChildren =
121 export const replaceContainerChildren = $$$hostConfig.replaceContainerChildren;
122 export const cloneHiddenInstance = $$$hostConfig.cloneHiddenInstance;
123 export const cloneHiddenTextInstance = $$$hostConfig.cloneHiddenTextInstance;
134 -export const cloneFundamentalInstance = $$$hostConfig.cloneInstance;
124
125 // -------------------
126 // Hydration
packages/react-test-renderer/src/ReactTestHostConfig.js
-50
@@ -7,8 +7,6 @@
7 * @flow
8 */
9
10 -import type {ReactFundamentalComponentInstance} from 'shared/ReactTypes';
11 -
10 import {REACT_OPAQUE_ID_TYPE} from 'shared/ReactSymbols';
11
12 export type Type = string;
@@ -299,54 +297,6 @@ export function unhideTextInstance(
297 textInstance.isHidden = false;
298 }
299
302 -export function getFundamentalComponentInstance(
303 - fundamentalInstance: ReactFundamentalComponentInstance<any, any>,
304 -): Instance {
305 - const {impl, props, state} = fundamentalInstance;
306 - return impl.getInstance(null, props, state);
307 -}
308 -
309 -export function mountFundamentalComponent(
310 - fundamentalInstance: ReactFundamentalComponentInstance<any, any>,
311 -): void {
312 - const {impl, instance, props, state} = fundamentalInstance;
313 - const onMount = impl.onMount;
314 - if (onMount !== undefined) {
315 - onMount(null, instance, props, state);
316 - }
317 -}
318 -
319 -export function shouldUpdateFundamentalComponent(
320 - fundamentalInstance: ReactFundamentalComponentInstance<any, any>,
321 -): boolean {
322 - const {impl, prevProps, props, state} = fundamentalInstance;
323 - const shouldUpdate = impl.shouldUpdate;
324 - if (shouldUpdate !== undefined) {
325 - return shouldUpdate(null, prevProps, props, state);
326 - }
327 - return true;
328 -}
329 -
330 -export function updateFundamentalComponent(
331 - fundamentalInstance: ReactFundamentalComponentInstance<any, any>,
332 -): void {
333 - const {impl, instance, prevProps, props, state} = fundamentalInstance;
334 - const onUpdate = impl.onUpdate;
335 - if (onUpdate !== undefined) {
336 - onUpdate(null, instance, prevProps, props, state);
337 - }
338 -}
339 -
340 -export function unmountFundamentalComponent(
341 - fundamentalInstance: ReactFundamentalComponentInstance<any, any>,
342 -): void {
343 - const {impl, instance, props, state} = fundamentalInstance;
344 - const onUnmount = impl.onUnmount;
345 - if (onUnmount !== undefined) {
346 - onUnmount(null, instance, props, state);
347 - }
348 -}
349 -
300 export function getInstanceFromNode(mockNode: Object) {
301 const instance = nodeToInstanceMap.get(mockNode);
302 if (instance !== undefined) {
packages/react/index.js
-1
@@ -79,7 +79,6 @@ export {
79 SuspenseList,
80 SuspenseList as unstable_SuspenseList,
81 unstable_LegacyHidden,
82 - unstable_createFundamental,
82 unstable_Scope,
83 unstable_useOpaqueIdentifier,
84 unstable_getCacheForType,
packages/react/src/React.js
-3
@@ -58,7 +58,6 @@ import {
58 } from './ReactElementValidator';
59 import {createMutableSource} from './ReactMutableSource';
60 import ReactSharedInternals from './ReactSharedInternals';
61 -import {createFundamental} from './ReactFundamental';
61 import {startTransition} from './ReactStartTransition';
62
63 // TODO: Move this branching into the other module instead and just re-export.
@@ -116,8 +115,6 @@ export {
115 getCacheForType as unstable_getCacheForType,
116 useCacheRefresh as unstable_useCacheRefresh,
117 REACT_CACHE_TYPE as unstable_Cache,
119 - // enableFundamentalAPI
120 - createFundamental as unstable_createFundamental,
118 // enableScopeAPI
119 REACT_SCOPE_TYPE as unstable_Scope,
120 useOpaqueIdentifier as unstable_useOpaqueIdentifier,
packages/react/src/ReactFundamental.js deleted
-33
@@ -1,33 +0,0 @@
1 -/**
2 - * Copyright (c) Facebook, Inc. and its affiliates.
3 - *
4 - * This source code is licensed under the MIT license found in the
5 - * LICENSE file in the root directory of this source tree.
6 - * @flow
7 - */
8 -
9 -import type {
10 - ReactFundamentalImpl,
11 - ReactFundamentalComponent,
12 -} from 'shared/ReactTypes';
13 -import {REACT_FUNDAMENTAL_TYPE} from 'shared/ReactSymbols';
14 -import {hasBadMapPolyfill} from './BadMapPolyfill';
15 -
16 -export function createFundamental<C, H>(
17 - impl: ReactFundamentalImpl<C, H>,
18 -): ReactFundamentalComponent<C, H> {
19 - // We use responder as a Map key later on. When we have a bad
20 - // polyfill, then we can't use it as a key as the polyfill tries
21 - // to add a property to the object.
22 - if (__DEV__ && !hasBadMapPolyfill) {
23 - Object.freeze(impl);
24 - }
25 - const fundamentalComponent = {
26 - $$typeof: REACT_FUNDAMENTAL_TYPE,
27 - impl,
28 - };
29 - if (__DEV__) {
30 - Object.freeze(fundamentalComponent);
31 - }
32 - return fundamentalComponent;
33 -}
packages/shared/ReactFeatureFlags.js
-3
@@ -60,9 +60,6 @@ export const enableSchedulerDebugging = false;
60 // Disable javascript: URL strings in href for XSS protection.
61 export const disableJavaScriptURLs = false;
62
63 -// Experimental Host Component support.
64 -export const enableFundamentalAPI = false;
65 -
63 // Experimental Scope support.
64 export const enableScopeAPI = false;
65
packages/shared/ReactSymbols.js
-2
@@ -25,7 +25,6 @@ export let REACT_SUSPENSE_TYPE = 0xead1;
25 export let REACT_SUSPENSE_LIST_TYPE = 0xead8;
26 export let REACT_MEMO_TYPE = 0xead3;
27 export let REACT_LAZY_TYPE = 0xead4;
28 -export let REACT_FUNDAMENTAL_TYPE = 0xead5;
28 export let REACT_SCOPE_TYPE = 0xead7;
29 export let REACT_OPAQUE_ID_TYPE = 0xeae0;
30 export let REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
@@ -47,7 +46,6 @@ if (typeof Symbol === 'function' && Symbol.for) {
46 REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
47 REACT_MEMO_TYPE = symbolFor('react.memo');
48 REACT_LAZY_TYPE = symbolFor('react.lazy');
50 - REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
49 REACT_SCOPE_TYPE = symbolFor('react.scope');
50 REACT_OPAQUE_ID_TYPE = symbolFor('react.opaque.id');
51 REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
packages/shared/ReactTypes.js
-46
@@ -92,52 +92,6 @@ export const DiscreteEvent: EventPriority = 0;
92 export const UserBlockingEvent: EventPriority = 1;
93 export const ContinuousEvent: EventPriority = 2;
94
95 -export type ReactFundamentalComponentInstance<C, H> = {|
96 - currentFiber: Object,
97 - instance: mixed,
98 - prevProps: null | Object,
99 - props: Object,
100 - impl: ReactFundamentalImpl<C, H>,
101 - state: Object,
102 -|};
103 -
104 -export type ReactFundamentalImpl<C, H> = {
105 - displayName: string,
106 - reconcileChildren: boolean,
107 - getInitialState?: (props: Object) => Object,
108 - getInstance: (context: C, props: Object, state: Object) => H,
109 - getServerSideString?: (context: C, props: Object) => string,
110 - getServerSideStringClose?: (context: C, props: Object) => string,
111 - onMount: (context: C, instance: mixed, props: Object, state: Object) => void,
112 - shouldUpdate?: (
113 - context: C,
114 - prevProps: null | Object,
115 - nextProps: Object,
116 - state: Object,
117 - ) => boolean,
118 - onUpdate?: (
119 - context: C,
120 - instance: mixed,
121 - prevProps: null | Object,
122 - nextProps: Object,
123 - state: Object,
124 - ) => void,
125 - onUnmount?: (
126 - context: C,
127 - instance: mixed,
128 - props: Object,
129 - state: Object,
130 - ) => void,
131 - onHydrate?: (context: C, props: Object, state: Object) => boolean,
132 - onFocus?: (context: C, props: Object, state: Object) => boolean,
133 - ...
134 -};
135 -
136 -export type ReactFundamentalComponent<C, H> = {|
137 - $$typeof: Symbol | number,
138 - impl: ReactFundamentalImpl<C, H>,
139 -|};
140 -
95 export type ReactScope = {|
96 $$typeof: Symbol | number,
97 |};
packages/shared/forks/ReactFeatureFlags.native-fb.js
-1
@@ -28,7 +28,6 @@ export const disableJavaScriptURLs = false;
28 export const disableInputAttributeSyncing = false;
29 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
30 export const warnAboutDeprecatedLifecycles = true;
31 -export const enableFundamentalAPI = false;
31 export const enableScopeAPI = false;
32 export const enableCreateEventHandleAPI = false;
33 export const warnAboutUnmockedScheduler = true;
packages/shared/forks/ReactFeatureFlags.native-oss.js
-1
@@ -27,7 +27,6 @@ export const enableCache = false;
27 export const disableJavaScriptURLs = false;
28 export const disableInputAttributeSyncing = false;
29 export const enableSchedulerDebugging = false;
30 -export const enableFundamentalAPI = false;
30 export const enableScopeAPI = false;
31 export const enableCreateEventHandleAPI = false;
32 export const warnAboutUnmockedScheduler = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.js
-1
@@ -27,7 +27,6 @@ export const enableCache = __EXPERIMENTAL__;
27 export const disableJavaScriptURLs = false;
28 export const disableInputAttributeSyncing = false;
29 export const enableSchedulerDebugging = false;
30 -export const enableFundamentalAPI = false;
30 export const enableScopeAPI = false;
31 export const enableCreateEventHandleAPI = false;
32 export const warnAboutUnmockedScheduler = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
-1
@@ -27,7 +27,6 @@ export const enableCache = false;
27 export const disableJavaScriptURLs = false;
28 export const disableInputAttributeSyncing = false;
29 export const enableSchedulerDebugging = false;
30 -export const enableFundamentalAPI = false;
30 export const enableScopeAPI = false;
31 export const enableCreateEventHandleAPI = false;
32 export const warnAboutUnmockedScheduler = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
-1
@@ -27,7 +27,6 @@ export const enableCache = false;
27 export const enableSchedulerDebugging = false;
28 export const disableJavaScriptURLs = false;
29 export const disableInputAttributeSyncing = false;
30 -export const enableFundamentalAPI = false;
30 export const enableScopeAPI = true;
31 export const enableCreateEventHandleAPI = false;
32 export const warnAboutUnmockedScheduler = true;
packages/shared/forks/ReactFeatureFlags.testing.js
-1
@@ -27,7 +27,6 @@ export const enableCache = false;
27 export const disableJavaScriptURLs = false;
28 export const disableInputAttributeSyncing = false;
29 export const enableSchedulerDebugging = false;
30 -export const enableFundamentalAPI = false;
30 export const enableScopeAPI = false;
31 export const enableCreateEventHandleAPI = false;
32 export const warnAboutUnmockedScheduler = false;
packages/shared/forks/ReactFeatureFlags.testing.www.js
-1
@@ -27,7 +27,6 @@ export const enableCache = false;
27 export const disableJavaScriptURLs = true;
28 export const disableInputAttributeSyncing = false;
29 export const enableSchedulerDebugging = false;
30 -export const enableFundamentalAPI = false;
30 export const enableScopeAPI = true;
31 export const enableCreateEventHandleAPI = true;
32 export const warnAboutUnmockedScheduler = true;
packages/shared/forks/ReactFeatureFlags.www.js
-2
@@ -71,8 +71,6 @@ export const disableModulePatternComponents = true;
71
72 export const enableCreateEventHandleAPI = true;
73
74 -export const enableFundamentalAPI = false;
75 -
74 export const enableScopeAPI = true;
75
76 export const warnAboutUnmockedScheduler = true;
packages/shared/isValidElementType.js
-2
@@ -19,7 +19,6 @@ import {
19 REACT_SUSPENSE_LIST_TYPE,
20 REACT_MEMO_TYPE,
21 REACT_LAZY_TYPE,
22 - REACT_FUNDAMENTAL_TYPE,
22 REACT_SCOPE_TYPE,
23 REACT_LEGACY_HIDDEN_TYPE,
24 REACT_CACHE_TYPE,
@@ -58,7 +57,6 @@ export default function isValidElementType(type: mixed) {
57 type.$$typeof === REACT_PROVIDER_TYPE ||
58 type.$$typeof === REACT_CONTEXT_TYPE ||
59 type.$$typeof === REACT_FORWARD_REF_TYPE ||
61 - type.$$typeof === REACT_FUNDAMENTAL_TYPE ||
60 // This needs to include all possible module reference object
61 // types supported by any Flight configuration anywhere since
62 // we don't know which Flight build this will end up being used