Skip to content

Commit 6aee2ec

Browse files
lavenzgfacebook-github-bot
authored andcommitted
Add DEFAULT_OSS_HERMES_VARIANT and change DEFAULT_HERMES_VARIANT to use SH internally (#54543)
Summary: Changelog: [Internal] We are switching to SH as default, so internally, we need to switch DEFAULT_HERMES_VARIANT to use SH stable. To keep the tests working in OSS, we add DEFAULT_OSS_HERMES_VARIANT to use legacy Hermes. Reviewed By: cipolleschi Differential Revision: D87082037
1 parent 7941a62 commit 6aee2ec

File tree

5 files changed

+14
-17
lines changed

5 files changed

+14
-17
lines changed

packages/react-native/src/private/__tests__/MemoryBaseline-itest.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ declare var performance: Performance;
2929
*/
3030
const MEMORY_LIMITS_KB = {
3131
environmentSetup: {
32-
dev: 1000,
33-
opt: 500,
32+
dev: 1300,
33+
opt: 700,
3434
},
3535
basicSurfaceRender: {
36-
dev: 1200,
37-
opt: 700,
36+
dev: 1700,
37+
opt: 900,
3838
},
3939
};
4040

private/react-native-fantom/runner/getFantomTestConfigs.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import type {FeatureFlagValue} from '../../../packages/react-native/scripts/featureflags/types';
1212

1313
import ReactNativeFeatureFlags from '../../../packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config';
14+
import * as EnvironmentOptions from './EnvironmentOptions';
1415
import {HermesVariant} from './utils';
1516
// $FlowExpectedError[untyped-import]
1617
import {extract, parse} from 'jest-docblock';
@@ -59,7 +60,9 @@ export const FantomTestConfigHermesVariant = HermesVariant;
5960
export const DEFAULT_IS_NATIVE_OPTIMIZED: boolean = false;
6061
export const DEFAULT_IS_JS_OPTIMIZED: boolean = false;
6162
export const DEFAULT_IS_JS_BYTECODE: boolean = false;
62-
export const DEFAULT_HERMES_VARIANT: HermesVariant = HermesVariant.Hermes;
63+
export const DEFAULT_OSS_HERMES_VARIANT: HermesVariant = HermesVariant.Hermes;
64+
export const DEFAULT_HERMES_VARIANT: HermesVariant =
65+
HermesVariant.StaticHermesStable;
6366

6467
export const DEFAULT_FEATURE_FLAGS: FantomTestConfigFeatureFlags = {
6568
common: {},
@@ -170,7 +173,9 @@ export default function getFantomTestConfigs(
170173
isNativeOptimized: DEFAULT_IS_NATIVE_OPTIMIZED,
171174
isJsOptimized: DEFAULT_IS_JS_OPTIMIZED,
172175
isJsBytecode: DEFAULT_IS_JS_BYTECODE,
173-
hermesVariant: DEFAULT_HERMES_VARIANT,
176+
hermesVariant: EnvironmentOptions.isOSS
177+
? DEFAULT_OSS_HERMES_VARIANT
178+
: DEFAULT_HERMES_VARIANT,
174179
flags: {
175180
common: {
176181
...DEFAULT_FEATURE_FLAGS.common,

private/react-native-fantom/runner/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function getBuckOptionsForHermes(
3232
: [];
3333
switch (variant) {
3434
case HermesVariant.Hermes:
35-
return baseOptions;
35+
return [...baseOptions, '-c hermes.static_hermes=legacy'];
3636
case HermesVariant.StaticHermesStable:
3737
return [...baseOptions, '-c hermes.static_hermes=stable'];
3838
case HermesVariant.StaticHermesExperimental:

private/react-native-fantom/src/__tests__/__snapshots__/expect-itest.js.snap

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@ exports[`expect toMatchSnapshot() complex types 7`] = `[Error]`;
3333

3434
exports[`expect toMatchSnapshot() complex types 8`] = `/asd/`;
3535

36-
exports[`expect toMatchSnapshot() complex types 9`] = `
37-
Promise {
38-
"_h": 0,
39-
"_i": 0,
40-
"_j": null,
41-
"_k": null,
42-
}
43-
`;
44-
4536
exports[`expect toMatchSnapshot() named snapshots: named snapshot 1`] = `
4637
Object {
4738
"a": "b",

private/react-native-fantom/src/__tests__/expect-itest.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,8 @@ describe('expect', () => {
857857
expect(new Date('2025-01-02')).toMatchSnapshot();
858858
expect(new Error()).toMatchSnapshot();
859859
expect(new RegExp('asd')).toMatchSnapshot();
860-
expect(new Promise(() => {})).toMatchSnapshot();
860+
// TODO(T245412835): uncomment this once we support Hermes V1 in OSS fantom.
861+
// expect(new Promise(() => {})).toMatchSnapshot();
861862
});
862863

863864
test('named snapshots', () => {

0 commit comments

Comments
 (0)