GeezerVison is showing github.com — Remove the Fundamental internals (#20745) · react/react@4ecf119
File treeExpand file treeCollapse file tree Open diff view settings react-devtools-shared/src/backend react-native-renderer/src
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/react-art/src/ReactARTHostConfig.js -20Lines changed: 0 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -428,26 +428,6 @@ export function clearContainer(container) { | 428 | 428 | // TODO Implement this | 429 | 429 | } | 430 | 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 | | - | 451 | 431 | export function getInstanceFromNode(node) { | 452 | 432 | throw new Error('Not yet implemented.'); | 453 | 433 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-devtools-shared/src/backend/ReactSymbols.js -3Lines changed: 0 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,9 +34,6 @@ export const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)'; | 34 | 34 | export const FRAGMENT_NUMBER = 0xeacb; | 35 | 35 | export const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)'; | 36 | 36 |
| 37 | | -export const FUNDAMENTAL_NUMBER = 0xead5; | 38 | | -export const FUNDAMENTAL_SYMBOL_STRING = 'Symbol(react.fundamental)'; | 39 | | - | 40 | 37 | export const LAZY_NUMBER = 0xead4; | 41 | 38 | export const LAZY_SYMBOL_STRING = 'Symbol(react.lazy)'; | 42 | 39 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/client/ReactDOMHostConfig.js -64Lines changed: 0 additions & 64 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,6 @@ import type { | 16 | 16 | } from 'react-reconciler/src/ReactTestSelectors'; | 17 | 17 | import type {RootType} from './ReactDOMRoot'; | 18 | 18 | import type {ReactScopeInstance} from 'shared/ReactTypes'; | 19 | | -import type {ReactDOMFundamentalComponentInstance} from '../shared/ReactDOMTypes'; | 20 | 19 |
| 21 | 20 | import { | 22 | 21 | precacheFiberNode, | @@ -64,7 +63,6 @@ import {retryIfBlockedOn} from '../events/ReactDOMEventReplaying'; | 64 | 63 |
| 65 | 64 | import { | 66 | 65 | enableSuspenseServerRenderer, | 67 | | - enableFundamentalAPI, | 68 | 66 | enableCreateEventHandleAPI, | 69 | 67 | enableScopeAPI, | 70 | 68 | } from 'shared/ReactFeatureFlags'; | @@ -988,68 +986,6 @@ export function didNotFindHydratableSuspenseInstance( | 988 | 986 | } | 989 | 987 | } | 990 | 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 | | - | 1053 | 989 | export function getInstanceFromNode(node: HTMLElement): null | Object { | 1054 | 990 | return getClosestInstanceFromNode(node) || null; | 1055 | 991 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/server/ReactPartialRenderer.js -39Lines changed: 0 additions & 39 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,7 +22,6 @@ import { | 22 | 22 | disableLegacyContext, | 23 | 23 | disableModulePatternComponents, | 24 | 24 | enableSuspenseServerRenderer, | 25 | | - enableFundamentalAPI, | 26 | 25 | enableScopeAPI, | 27 | 26 | } from 'shared/ReactFeatureFlags'; | 28 | 27 |
| @@ -39,7 +38,6 @@ import { | 39 | 38 | REACT_CONTEXT_TYPE, | 40 | 39 | REACT_LAZY_TYPE, | 41 | 40 | REACT_MEMO_TYPE, | 42 | | - REACT_FUNDAMENTAL_TYPE, | 43 | 41 | REACT_SCOPE_TYPE, | 44 | 42 | REACT_LEGACY_HIDDEN_TYPE, | 45 | 43 | } from 'shared/ReactSymbols'; | @@ -1253,43 +1251,6 @@ class ReactDOMServerRenderer { | 1253 | 1251 | return ''; | 1254 | 1252 | } | 1255 | 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 | 1293 | 1254 | case REACT_LAZY_TYPE: { | 1294 | 1255 | const element: ReactElement = (nextChild: any); | 1295 | 1256 | const lazyComponent: LazyComponent<any, any> = (nextChild: any) | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-dom/src/shared/ReactDOMTypes.js +1-9Lines changed: 1 addition & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 7 | 7 | * @flow | 8 | 8 | */ | 9 | 9 |
| 10 | | -import type { | 11 | | - ReactFundamentalComponentInstance, | 12 | | - ReactScopeInstance, | 13 | | -} from 'shared/ReactTypes'; | | 10 | +import type {ReactScopeInstance} from 'shared/ReactTypes'; | 14 | 11 | import type {DOMEventName} from '../events/DOMEventNames'; | 15 | 12 |
| 16 | | -export type ReactDOMFundamentalComponentInstance = ReactFundamentalComponentInstance< | 17 | | - any, | 18 | | - any, | 19 | | ->; | 20 | | - | 21 | 13 | export type ReactDOMEventHandle = ( | 22 | 14 | target: EventTarget | ReactScopeInstance, | 23 | 15 | callback: (SyntheticEvent<EventTarget>) => void, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/ReactFabricHostConfig.js -24Lines changed: 0 additions & 24 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -438,30 +438,6 @@ export function replaceContainerChildren( | 438 | 438 | newChildren: ChildSet, | 439 | 439 | ): void {} | 440 | 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 | | - | 465 | 441 | export function getInstanceFromNode(node: any) { | 466 | 442 | throw new Error('Not yet implemented.'); | 467 | 443 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-native-renderer/src/ReactNativeHostConfig.js -20Lines changed: 0 additions & 20 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -495,26 +495,6 @@ export function unhideTextInstance( | 495 | 495 | throw new Error('Not yet implemented.'); | 496 | 496 | } | 497 | 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 | | - | 518 | 498 | export function getInstanceFromNode(node: any) { | 519 | 499 | throw new Error('Not yet implemented.'); | 520 | 500 | } | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-noop-renderer/src/createReactNoop.js -51Lines changed: 0 additions & 51 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -397,57 +397,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) { | 397 | 397 | warnsIfNotActing: true, | 398 | 398 | supportsHydration: false, | 399 | 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 | | - | 451 | 400 | getInstanceFromNode() { | 452 | 401 | throw new Error('Not yet implemented.'); | 453 | 402 | }, | |
Collapse file Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiber.new.js +1-34Lines changed: 1 addition & 34 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 8 | 8 | */ | 9 | 9 |
| 10 | 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'; | 17 | 12 | import type {Fiber} from './ReactInternalTypes'; | 18 | 13 | import type {RootTag} from './ReactRootTags'; | 19 | 14 | import type {WorkTag} from './ReactWorkTags'; | @@ -25,7 +20,6 @@ import type {OffscreenProps} from './ReactFiberOffscreenComponent'; | 25 | 20 | import invariant from 'shared/invariant'; | 26 | 21 | import { | 27 | 22 | enableProfilerTimer, | 28 | | - enableFundamentalAPI, | 29 | 23 | enableScopeAPI, | 30 | 24 | enableCache, | 31 | 25 | } from 'shared/ReactFeatureFlags'; | @@ -51,7 +45,6 @@ import { | 51 | 45 | MemoComponent, | 52 | 46 | SimpleMemoComponent, | 53 | 47 | LazyComponent, | 54 | | - FundamentalComponent, | 55 | 48 | ScopeComponent, | 56 | 49 | OffscreenComponent, | 57 | 50 | LegacyHiddenComponent, | @@ -86,7 +79,6 @@ import { | 86 | 79 | REACT_SUSPENSE_LIST_TYPE, | 87 | 80 | REACT_MEMO_TYPE, | 88 | 81 | REACT_LAZY_TYPE, | 89 | | - REACT_FUNDAMENTAL_TYPE, | 90 | 82 | REACT_SCOPE_TYPE, | 91 | 83 | REACT_OFFSCREEN_TYPE, | 92 | 84 | REACT_LEGACY_HIDDEN_TYPE, | @@ -525,17 +517,6 @@ export function createFiberFromTypeAndProps( | 525 | 517 | fiberTag = LazyComponent; | 526 | 518 | resolvedType = null; | 527 | 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; | 539 | 520 | } | 540 | 521 | } | 541 | 522 | let info = ''; | @@ -618,20 +599,6 @@ export function createFiberFromFragment( | 618 | 599 | return fiber; | 619 | 600 | } | 620 | 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 | | - | 635 | 602 | function createFiberFromScope( | 636 | 603 | scope: ReactScope, | 637 | 604 | pendingProps: any, | |
|