Skip to content

Commit dc023c0

Browse files
rubennortefacebook-github-bot
authored andcommitted
Move spec files to specs directories in react-native/src/private
Differential Revision: D54680056
1 parent 68c462e commit dc023c0

28 files changed

+76
-31
lines changed

packages/react-native/Libraries/Core/setUpPerformance.js

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

11-
import NativePerformance from '../../src/private/webapis/performance/NativePerformance';
1211
import Performance from '../../src/private/webapis/performance/Performance';
12+
import NativePerformance from '../../src/private/webapis/performance/specs/NativePerformance';
1313

1414
// In case if the native implementation of the Performance API is available, use it,
1515
// otherwise fall back to the legacy/default one, which only defines 'Performance.now()'

packages/react-native/scripts/featureflags/generateJavaScriptModules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function generateCommonCxxModules(
2525
return {
2626
[path.join(jsPath, 'ReactNativeFeatureFlags.js')]:
2727
ReactNativeFeatureFlagsJS(featureFlagDefinitions),
28-
[path.join(jsPath, 'NativeReactNativeFeatureFlags.js')]:
28+
[path.join(jsPath, 'specs', 'NativeReactNativeFeatureFlags.js')]:
2929
NativeReactNativeFeatureFlagsJS(featureFlagDefinitions),
3030
[path.join(commonNativeModuleCxxPath, 'NativeReactNativeFeatureFlags.h')]:
3131
NativeReactNativeFeatureFlagsH(featureFlagDefinitions),

packages/react-native/scripts/featureflags/templates/js/NativeReactNativeFeatureFlags.js-template.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ export default function (definitions: FeatureFlagDefinitions): string {
2626
2727
${DO_NOT_MODIFY_COMMENT}
2828
29-
import type {TurboModule} from '../../../Libraries/TurboModule/RCTExport';
29+
import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
3030
31-
import * as TurboModuleRegistry from '../../../Libraries/TurboModule/TurboModuleRegistry';
31+
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
3232
3333
export interface Spec extends TurboModule {
3434
${Object.entries(definitions.common)

packages/react-native/src/private/featureflags/ReactNativeFeatureFlagsBase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
ReactNativeFeatureFlagsJsOnlyOverrides,
1414
} from './ReactNativeFeatureFlags';
1515

16-
import NativeReactNativeFeatureFlags from './NativeReactNativeFeatureFlags';
16+
import NativeReactNativeFeatureFlags from './specs/NativeReactNativeFeatureFlags';
1717

1818
const accessedFeatureFlags: Set<string> = new Set();
1919
let overrides: ?ReactNativeFeatureFlagsJsOnlyOverrides;

packages/react-native/src/private/featureflags/__tests__/ReactNativeFeatureFlags-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('ReactNativeFeatureFlags', () => {
2727
});
2828

2929
it('should provide default values for common flags and log an error if the method in the native module is NOT available', () => {
30-
jest.doMock('../NativeReactNativeFeatureFlags', () => ({
30+
jest.doMock('../specs/NativeReactNativeFeatureFlags', () => ({
3131
__esModule: true,
3232
default: {},
3333
}));
@@ -44,7 +44,7 @@ describe('ReactNativeFeatureFlags', () => {
4444
it('should access and cache common flags from the native module if it is available', () => {
4545
const commonTestFlagFn = jest.fn(() => true);
4646

47-
jest.doMock('../NativeReactNativeFeatureFlags', () => ({
47+
jest.doMock('../specs/NativeReactNativeFeatureFlags', () => ({
4848
__esModule: true,
4949
default: {
5050
commonTestFlag: commonTestFlagFn,
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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+
* @generated SignedSource<<a7c3c5ceb67150fda5e1fb6801f2c281>>
8+
* @flow strict-local
9+
*/
10+
11+
/**
12+
* IMPORTANT: Do NOT modify this file directly.
13+
*
14+
* To change the definition of the flags, edit
15+
* packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
16+
*
17+
* To regenerate this code, run the following script from the repo root:
18+
* yarn featureflags-update
19+
*/
20+
21+
import type {TurboModule} from '../../../../Libraries/TurboModule/RCTExport';
22+
23+
import * as TurboModuleRegistry from '../../../../Libraries/TurboModule/TurboModuleRegistry';
24+
25+
export interface Spec extends TurboModule {
26+
+commonTestFlag?: () => boolean;
27+
+batchRenderingUpdatesInEventLoop?: () => boolean;
28+
+enableBackgroundExecutor?: () => boolean;
29+
+enableCustomDrawOrderFabric?: () => boolean;
30+
+enableFixForClippedSubviewsCrash?: () => boolean;
31+
+enableMicrotasks?: () => boolean;
32+
+enableMountHooksAndroid?: () => boolean;
33+
+enableSpannableBuildingUnification?: () => boolean;
34+
+inspectorEnableCxxInspectorPackagerConnection?: () => boolean;
35+
+inspectorEnableHermesCDPAgent?: () => boolean;
36+
+inspectorEnableModernCDPRegistry?: () => boolean;
37+
+skipMountHookNotifications?: () => boolean;
38+
+useModernRuntimeScheduler?: () => boolean;
39+
}
40+
41+
const NativeReactNativeFeatureFlags: ?Spec = TurboModuleRegistry.get<Spec>(
42+
'NativeReactNativeFeatureFlagsCxx',
43+
);
44+
45+
export default NativeReactNativeFeatureFlags;

packages/react-native/src/private/webapis/performance/EventCounts.js

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

11-
import NativePerformanceObserver from './NativePerformanceObserver';
1211
import {warnNoNativePerformanceObserver} from './PerformanceObserver';
12+
import NativePerformanceObserver from './specs/NativePerformanceObserver';
1313

1414
type EventCountsForEachCallbackType =
1515
| (() => void)

packages/react-native/src/private/webapis/performance/Performance.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import type {PerformanceEntryList} from './PerformanceObserver';
1616
import warnOnce from '../../../../Libraries/Utilities/warnOnce';
1717
import EventCounts from './EventCounts';
1818
import MemoryInfo from './MemoryInfo';
19-
import NativePerformance from './NativePerformance';
20-
import NativePerformanceObserver from './NativePerformanceObserver';
2119
import {ALWAYS_LOGGED_ENTRY_TYPES, PerformanceEntry} from './PerformanceEntry';
2220
import {warnNoNativePerformanceObserver} from './PerformanceObserver';
2321
import {
@@ -26,6 +24,8 @@ import {
2624
} from './RawPerformanceEntry';
2725
import {RawPerformanceEntryTypeValues} from './RawPerformanceEntry';
2826
import ReactNativeStartupTiming from './ReactNativeStartupTiming';
27+
import NativePerformance from './specs/NativePerformance';
28+
import NativePerformanceObserver from './specs/NativePerformanceObserver';
2929

3030
type DetailType = mixed;
3131

packages/react-native/src/private/webapis/performance/PerformanceObserver.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
import type {HighResTimeStamp, PerformanceEntryType} from './PerformanceEntry';
1212

1313
import warnOnce from '../../../../Libraries/Utilities/warnOnce';
14-
import NativePerformanceObserver from './NativePerformanceObserver';
1514
import {PerformanceEntry} from './PerformanceEntry';
1615
import PerformanceEventTiming from './PerformanceEventTiming';
1716
import {
1817
performanceEntryTypeToRaw,
1918
rawToPerformanceEntry,
2019
rawToPerformanceEntryType,
2120
} from './RawPerformanceEntry';
21+
import NativePerformanceObserver from './specs/NativePerformanceObserver';
2222

2323
export type PerformanceEntryList = $ReadOnlyArray<PerformanceEntry>;
2424

packages/react-native/src/private/webapis/performance/RawPerformanceEntry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
* @flow strict
99
*/
1010

11+
import type {PerformanceEntryType} from './PerformanceEntry';
1112
import type {
1213
RawPerformanceEntry,
1314
RawPerformanceEntryType,
14-
} from './NativePerformanceObserver';
15-
import type {PerformanceEntryType} from './PerformanceEntry';
15+
} from './specs/NativePerformanceObserver';
1616

1717
import {PerformanceEntry} from './PerformanceEntry';
1818
import PerformanceEventTiming from './PerformanceEventTiming';

0 commit comments

Comments
 (0)