Skip to content

Commit ed10664

Browse files
Nick Lefeverfacebook-github-bot
authored andcommitted
Rename fantom_internal_flags pragma to fantom_react_fb_flags (facebook#49728)
Summary: Pull Request resolved: facebook#49728 See title. Resolving https://www.internalfb.com/diff/D70242739?dst_version_fbid=1295747645054627&transaction_fbid=1285615715828636 Changelog: [Internal] Reviewed By: rubennorte Differential Revision: D70328653 fbshipit-source-id: c3e7377760f53bc37d1a6f3e25a0053e12d4f66e
1 parent 6312360 commit ed10664

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

packages/react-native-fantom/runner/entrypoint-template.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,24 @@
1111

1212
import type {SnapshotConfig} from '../runtime/snapshotContext';
1313
import type {
14-
FantomTestConfigInternalFeatureFlags,
1514
FantomTestConfigJsOnlyFeatureFlags,
15+
FantomTestConfigReactInternalFeatureFlags,
1616
} from './getFantomTestConfig';
1717

1818
module.exports = function entrypointTemplate({
1919
testPath,
2020
setupModulePath,
2121
featureFlagsModulePath,
2222
featureFlags,
23-
internalFeatureFlags,
23+
reactInternalFeatureFlags,
2424
snapshotConfig,
2525
isRunningFromCI,
2626
}: {
2727
testPath: string,
2828
setupModulePath: string,
2929
featureFlagsModulePath: string,
3030
featureFlags: FantomTestConfigJsOnlyFeatureFlags,
31-
internalFeatureFlags: FantomTestConfigInternalFeatureFlags,
31+
reactInternalFeatureFlags: FantomTestConfigReactInternalFeatureFlags,
3232
snapshotConfig: SnapshotConfig,
3333
isRunningFromCI: boolean,
3434
}): string {
@@ -58,9 +58,9 @@ ${Object.entries(featureFlags)
5858
: ''
5959
}
6060
${
61-
Object.keys(internalFeatureFlags).length > 0
61+
Object.keys(reactInternalFeatureFlags).length > 0
6262
? `import ReactNativeInternalFeatureFlags from 'ReactNativeInternalFeatureFlags';
63-
${Object.entries(internalFeatureFlags)
63+
${Object.entries(reactInternalFeatureFlags)
6464
.map(
6565
([name, value]) =>
6666
`ReactNativeInternalFeatureFlags.${name} = ${JSON.stringify(value)};`,

packages/react-native-fantom/runner/getFantomTestConfig.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export type FantomTestConfigJsOnlyFeatureFlags = Partial<{
3535
[key in keyof JsOnlyFeatureFlags]: JsOnlyFeatureFlags[key]['defaultValue'],
3636
}>;
3737

38-
export type FantomTestConfigInternalFeatureFlags = {
38+
export type FantomTestConfigReactInternalFeatureFlags = {
3939
[key: string]: FeatureFlagValue,
4040
};
4141

@@ -44,7 +44,7 @@ export type FantomTestConfig = {
4444
flags: {
4545
common: FantomTestConfigCommonFeatureFlags,
4646
jsOnly: FantomTestConfigJsOnlyFeatureFlags,
47-
internal: FantomTestConfigInternalFeatureFlags,
47+
reactInternal: FantomTestConfigReactInternalFeatureFlags,
4848
},
4949
};
5050

@@ -66,7 +66,7 @@ const FANTOM_BENCHMARK_SUITE_RE = /\nFantom\.unstable_benchmark(\s*)\.suite\(/g;
6666
* * @fantom_mode opt
6767
* * @fantom_flags commonTestFlag:true
6868
* * @fantom_flags jsOnlyTestFlag:true
69-
* * @fantom_internal_flags internalTestFlag:true
69+
* * @fantom_react_fb_flags reactInternalFlag:true
7070
* *
7171
* ```
7272
*
@@ -93,7 +93,7 @@ export default function getFantomTestConfig(
9393
enableAccessToHostTreeInFabric: true,
9494
enableDOMDocumentAPI: true,
9595
},
96-
internal: {},
96+
reactInternal: {},
9797
},
9898
};
9999

@@ -167,26 +167,26 @@ export default function getFantomTestConfig(
167167
}
168168
}
169169

170-
const maybeInternalRawFlagConfig = pragmas.fantom_internal_flags;
170+
const maybeReactInternalRawFlagConfig = pragmas.fantom_react_fb_flags;
171171

172-
if (maybeInternalRawFlagConfig != null) {
173-
const internalRawFlagConfigs = (
174-
Array.isArray(maybeInternalRawFlagConfig)
175-
? maybeInternalRawFlagConfig
176-
: [maybeInternalRawFlagConfig]
172+
if (maybeReactInternalRawFlagConfig != null) {
173+
const reactInternalRawFlagConfigs = (
174+
Array.isArray(maybeReactInternalRawFlagConfig)
175+
? maybeReactInternalRawFlagConfig
176+
: [maybeReactInternalRawFlagConfig]
177177
).flatMap(value => value.split(/\s+/g));
178178

179-
for (const internalRawFlagConfig of internalRawFlagConfigs) {
180-
const matches = FANTOM_FLAG_FORMAT.exec(internalRawFlagConfig);
179+
for (const reactInternalRawFlagConfig of reactInternalRawFlagConfigs) {
180+
const matches = FANTOM_FLAG_FORMAT.exec(reactInternalRawFlagConfig);
181181
if (matches == null) {
182182
throw new Error(
183-
`Invalid format for Fantom internal feature flag: ${internalRawFlagConfig}. Expected <flag_name>:<value>`,
183+
`Invalid format for Fantom React fb feature flag: ${reactInternalRawFlagConfig}. Expected <flag_name>:<value>`,
184184
);
185185
}
186186

187187
const [, name, rawValue] = matches;
188188
const value = parseFeatureFlagValue(false, rawValue);
189-
config.flags.internal[name] = value;
189+
config.flags.reactInternal[name] = value;
190190
}
191191
}
192192

packages/react-native-fantom/runner/runner.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ module.exports = async function runTest(
195195
setupModulePath: `${path.relative(BUILD_OUTPUT_PATH, setupModulePath)}`,
196196
featureFlagsModulePath: `${path.relative(BUILD_OUTPUT_PATH, featureFlagsModulePath)}`,
197197
featureFlags: testConfig.flags.jsOnly,
198-
internalFeatureFlags: testConfig.flags.internal,
198+
reactInternalFeatureFlags: testConfig.flags.reactInternal,
199199
snapshotConfig: {
200200
updateSnapshot: snapshotState._updateSnapshot,
201201
data: getInitialSnapshotData(snapshotState),

0 commit comments

Comments
 (0)