Skip to content

Commit 19cba09

Browse files
committed
[Android] Use Hermes V1 by default
1 parent f8fa76f commit 19cba09

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

build.gradle.kts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ if (project.findProperty("react.internal.useHermesStable")?.toString()?.toBoolea
137137
)
138138
}
139139

140-
hermesSubstitution = "$hermesCompilerVersion-SNAPSHOT" to "Users opted to use hermes nightly"
140+
val hermesV1Enabled =
141+
project.findProperty("hermesV1Enabled")?.toString()?.toBoolean() ?: true
142+
// Hermes V1 stable releases are published without the -SNAPSHOT suffix.
143+
// Legacy nightly builds use -SNAPSHOT.
144+
val resolvedVersion =
145+
if (hermesV1Enabled) hermesCompilerVersion else "$hermesCompilerVersion-SNAPSHOT"
146+
hermesSubstitution = resolvedVersion to "Users opted to use hermes nightly"
141147
} else {
142148
logger.warn(
143149
"""
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
HERMES_VERSION_NAME=1000.0.0
2-
HERMES_V1_VERSION_NAME=250829098.0.11
2+
HERMES_V1_VERSION_NAME=250829098.0.12

scripts/try-set-nightly-hermes-compiler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ function main() {
1616
const hermesCompilerVersion = packageJson.dependencies['hermes-compiler'];
1717

1818
if (hermesCompilerVersion === '0.0.0') {
19-
console.log(`Hermes compiler version not set. Updating to the latest nightly release.`);
20-
execSync('yarn workspace react-native add hermes-compiler@nightly --exact', { stdio: 'inherit' });
19+
console.log(`Hermes compiler version not set. Updating to the latest-v1 release.`);
20+
execSync('yarn workspace react-native add hermes-compiler@latest-v1 --exact', { stdio: 'inherit' });
2121
} else {
22-
console.log(`Hermes compiler version set to ${hermesCompilerVersion}. Not setting nightly hermes.`);
22+
console.log(`Hermes compiler version set to ${hermesCompilerVersion}. Not setting hermes.`);
2323
}
2424
}
2525

0 commit comments

Comments
 (0)