Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ react.internal.useHermesStable=false
react.internal.useHermesNightly=true

# Controls whether to use Hermes 1.0. Clean and rebuild when changing.
hermesV1Enabled=false
hermesV1Enabled=true
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ abstract class PrivateReactExtension @Inject constructor(project: Project) {
val codegenDir: DirectoryProperty =
objects.directoryProperty().convention(root.dir("node_modules/@react-native/codegen"))

val hermesV1Enabled: Property<Boolean> = objects.property(Boolean::class.java).convention(false)
val hermesV1Enabled: Property<Boolean> = objects.property(Boolean::class.java).convention(true)
}
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ internal object DependencyUtils {
fun configureDependencies(
project: Project,
coordinates: Coordinates,
hermesV1Enabled: Boolean = false,
hermesV1Enabled: Boolean = true,
) {
if (
coordinates.versionString.isBlank() ||
Expand Down Expand Up @@ -149,7 +149,7 @@ internal object DependencyUtils {

internal fun getDependencySubstitutions(
coordinates: Coordinates,
hermesV1Enabled: Boolean = false,
hermesV1Enabled: Boolean = true,
): List<Triple<String, String, String>> {
val dependencySubstitution = mutableListOf<Triple<String, String, String>>()
val hermesVersion =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ internal object ProjectUtils {

const val HERMES_FALLBACK = true

const val HERMES_V1_ENABLED_FALLBACK = true

internal fun Project.isNewArchEnabled(): Boolean = true

internal val Project.isHermesEnabled: Boolean
Expand Down Expand Up @@ -73,6 +75,7 @@ internal object ProjectUtils {

internal val Project.isHermesV1Enabled: Boolean
get() =
if (project.hasProperty(HERMES_V1_ENABLED) || project.hasProperty(SCOPED_HERMES_V1_ENABLED)) {
(project.hasProperty(HERMES_V1_ENABLED) &&
project.property(HERMES_V1_ENABLED).toString().toBoolean()) ||
(project.hasProperty(SCOPED_HERMES_V1_ENABLED) &&
Expand All @@ -81,6 +84,9 @@ internal object ProjectUtils {
project.extraProperties.get(HERMES_V1_ENABLED).toString().toBoolean()) ||
(project.extraProperties.has(SCOPED_HERMES_V1_ENABLED) &&
project.extraProperties.get(SCOPED_HERMES_V1_ENABLED).toString().toBoolean())
} else {
HERMES_V1_ENABLED_FALLBACK
}

internal fun Project.needsCodegenFromPackageJson(rootProperty: DirectoryProperty): Boolean {
val parsedPackageJson = readPackageJsonFile(this, rootProperty)
Expand Down
Loading