Skip to content

Commit 7ab3bbb

Browse files
Merge branch 'main' into react-reconciler/remove-unused-paramaters
2 parents 62cfdfe + 0b931f9 commit 7ab3bbb

File tree

214 files changed

+2517
-2327
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+2517
-2327
lines changed

packages/react-art/src/ReactARTHostConfig.js renamed to packages/react-art/src/ReactFiberConfigART.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,13 @@ function applyTextProps(instance, props, prevProps = {}) {
238238
}
239239
}
240240

241-
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoPersistence';
242-
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoHydration';
243-
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoScopes';
244-
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoTestSelectors';
245-
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoMicrotasks';
246-
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoResources';
247-
export * from 'react-reconciler/src/ReactFiberHostConfigWithNoSingletons';
241+
export * from 'react-reconciler/src/ReactFiberConfigWithNoPersistence';
242+
export * from 'react-reconciler/src/ReactFiberConfigWithNoHydration';
243+
export * from 'react-reconciler/src/ReactFiberConfigWithNoScopes';
244+
export * from 'react-reconciler/src/ReactFiberConfigWithNoTestSelectors';
245+
export * from 'react-reconciler/src/ReactFiberConfigWithNoMicrotasks';
246+
export * from 'react-reconciler/src/ReactFiberConfigWithNoResources';
247+
export * from 'react-reconciler/src/ReactFiberConfigWithNoSingletons';
248248

