@samitouri / QOS-React / commits / 65bbda7f16

Rename Chunks API to Blocks (#18086)

Sounds like this is the name we're going with. This also helps us distinguish it from other "chunking" implementation details.

Sebastian Markbåge committed Feb 20, 2020 at 23:56 UTC 65bbda7f169394005252b46a5992ece5a2ffadad
24 files changed +88 -88
packages/react-debug-tools/src/ReactDebugHooks.js
+2 -2
@@ -25,7 +25,7 @@ import {
25 SimpleMemoComponent,
26 ContextProvider,
27 ForwardRef,
28 - Chunk,
28 + Block,
29 } from 'shared/ReactWorkTags';
30
31 type CurrentDispatcherRef = typeof ReactSharedInternals.ReactCurrentDispatcher;
@@ -628,7 +628,7 @@ export function inspectHooksOfFiber(
628 fiber.tag !== FunctionComponent &&
629 fiber.tag !== SimpleMemoComponent &&
630 fiber.tag !== ForwardRef &&
631 - fiber.tag !== Chunk
631 + fiber.tag !== Block
632 ) {
633 throw new Error(
634 'Unknown Fiber. Needs to be a function component to inspect hooks.',
packages/react-reconciler/src/ReactChildFiber.js
+10 -10
@@ -19,7 +19,7 @@ import {
19 REACT_ELEMENT_TYPE,
20 REACT_FRAGMENT_TYPE,
21 REACT_PORTAL_TYPE,
22 - REACT_CHUNK_TYPE,
22 + REACT_BLOCK_TYPE,
23 } from 'shared/ReactSymbols';
24 import {
25 FunctionComponent,
@@ -27,10 +27,10 @@ import {
27 HostText,
28 HostPortal,
29 Fragment,
30 - Chunk,
30 + Block,
31 } from 'shared/ReactWorkTags';
32 import invariant from 'shared/invariant';
33 -import {warnAboutStringRefs, enableChunksAPI} from 'shared/ReactFeatureFlags';
33 +import {warnAboutStringRefs, enableBlocksAPI} from 'shared/ReactFeatureFlags';
34
35 import {
36 createWorkInProgress,
@@ -416,9 +416,9 @@ function ChildReconciler(shouldTrackSideEffects) {
416 }
417 return existing;
418 } else if (
419 - enableChunksAPI &&
420 - current.tag === Chunk &&
421 - element.type.$$typeof === REACT_CHUNK_TYPE &&
419 + enableBlocksAPI &&
420 + current.tag === Block &&
421 + element.type.$$typeof === REACT_BLOCK_TYPE &&
422 element.type.render === current.type.render
423 ) {
424 // Same as above but also update the .type field.
@@ -1175,10 +1175,10 @@ function ChildReconciler(shouldTrackSideEffects) {
1175 }
1176 break;
1177 }
1178 - case Chunk:
1179 - if (enableChunksAPI) {
1178 + case Block:
1179 + if (enableBlocksAPI) {
1180 if (
1181 - element.type.$$typeof === REACT_CHUNK_TYPE &&
1181 + element.type.$$typeof === REACT_BLOCK_TYPE &&
1182 element.type.render === child.type.render
1183 ) {
1184 deleteRemainingChildren(returnFiber, child.sibling);
@@ -1192,7 +1192,7 @@ function ChildReconciler(shouldTrackSideEffects) {
1192 return existing;
1193 }
1194 }
1195 - // We intentionally fallthrough here if enableChunksAPI is not on.
1195 + // We intentionally fallthrough here if enableBlocksAPI is not on.
1196 // eslint-disable-next-lined no-fallthrough
1197 default: {
1198 if (
packages/react-reconciler/src/ReactFiber.js
+8 -8
@@ -33,7 +33,7 @@ import {
33 enableFundamentalAPI,
34 enableUserTimingAPI,
35 enableScopeAPI,
36 - enableChunksAPI,
36 + enableBlocksAPI,
37 } from 'shared/ReactFeatureFlags';
38 import {NoEffect, Placement} from 'shared/ReactSideEffectTags';
39 import {ConcurrentRoot, BlockingRoot} from 'shared/ReactRootTags';
@@ -59,7 +59,7 @@ import {
59 LazyComponent,
60 FundamentalComponent,
61 ScopeComponent,
62 - Chunk,
62 + Block,
63 } from 'shared/ReactWorkTags';
64 import getComponentName from 'shared/getComponentName';
65
@@ -91,7 +91,7 @@ import {
91 REACT_LAZY_TYPE,
92 REACT_FUNDAMENTAL_TYPE,
93 REACT_SCOPE_TYPE,
94 - REACT_CHUNK_TYPE,
94 + REACT_BLOCK_TYPE,
95 } from 'shared/ReactSymbols';
96
97 let hasBadMapPolyfill;
@@ -391,9 +391,9 @@ export function resolveLazyComponentTag(Component: Function): WorkTag {
391 if ($$typeof === REACT_MEMO_TYPE) {
392 return MemoComponent;
393 }
394 - if (enableChunksAPI) {
395 - if ($$typeof === REACT_CHUNK_TYPE) {
396 - return Chunk;
394 + if (enableBlocksAPI) {
395 + if ($$typeof === REACT_BLOCK_TYPE) {
396 + return Block;
397 }
398 }
399 }
@@ -676,8 +676,8 @@ export function createFiberFromTypeAndProps(
676 fiberTag = LazyComponent;
677 resolvedType = null;
678 break getTag;
679 - case REACT_CHUNK_TYPE:
680 - fiberTag = Chunk;
679 + case REACT_BLOCK_TYPE:
680 + fiberTag = Block;
681 break getTag;
682 case REACT_FUNDAMENTAL_TYPE:
683 if (enableFundamentalAPI) {
packages/react-reconciler/src/ReactFiberBeginWork.js
+14 -14
@@ -42,7 +42,7 @@ import {
42 IncompleteClassComponent,
43 FundamentalComponent,
44 ScopeComponent,
45 - Chunk,
45 + Block,
46 } from 'shared/ReactWorkTags';
47 import {
48 NoEffect,
@@ -65,7 +65,7 @@ import {
65 enableFundamentalAPI,
66 warnAboutDefaultPropsOnFunctionComponents,
67 enableScopeAPI,
68 - enableChunksAPI,
68 + enableBlocksAPI,
69 } from 'shared/ReactFeatureFlags';
70 import invariant from 'shared/invariant';
71 import shallowEqual from 'shared/shallowEqual';
@@ -701,10 +701,10 @@ function updateFunctionComponent(
701 return workInProgress.child;
702 }
703
704 -function updateChunk(
704 +function updateBlock(
705 current: Fiber | null,
706 workInProgress: Fiber,
707 - chunk: any,
707 + block: any,
708 nextProps: any,
709 renderExpirationTime: ExpirationTime,
710 ) {
@@ -712,8 +712,8 @@ function updateChunk(
712 // hasn't yet mounted. This happens after the first render suspends.
713 // We'll need to figure out if this is fine or can cause issues.
714
715 - const render = chunk.render;
716 - const data = chunk.query();
715 + const render = block.render;
716 + const data = block.query();
717
718 // The rest is a fork of updateFunctionComponent
719 let nextChildren;
@@ -1215,10 +1215,10 @@ function mountLazyComponent(
1215 );
1216 return child;
1217 }
1218 - case Chunk: {
1219 - if (enableChunksAPI) {
1218 + case Block: {
1219 + if (enableBlocksAPI) {
1220 // TODO: Resolve for Hot Reloading.
1221 - child = updateChunk(
1221 + child = updateBlock(
1222 null,
1223 workInProgress,
1224 Component,
@@ -3289,14 +3289,14 @@ function beginWork(
3289 }
3290 break;
3291 }
3292 - case Chunk: {
3293 - if (enableChunksAPI) {
3294 - const chunk = workInProgress.type;
3292 + case Block: {
3293 + if (enableBlocksAPI) {
3294 + const block = workInProgress.type;
3295 const props = workInProgress.pendingProps;
3296 - return updateChunk(
3296 + return updateBlock(
3297 current,
3298 workInProgress,
3299 - chunk,
3299 + block,
3300 props,
3301 renderExpirationTime,
3302 );
packages/react-reconciler/src/ReactFiberCommitWork.js
+7 -7
@@ -53,7 +53,7 @@ import {
53 SuspenseListComponent,
54 FundamentalComponent,
55 ScopeComponent,
56 - Chunk,
56 + Block,
57 } from 'shared/ReactWorkTags';
58 import {
59 invokeGuardedCallback,
@@ -249,7 +249,7 @@ function commitBeforeMutationLifeCycles(
249 case FunctionComponent:
250 case ForwardRef:
251 case SimpleMemoComponent:
252 - case Chunk: {
252 + case Block: {
253 return;
254 }
255 case ClassComponent: {
@@ -426,7 +426,7 @@ export function commitPassiveHookEffects(finishedWork: Fiber): void {
426 case FunctionComponent:
427 case ForwardRef:
428 case SimpleMemoComponent:
429 - case Chunk: {
429 + case Block: {
430 // TODO (#17945) We should call all passive destroy functions (for all fibers)
431 // before calling any create functions. The current approach only serializes
432 // these for a single fiber.
@@ -450,7 +450,7 @@ function commitLifeCycles(
450 case FunctionComponent:
451 case ForwardRef:
452 case SimpleMemoComponent:
453 - case Chunk: {
453 + case Block: {
454 // At this point layout effects have already been destroyed (during mutation phase).
455 // This is done to prevent sibling component effects from interfering with each other,
456 // e.g. a destroy function in one component should never override a ref set
@@ -779,7 +779,7 @@ function commitUnmount(
779 case ForwardRef:
780 case MemoComponent:
781 case SimpleMemoComponent:
782 - case Chunk: {
782 + case Block: {
783 const updateQueue: FunctionComponentUpdateQueue | null = (current.updateQueue: any);
784 if (updateQueue !== null) {
785 const lastEffect = updateQueue.lastEffect;
@@ -1360,7 +1360,7 @@ function commitWork(current: Fiber | null, finishedWork: Fiber): void {
1360 case ForwardRef:
1361 case MemoComponent:
1362 case SimpleMemoComponent:
1363 - case Chunk: {
1363 + case Block: {
1364 // Layout effects are destroyed during the mutation phase so that all
1365 // destroy functions for all fibers are called before any create functions.
1366 // This prevents sibling component effects from interfering with each other,
@@ -1403,7 +1403,7 @@ function commitWork(current: Fiber | null, finishedWork: Fiber): void {
1403 case ForwardRef:
1404 case MemoComponent:
1405 case SimpleMemoComponent:
1406 - case Chunk: {
1406 + case Block: {
1407 // Layout effects are destroyed during the mutation phase so that all
1408 // destroy functions for all fibers are called before any create functions.
1409 // This prevents sibling component effects from interfering with each other,
packages/react-reconciler/src/ReactFiberCompleteWork.js
+4 -4
@@ -51,7 +51,7 @@ import {
51 IncompleteClassComponent,
52 FundamentalComponent,
53 ScopeComponent,
54 - Chunk,
54 + Block,
55 } from 'shared/ReactWorkTags';
56 import {NoMode, BlockingMode} from './ReactTypeOfMode';
57 import {
@@ -119,7 +119,7 @@ import {
119 enableDeprecatedFlareAPI,
120 enableFundamentalAPI,
121 enableScopeAPI,
122 - enableChunksAPI,
122 + enableBlocksAPI,
123 } from 'shared/ReactFeatureFlags';
124 import {
125 markSpawnedWork,
@@ -1295,8 +1295,8 @@ function completeWork(
1295 }
1296 break;
1297 }
1298 - case Chunk:
1299 - if (enableChunksAPI) {
1298 + case Block:
1299 + if (enableBlocksAPI) {
1300 return null;
1301 }
1302 break;
packages/react-reconciler/src/ReactFiberWorkLoop.js
+2 -2
@@ -88,7 +88,7 @@ import {
88 ForwardRef,
89 MemoComponent,
90 SimpleMemoComponent,
91 - Chunk,
91 + Block,
92 } from 'shared/ReactWorkTags';
93 import {
94 NoEffect,
@@ -2682,7 +2682,7 @@ function warnAboutUpdateOnUnmountedFiberInDEV(fiber) {
2682 tag !== ForwardRef &&
2683 tag !== MemoComponent &&
2684 tag !== SimpleMemoComponent &&
2685 - tag !== Chunk
2685 + tag !== Block
2686 ) {
2687 // Only warn for user-defined components, not internal ones like Suspense.
2688 return;
packages/react-reconciler/src/__tests__/ReactBlocks-test.js renamed
+6 -6
@@ -12,17 +12,17 @@ let React;
12 let ReactNoop;
13 let useState;
14 let Suspense;
15 -let chunk;
15 +let block;
16 let readString;
17
18 -describe('ReactChunks', () => {
18 +describe('ReactBlocks', () => {
19 beforeEach(() => {
20 jest.resetModules();
21
22 React = require('react');
23 ReactNoop = require('react-noop-renderer');
24
25 - chunk = React.chunk;
25 + block = React.block;
26 useState = React.useState;
27 Suspense = React.Suspense;
28 let cache = new Map();
@@ -63,7 +63,7 @@ describe('ReactChunks', () => {
63 );
64 }
65
66 - let loadUser = chunk(Query, Render);
66 + let loadUser = block(Query, Render);
67
68 function App({User}) {
69 return (
@@ -102,7 +102,7 @@ describe('ReactChunks', () => {
102 );
103 }
104
105 - let loadUser = chunk(Query, Render);
105 + let loadUser = block(Query, Render);
106
107 function App({User}) {
108 return (
@@ -164,7 +164,7 @@ describe('ReactChunks', () => {
164 );
165 }
166
167 - let loadUser = chunk(Query, Render);
167 + let loadUser = block(Query, Render);
168
169 function App({User}) {
170 return (
packages/react-test-renderer/src/ReactTestRenderer.js
+4 -4
@@ -37,7 +37,7 @@ import {
37 Profiler,
38 MemoComponent,
39 SimpleMemoComponent,
40 - Chunk,
40 + Block,
41 IncompleteClassComponent,
42 ScopeComponent,
43 } from 'shared/ReactWorkTags';
@@ -188,9 +188,9 @@ function toTree(node: ?Fiber) {
188 instance: null,
189 rendered: childrenToTree(node.child),
190 };
191 - case Chunk:
191 + case Block:
192 return {
193 - nodeType: 'chunk',
193 + nodeType: 'block',
194 type: node.type,
195 props: {...node.memoizedProps},
196 instance: null,
@@ -233,7 +233,7 @@ const validWrapperTypes = new Set([
233 ForwardRef,
234 MemoComponent,
235 SimpleMemoComponent,
236 - Chunk,
236 + Block,
237 // Normally skipped, but used when there's more than one root child.
238 HostRoot,
239 ]);
packages/react/src/React.js
+4 -4
@@ -28,7 +28,7 @@ import {createContext} from './ReactContext';
28 import {lazy} from './ReactLazy';
29 import forwardRef from './forwardRef';
30 import memo from './memo';
31 -import chunk from './chunk';
31 +import block from './block';
32 import {
33 useCallback,
34 useContext,
@@ -63,7 +63,7 @@ import {
63 enableFundamentalAPI,
64 enableScopeAPI,
65 exposeConcurrentModeAPIs,
66 - enableChunksAPI,
66 + enableBlocksAPI,
67 disableCreateFactory,
68 } from 'shared/ReactFeatureFlags';
69 const React = {
@@ -120,8 +120,8 @@ if (exposeConcurrentModeAPIs) {
120 React.unstable_withSuspenseConfig = withSuspenseConfig;
121 }
122
123 -if (enableChunksAPI) {
124 - React.chunk = chunk;
123 +if (enableBlocksAPI) {
124 + React.block = block;
125 }
126
127 if (enableDeprecatedFlareAPI) {
packages/react/src/block.js renamed
+12 -12
@@ -6,47 +6,47 @@
6 */
7
8 import {
9 - REACT_CHUNK_TYPE,
9 + REACT_BLOCK_TYPE,
10 REACT_MEMO_TYPE,
11 REACT_FORWARD_REF_TYPE,
12 } from 'shared/ReactSymbols';
13
14 -opaque type Chunk<Props>: React$AbstractComponent<
14 +opaque type Block<Props>: React$AbstractComponent<
15 Props,
16 null,
17 > = React$AbstractComponent<Props, null>;
18
19 -export default function chunk<Args, Props, Data>(
19 +export default function block<Args, Props, Data>(
20 query: (...args: Args) => Data,
21 render: (props: Props, data: Data) => React$Node,
22 -): (...args: Args) => Chunk<Props> {
22 +): (...args: Args) => Block<Props> {
23 if (__DEV__) {
24 if (typeof query !== 'function') {
25 console.error(
26 - 'Chunks require a query function but was given %s.',
26 + 'Blocks require a query function but was given %s.',
27 query === null ? 'null' : typeof query,
28 );
29 }
30 if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
31 console.error(
32 - 'Chunks require a render function but received a `memo` ' +
32 + 'Blocks require a render function but received a `memo` ' +
33 'component. Use `memo` on an inner component instead.',
34 );
35 } else if (render != null && render.$$typeof === REACT_FORWARD_REF_TYPE) {
36 console.error(
37 - 'Chunks require a render function but received a `forwardRef` ' +
37 + 'Blocks require a render function but received a `forwardRef` ' +
38 'component. Use `forwardRef` on an inner component instead.',
39 );
40 } else if (typeof render !== 'function') {
41 console.error(
42 - 'Chunks require a render function but was given %s.',
42 + 'Blocks require a render function but was given %s.',
43 render === null ? 'null' : typeof render,
44 );
45 } else if (render.length !== 0 && render.length !== 2) {
46 // Warn if it's not accepting two args.
47 // Do not warn for 0 arguments because it could be due to usage of the 'arguments' object
48 console.error(
49 - 'Chunk render functions accept exactly two parameters: props and data. %s',
49 + 'Block render functions accept exactly two parameters: props and data. %s',
50 render.length === 1
51 ? 'Did you forget to use the data parameter?'
52 : 'Any additional parameter will be undefined.',
@@ -58,15 +58,15 @@ export default function chunk<Args, Props, Data>(
58 (render.defaultProps != null || render.propTypes != null)
59 ) {
60 console.error(
61 - 'Chunk render functions do not support propTypes or defaultProps. ' +
61 + 'Block render functions do not support propTypes or defaultProps. ' +
62 'Did you accidentally pass a React component?',
63 );
64 }
65 }
66 - return function(): Chunk<Props> {
66 + return function(): Block<Props> {
67 let args = arguments;
68 return {
69 - $$typeof: REACT_CHUNK_TYPE,
69 + $$typeof: REACT_BLOCK_TYPE,
70 query: function() {
71 return query.apply(null, args);
72 },
packages/shared/ReactFeatureFlags.js
+1 -1
@@ -31,7 +31,7 @@ export const enableSuspenseServerRenderer = __EXPERIMENTAL__;
31 export const enableSelectiveHydration = __EXPERIMENTAL__;
32
33 // Flight experiments
34 -export const enableChunksAPI = __EXPERIMENTAL__;
34 +export const enableBlocksAPI = __EXPERIMENTAL__;
35
36 // Only used in www builds.
37 export const enableSchedulerDebugging = false;
packages/shared/ReactSymbols.js
+1 -1
@@ -51,7 +51,7 @@ export const REACT_SUSPENSE_LIST_TYPE = hasSymbol
51 : 0xead8;
52 export const REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
53 export const REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
54 -export const REACT_CHUNK_TYPE = hasSymbol ? Symbol.for('react.chunk') : 0xead9;
54 +export const REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
55 export const REACT_FUNDAMENTAL_TYPE = hasSymbol
56 ? Symbol.for('react.fundamental')
57 : 0xead5;
packages/shared/ReactWorkTags.js
+1 -1
@@ -54,4 +54,4 @@ export const DehydratedFragment = 18;
54 export const SuspenseListComponent = 19;
55 export const FundamentalComponent = 20;
56 export const ScopeComponent = 21;
57 -export const Chunk = 22;
57 +export const Block = 22;
packages/shared/forks/ReactFeatureFlags.native-fb.js
+1 -1
@@ -23,7 +23,7 @@ export const enableProfilerTimer = __PROFILE__;
23 export const enableSchedulerTracing = __PROFILE__;
24 export const enableSuspenseServerRenderer = false;
25 export const enableSelectiveHydration = false;
26 -export const enableChunksAPI = false;
26 +export const enableBlocksAPI = false;
27 export const exposeConcurrentModeAPIs = __EXPERIMENTAL__;
28 export const warnAboutShorthandPropertyCollision = true;
29 export const enableSchedulerDebugging = false;
packages/shared/forks/ReactFeatureFlags.native-oss.js
+1 -1
@@ -20,7 +20,7 @@ export const enableProfilerTimer = __PROFILE__;
20 export const enableSchedulerTracing = __PROFILE__;
21 export const enableSuspenseServerRenderer = false;
22 export const enableSelectiveHydration = false;
23 -export const enableChunksAPI = false;
23 +export const enableBlocksAPI = false;
24 export const disableJavaScriptURLs = false;
25 export const disableInputAttributeSyncing = false;
26 export const exposeConcurrentModeAPIs = __EXPERIMENTAL__;
packages/shared/forks/ReactFeatureFlags.persistent.js
+1 -1
@@ -20,7 +20,7 @@ export const enableProfilerTimer = __PROFILE__;
20 export const enableSchedulerTracing = __PROFILE__;
21 export const enableSuspenseServerRenderer = false;
22 export const enableSelectiveHydration = false;
23 -export const enableChunksAPI = false;
23 +export const enableBlocksAPI = false;
24 export const disableJavaScriptURLs = false;
25 export const disableInputAttributeSyncing = false;
26 export const exposeConcurrentModeAPIs = __EXPERIMENTAL__;
packages/shared/forks/ReactFeatureFlags.test-renderer.js
+1 -1
@@ -20,7 +20,7 @@ export const enableProfilerTimer = __PROFILE__;
20 export const enableSchedulerTracing = __PROFILE__;
21 export const enableSuspenseServerRenderer = false;
22 export const enableSelectiveHydration = false;
23 -export const enableChunksAPI = false;
23 +export const enableBlocksAPI = false;
24 export const disableJavaScriptURLs = false;
25 export const disableInputAttributeSyncing = false;
26 export const exposeConcurrentModeAPIs = __EXPERIMENTAL__;
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
+1 -1
@@ -20,7 +20,7 @@ export const enableProfilerTimer = __PROFILE__;
20 export const enableSchedulerTracing = __PROFILE__;
21 export const enableSuspenseServerRenderer = false;
22 export const enableSelectiveHydration = false;
23 -export const enableChunksAPI = false;
23 +export const enableBlocksAPI = false;
24 export const exposeConcurrentModeAPIs = __EXPERIMENTAL__;
25 export const warnAboutShorthandPropertyCollision = true;
26 export const enableSchedulerDebugging = false;
packages/shared/forks/ReactFeatureFlags.testing.js
+1 -1
@@ -20,7 +20,7 @@ export const enableProfilerTimer = __PROFILE__;
20 export const enableSchedulerTracing = __PROFILE__;
21 export const enableSuspenseServerRenderer = false;
22 export const enableSelectiveHydration = false;
23 -export const enableChunksAPI = false;
23 +export const enableBlocksAPI = false;
24 export const disableJavaScriptURLs = false;
25 export const disableInputAttributeSyncing = false;
26 export const exposeConcurrentModeAPIs = __EXPERIMENTAL__;
packages/shared/forks/ReactFeatureFlags.testing.www.js
+1 -1
@@ -20,7 +20,7 @@ export const enableProfilerTimer = false;
20 export const enableSchedulerTracing = false;
21 export const enableSuspenseServerRenderer = true;
22 export const enableSelectiveHydration = true;
23 -export const enableChunksAPI = true;
23 +export const enableBlocksAPI = true;
24 export const disableJavaScriptURLs = true;
25 export const disableInputAttributeSyncing = false;
26 export const exposeConcurrentModeAPIs = true;
packages/shared/forks/ReactFeatureFlags.www.js
+1 -1
@@ -50,7 +50,7 @@ export const exposeConcurrentModeAPIs = true;
50 export const enableSuspenseServerRenderer = true;
51 export const enableSelectiveHydration = true;
52
53 -export const enableChunksAPI = true;
53 +export const enableBlocksAPI = true;
54
55 export const disableJavaScriptURLs = true;
56
packages/shared/getComponentName.js
+2 -2
@@ -21,7 +21,7 @@ import {
21 REACT_SUSPENSE_TYPE,
22 REACT_SUSPENSE_LIST_TYPE,
23 REACT_LAZY_TYPE,
24 - REACT_CHUNK_TYPE,
24 + REACT_BLOCK_TYPE,
25 } from 'shared/ReactSymbols';
26 import {refineResolvedLazyComponent} from 'shared/ReactLazyComponent';
27
@@ -80,7 +80,7 @@ function getComponentName(type: mixed): string | null {
80 return getWrappedName(type, type.render, 'ForwardRef');
81 case REACT_MEMO_TYPE:
82 return getComponentName(type.type);
83 - case REACT_CHUNK_TYPE:
83 + case REACT_BLOCK_TYPE:
84 return getComponentName(type.render);
85 case REACT_LAZY_TYPE: {
86 const thenable: LazyComponent<mixed> = (type: any);
packages/shared/isValidElementType.js
+2 -2
@@ -22,7 +22,7 @@ import {
22 REACT_FUNDAMENTAL_TYPE,
23 REACT_RESPONDER_TYPE,
24 REACT_SCOPE_TYPE,
25 - REACT_CHUNK_TYPE,
25 + REACT_BLOCK_TYPE,
26 } from 'shared/ReactSymbols';
27
28 export default function isValidElementType(type: mixed) {
@@ -46,6 +46,6 @@ export default function isValidElementType(type: mixed) {
46 type.$$typeof === REACT_FUNDAMENTAL_TYPE ||
47 type.$$typeof === REACT_RESPONDER_TYPE ||
48 type.$$typeof === REACT_SCOPE_TYPE ||
49 - type.$$typeof === REACT_CHUNK_TYPE))
49 + type.$$typeof === REACT_BLOCK_TYPE))
50 );
51 }