249249
export function appendInitialChild(parentInstance, child) {
250250
if (typeof child === 'string') {

packages/react-cache/src/__tests__/ReactCacheOld-test.internal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ describe('ReactCache', () => {
236236

237237
jest.advanceTimersByTime(100);
238238
assertLog(['Promise resolved [4]']);
239-
await waitForAll([1, 4, 'Suspend! [5]', 'Loading...']);
239+
await waitForAll([1, 4, 'Suspend! [5]']);
240240

241241
jest.advanceTimersByTime(100);
242242
assertLog(['Promise resolved [5]']);
@@ -264,7 +264,7 @@ describe('ReactCache', () => {
264264
]);
265265
jest.advanceTimersByTime(100);
266266
assertLog(['Promise resolved [2]']);
267-
await waitForAll([1, 2, 'Suspend! [3]', 'Loading...']);
267+
await waitForAll([1, 2, 'Suspend! [3]']);
268268

269269
jest.advanceTimersByTime(100);
270270
assertLog(['Promise resolved [3]']);

packages/react-client/src/ReactFlightClient.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ import type {
1616
UninitializedModel,
1717
Response,
1818
SSRManifest,
19-
} from './ReactFlightClientHostConfig';
19+
} from './ReactFlightClientConfig';
2020

2121
import {
2222
resolveClientReference,
2323
preloadModule,
2424
requireModule,
2525
parseModel,
26-
} from './ReactFlightClientHostConfig';
26+
} from './ReactFlightClientConfig';
2727

2828
import {knownServerReferences} from './ReactFlightServerReferenceRegistry';
2929

packages/react-client/src/ReactFlightClientHostConfigStream.js renamed to packages/react-client/src/ReactFlightClientConfigStream.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import type {ResponseBase} from './ReactFlightClient';
11-
import type {StringDecoder} from './ReactFlightClientHostConfig';
11+
import type {StringDecoder} from './ReactFlightClientConfig';
1212

1313
export type Response = ResponseBase & {
1414
_partialRow: string,

packages/react-client/src/ReactFlightClientStream.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
*/
99

1010
import type {CallServerCallback} from './ReactFlightClient';
11-
import type {Response} from './ReactFlightClientHostConfigStream';
12-
import type {SSRManifest} from './ReactFlightClientHostConfig';
11+
import type {Response} from './ReactFlightClientConfigStream';
12+
import type {SSRManifest} from './ReactFlightClientConfig';
1313

1414
import {
1515
resolveModule,
@@ -26,7 +26,7 @@ import {
2626
readFinalStringChunk,
2727
supportsBinaryStreams,
2828
createStringDecoder,
29-
} from './ReactFlightClientHostConfig';
29+
} from './ReactFlightClientConfig';
3030

3131
export type {Response};
3232

packages/react-client/src/forks/ReactFlightClientHostConfig.custom.js renamed to packages/react-client/src/forks/ReactFlightClientConfig.custom.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,27 @@
2323
// So `$$$config` looks like a global variable, but it's
2424
// really an argument to a top-level wrapping function.
2525

26-
declare var $$$hostConfig: any;
26+
declare var $$$config: any;
2727

2828
export type Response = any;
2929
export opaque type SSRManifest = mixed;
3030
export opaque type ServerManifest = mixed;
3131
export opaque type ServerReferenceId = string;
3232
export opaque type ClientReferenceMetadata = mixed;
3333
export opaque type ClientReference<T> = mixed; // eslint-disable-line no-unused-vars
34-
export const resolveClientReference = $$$hostConfig.resolveClientReference;
35-
export const resolveServerReference = $$$hostConfig.resolveServerReference;
36-
export const preloadModule = $$$hostConfig.preloadModule;
37-
export const requireModule = $$$hostConfig.requireModule;
34+
export const resolveClientReference = $$$config.resolveClientReference;
35+
export const resolveServerReference = $$$config.resolveServerReference;
36+
export const preloadModule = $$$config.preloadModule;
37+
export const requireModule = $$$config.requireModule;
3838

3939
export opaque type Source = mixed;
4040

4141
export type UninitializedModel = string;
42-
export const parseModel = $$$hostConfig.parseModel;
42+
export const parseModel = $$$config.parseModel;
4343

4444
export opaque type StringDecoder = mixed; // eslint-disable-line no-undef
4545

46-
export const supportsBinaryStreams = $$$hostConfig.supportsBinaryStreams;
47-
export const createStringDecoder = $$$hostConfig.createStringDecoder;
48-
export const readPartialStringChunk = $$$hostConfig.readPartialStringChunk;
49-
export const readFinalStringChunk = $$$hostConfig.readFinalStringChunk;
46+
export const supportsBinaryStreams = $$$config.supportsBinaryStreams;
47+
export const createStringDecoder = $$$config.createStringDecoder;
48+
export const readPartialStringChunk = $$$config.readPartialStringChunk;
49+
export const readFinalStringChunk = $$$config.readFinalStringChunk;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and 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+
export * from 'react-client/src/ReactFlightClientConfigBrowser';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-server-dom-webpack/src/ReactFlightClientConfigWebpackBundler';
13+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';

packages/react-client/src/forks/ReactFlightClientHostConfig.dom-bun.js renamed to packages/react-client/src/forks/ReactFlightClientConfig.dom-bun.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
* @flow
88
*/
99

10-
export * from 'react-client/src/ReactFlightClientHostConfigBrowser';
11-
export * from 'react-client/src/ReactFlightClientHostConfigStream';
10+
export * from 'react-client/src/ReactFlightClientConfigBrowser';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
1213

1314
export type Response = any;
1415
export opaque type SSRManifest = mixed;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and 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+
export * from 'react-client/src/ReactFlightClientConfigBrowser';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-server-dom-webpack/src/ReactFlightClientConfigWebpackBundler';
13+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and 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+
export * from 'react-client/src/ReactFlightClientConfigBrowser';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-server-dom-webpack/src/ReactFlightClientConfigWebpackBundler';
13+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and 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+
export * from 'react-client/src/ReactFlightClientConfigNode';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-server-dom-webpack/src/ReactFlightClientConfigWebpackBundler';
13+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and 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+
export * from 'react-client/src/ReactFlightClientConfigNode';
11+
export * from 'react-client/src/ReactFlightClientConfigStream';
12+
export * from 'react-server-dom-webpack/src/ReactFlightClientConfigNodeBundler';
13+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';

packages/react-client/src/forks/ReactFlightClientHostConfig.native-relay.js renamed to packages/react-client/src/forks/ReactFlightClientConfig.dom-relay.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
* @flow
88
*/
99

10-
export * from 'react-server-native-relay/src/ReactFlightNativeRelayClientHostConfig';
11-
export * from '../ReactFlightClientHostConfigNoStream';
10+
export * from 'react-server-dom-relay/src/ReactFlightClientConfigDOMRelay';
11+
export * from '../ReactFlightClientConfigNoStream';
12+
export * from 'react-dom-bindings/src/shared/ReactFlightClientConfigDOM';
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and 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+
export * from 'react-server-native-relay/src/ReactFlightClientConfigNativeRelay';
11+
export * from '../ReactFlightClientConfigNoStream';

packages/react-client/src/forks/ReactFlightClientHostConfig.dom-browser.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-client/src/forks/ReactFlightClientHostConfig.dom-edge-webpack.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-client/src/forks/ReactFlightClientHostConfig.dom-legacy.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-client/src/forks/ReactFlightClientHostConfig.dom-node-webpack.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-client/src/forks/ReactFlightClientHostConfig.dom-node.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/react-devtools-core/src/cachedSettings.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
* @flow
88
*/
99

10-
import {
11-
type ConsolePatchSettings,
12-
writeConsolePatchSettingsToWindow,
13-
} from 'react-devtools-shared/src/backend/console';
10+
import type {ConsolePatchSettings} from 'react-devtools-shared/src/backend/types';
11+
import {writeConsolePatchSettingsToWindow} from 'react-devtools-shared/src/backend/console';
1412
import {castBool, castBrowserTheme} from 'react-devtools-shared/src/utils';
1513

1614
// Note: all keys should be optional in this type, because users can use newer

packages/react-devtools-core/src/standalone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
__DEBUG__,
3131
LOCAL_STORAGE_DEFAULT_TAB_KEY,
3232
} from 'react-devtools-shared/src/constants';
33-
import {localStorageSetItem} from '../../react-devtools-shared/src/storage';
33+
import {localStorageSetItem} from 'react-devtools-shared/src/storage';
3434

3535
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
3636
import type {InspectedElement} from 'react-devtools-shared/src/devtools/views/Components/types';

packages/react-devtools-extensions/src/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {createRoot} from 'react-dom/client';
66
import Bridge from 'react-devtools-shared/src/bridge';
77
import Store from 'react-devtools-shared/src/devtools/store';
88
import {IS_CHROME, IS_EDGE, getBrowserTheme} from './utils';
9-
import {LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY} from 'react-devtools-shared/src/constants';
109
import {registerDevToolsEventLogger} from 'react-devtools-shared/src/registerDevToolsEventLogger';
1110
import {
1211
getAppendComponentStack,
@@ -21,7 +20,10 @@ import {
2120
localStorageSetItem,
2221
} from 'react-devtools-shared/src/storage';
2322
import DevTools from 'react-devtools-shared/src/devtools/views/DevTools';
24-
import {__DEBUG__} from 'react-devtools-shared/src/constants';
23+
import {
24+
__DEBUG__,
25+
LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY,
26+
} from 'react-devtools-shared/src/constants';
2527
import {logEvent} from 'react-devtools-shared/src/Logger';
2628

2729
const LOCAL_STORAGE_SUPPORTS_PROFILING_KEY =

packages/react-devtools-shared/src/backend/agent.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
initialize as setupTraceUpdates,
2626
toggleEnabled as setTraceUpdatesEnabled,
2727
} from './views/TraceUpdates';
28-
import {patch as patchConsole, type ConsolePatchSettings} from './console';
28+
import {patch as patchConsole} from './console';
2929
import {currentBridgeProtocol} from 'react-devtools-shared/src/bridge';
3030

3131
import type {BackendBridge} from 'react-devtools-shared/src/bridge';
@@ -37,10 +37,13 @@ import type {
3737
PathMatch,
3838
RendererID,
3939
RendererInterface,
40+
ConsolePatchSettings,
4041
} from './types';
41-
import type {ComponentFilter} from '../types';
42+
import type {
43+
ComponentFilter,
44+
BrowserTheme,
45+
} from 'react-devtools-shared/src/types';
4246
import {isSynchronousXHRSupported} from './utils';
43-
import type {BrowserTheme} from 'react-devtools-shared/src/devtools/views/DevTools';
4447

4548
const debug = (methodName: string, ...args: Array<string>) => {
4649
if (__DEBUG__) {

packages/react-devtools-shared/src/backend/console.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@
88
*/
99

1010
import type {Fiber} from 'react-reconciler/src/ReactInternalTypes';
11-
import type {CurrentDispatcherRef, ReactRenderer, WorkTagMap} from './types';
12-
import type {BrowserTheme} from 'react-devtools-shared/src/devtools/views/DevTools';
11+
import type {
12+
CurrentDispatcherRef,
13+
ReactRenderer,
14+
WorkTagMap,
15+
ConsolePatchSettings,
16+
} from './types';
1317
import {format, formatWithStyles} from './utils';
1418

1519
import {getInternalReactConstants} from './renderer';
@@ -136,22 +140,14 @@ export function registerRenderer(
136140
}
137141
}
138142

139-
const consoleSettingsRef = {
143+
const consoleSettingsRef: ConsolePatchSettings = {
140144
appendComponentStack: false,
141145
breakOnConsoleErrors: false,
142146
showInlineWarningsAndErrors: false,
143147
hideConsoleLogsInStrictMode: false,
144148
browserTheme: 'dark',
145149
};
146150

147-
export type ConsolePatchSettings = {
148-
appendComponentStack: boolean,
149-
breakOnConsoleErrors: boolean,
150-
showInlineWarningsAndErrors: boolean,
151-
hideConsoleLogsInStrictMode: boolean,
152-
browserTheme: BrowserTheme,
153-
};
154-
155151
// Patches console methods to append component stack for the current fiber.
156152
// Call unpatch() to remove the injected behavior.
157153
export function patch({

0 commit comments

Comments
 (0)