mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
20
Commits
v0.78.2
...
0.78-stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5dd406cb36 | ||
|
|
550898a325 | ||
|
|
d4f7b991ab | ||
|
|
026ea353de | ||
|
|
aa29779a07 | ||
|
|
63c8f7ebd5 | ||
|
|
58a4c2fe36 | ||
|
|
ef42f5f996 | ||
|
|
78d6092385 | ||
|
|
6b2826e67c | ||
|
|
1a1814a466 | ||
|
|
157cf118ce | ||
|
|
d59159df17 | ||
|
|
8d0191151e | ||
|
|
8367b4250a | ||
|
|
07717b5275 | ||
|
|
7f664d9811 | ||
|
|
36c47a6572 | ||
|
|
5dd0369033 | ||
|
|
541c8d577f |
@@ -14,8 +14,12 @@ runs:
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install -y git openssh-client cmake build-essential \
|
||||
sudo apt install -y git openssh-client build-essential \
|
||||
libreadline-dev libicu-dev jq zip python3
|
||||
|
||||
# Install cmake 3.28.3-1build7
|
||||
sudo apt-get install cmake=3.28.3-1build7
|
||||
sudo ln -sf /usr/bin/cmake /usr/local/bin/cmake
|
||||
- name: Restore Hermes workspace
|
||||
uses: ./.github/actions/restore-hermes-workspace
|
||||
- name: Linux cache
|
||||
|
||||
@@ -14,23 +14,23 @@ runs:
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: hermes-workspace
|
||||
path: 'D:\tmp\hermes'
|
||||
path: 'C:\tmp\hermes'
|
||||
- name: Set up workspace
|
||||
shell: powershell
|
||||
run: |
|
||||
mkdir -p D:\tmp\hermes\osx-bin
|
||||
mkdir -p C:\tmp\hermes\osx-bin
|
||||
mkdir -p .\packages\react-native\sdks\hermes
|
||||
cp -r -Force D:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force C:\tmp\hermes\hermes\* .\packages\react-native\sdks\hermes\.
|
||||
cp -r -Force .\packages\react-native\sdks\hermes-engine\utils\* .\packages\react-native\sdks\hermes\.
|
||||
- name: Windows cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
key: v2-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
key: v3-hermes-${{ github.job }}-windows-${{ inputs.hermes-version }}-${{ inputs.react-native-version }}
|
||||
path: |
|
||||
D:\tmp\hermes\win64-bin\
|
||||
D:\tmp\hermes\hermes\icu\
|
||||
D:\tmp\hermes\hermes\deps\
|
||||
D:\tmp\hermes\hermes\build_release\
|
||||
C:\tmp\hermes\win64-bin\
|
||||
C:\tmp\hermes\hermes\icu\
|
||||
C:\tmp\hermes\hermes\deps\
|
||||
C:\tmp\hermes\hermes\build_release\
|
||||
- name: setup-msbuild
|
||||
uses: microsoft/setup-msbuild@v1.3.2
|
||||
- name: Set up workspace
|
||||
@@ -39,6 +39,9 @@ runs:
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\icu
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\deps
|
||||
New-Item -ItemType Directory -ErrorAction SilentlyContinue $Env:HERMES_WS_DIR\win64-bin
|
||||
- name: Downgrade CMake
|
||||
shell: powershell
|
||||
run: choco install cmake --version 3.31.6 --force
|
||||
- name: Build HermesC for Windows
|
||||
shell: powershell
|
||||
run: |
|
||||
@@ -60,7 +63,7 @@ runs:
|
||||
$Env:PATH += ";$Env:CMAKE_DIR;$Env:MSBUILD_DIR"
|
||||
$Env:ICU_ROOT = "$Env:HERMES_WS_DIR\icu"
|
||||
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 16 2019' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
cmake -S hermes -B build_release -G 'Visual Studio 17 2022' -Ax64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=True -DHERMES_ENABLE_WIN10_ICU_FALLBACK=OFF
|
||||
if (-not $?) { throw "Failed to configure Hermes" }
|
||||
echo "Running windows build..."
|
||||
cd build_release
|
||||
@@ -80,4 +83,4 @@ runs:
|
||||
uses: actions/upload-artifact@v4.3.4
|
||||
with:
|
||||
name: hermes-win64-bin
|
||||
path: D:\tmp\hermes\win64-bin\
|
||||
path: C:\tmp\hermes\win64-bin\
|
||||
|
||||
@@ -116,12 +116,12 @@ jobs:
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
|
||||
@@ -113,12 +113,12 @@ jobs:
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
@@ -131,26 +131,6 @@ jobs:
|
||||
hermes-version: ${{ needs.prepare_hermes_workspace.outputs.hermes-version }}
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_android:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs: [set_release_type]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
env:
|
||||
TERM: "dumb"
|
||||
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
|
||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_KEY }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }}
|
||||
ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Build Android
|
||||
uses: ./.github/actions/build-android
|
||||
with:
|
||||
release-type: ${{ needs.set_release_type.outputs.RELEASE_TYPE }}
|
||||
|
||||
build_npm_package:
|
||||
runs-on: 8-core-ubuntu
|
||||
needs:
|
||||
@@ -160,7 +140,6 @@ jobs:
|
||||
build_hermes_macos,
|
||||
build_hermesc_linux,
|
||||
build_hermesc_windows,
|
||||
build_android,
|
||||
]
|
||||
container:
|
||||
image: reactnativecommunity/react-native-android:latest
|
||||
|
||||
@@ -408,12 +408,12 @@ jobs:
|
||||
react-native-version: ${{ needs.prepare_hermes_workspace.outputs.react-native-version }}
|
||||
|
||||
build_hermesc_windows:
|
||||
runs-on: windows-2019
|
||||
runs-on: windows-2025
|
||||
needs: prepare_hermes_workspace
|
||||
env:
|
||||
HERMES_WS_DIR: 'D:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'D:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'D:\tmp\hermes\osx-bin'
|
||||
HERMES_WS_DIR: 'C:\tmp\hermes'
|
||||
HERMES_TARBALL_ARTIFACTS_DIR: 'C:\tmp\hermes\hermes-runtime-darwin'
|
||||
HERMES_OSXBIN_ARTIFACTS_DIR: 'C:\tmp\hermes\osx-bin'
|
||||
ICU_URL: "https://github.com/unicode-org/icu/releases/download/release-64-2/icu4c-64_2-Win64-MSVC2017.zip"
|
||||
MSBUILD_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin'
|
||||
CMAKE_DIR: 'C:\Program Files\CMake\bin'
|
||||
|
||||
@@ -54,6 +54,8 @@ nexusPublishing {
|
||||
sonatype {
|
||||
username.set(sonatypeUsername)
|
||||
password.set(sonatypePassword)
|
||||
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
|
||||
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -49,8 +49,8 @@
|
||||
"@babel/preset-flow": "^7.24.7",
|
||||
"@definitelytyped/dtslint": "^0.0.127",
|
||||
"@jest/create-cache-key-function": "^29.6.3",
|
||||
"@react-native/metro-babel-transformer": "0.78.2",
|
||||
"@react-native/metro-config": "0.78.2",
|
||||
"@react-native/metro-babel-transformer": "0.78.3",
|
||||
"@react-native/metro-config": "0.78.3",
|
||||
"@tsconfig/node18": "1.0.1",
|
||||
"@types/react": "^19.0.0",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/assets-registry",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Asset support code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-plugin-codegen",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Babel plugin to generate native module and view manager code for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@babel/traverse": "^7.25.3",
|
||||
"@react-native/codegen": "0.78.2"
|
||||
"@react-native/codegen": "0.78.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/community-cli-plugin",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Core CLI commands for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -22,8 +22,8 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/dev-middleware": "0.78.2",
|
||||
"@react-native/metro-babel-transformer": "0.78.2",
|
||||
"@react-native/dev-middleware": "0.78.3",
|
||||
"@react-native/metro-babel-transformer": "0.78.3",
|
||||
"chalk": "^4.0.0",
|
||||
"debug": "^2.2.0",
|
||||
"invariant": "^2.2.4",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/core-cli-utils",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "React Native CLI library for Frameworks to build on",
|
||||
"license": "MIT",
|
||||
"main": "./src/index.flow.js",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
@generated SignedSource<<890c168c017f387915457465e90400e9>>
|
||||
Git revision: 7727db85ac767cf41cce3e9ee54d27e97b2637f9
|
||||
@generated SignedSource<<7379c02d269a700f429c1c1e33cb6419>>
|
||||
Git revision: 911a4d983fc2609abc59e73230b7a8684e3a7ac9
|
||||
Built with --nohooks: false
|
||||
Is local checkout: false
|
||||
Remote URL: https://github.com/facebookexperimental/rn-chrome-devtools-frontend
|
||||
Remote branch: main
|
||||
Remote branch: 0.78-stable
|
||||
GN build args (overrides only):
|
||||
is_official_build = true
|
||||
Git status in checkout:
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+2
-2
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/debugger-frontend",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Debugger frontend for React Native based on Chrome DevTools",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/dev-middleware",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Dev server middleware for React Native",
|
||||
"keywords": [
|
||||
"react-native",
|
||||
@@ -23,7 +23,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"@isaacs/ttlcache": "^1.4.1",
|
||||
"@react-native/debugger-frontend": "0.78.2",
|
||||
"@react-native/debugger-frontend": "0.78.3",
|
||||
"chrome-launcher": "^0.15.2",
|
||||
"chromium-edge-launcher": "^0.2.0",
|
||||
"connect": "^3.6.5",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-config",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "ESLint config for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -22,7 +22,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/eslint-parser": "^7.25.1",
|
||||
"@react-native/eslint-plugin": "0.78.2",
|
||||
"@react-native/eslint-plugin": "0.78.3",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.1",
|
||||
"@typescript-eslint/parser": "^7.1.1",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "ESLint rules for @react-native/eslint-config",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/eslint-plugin-specs",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "ESLint rules to validate NativeModule and Component Specs",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
||||
"@react-native/codegen": "0.78.2",
|
||||
"@react-native/codegen": "0.78.3",
|
||||
"make-dir": "^2.1.0",
|
||||
"pirates": "^4.0.1",
|
||||
"source-map-support": "0.5.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/gradle-plugin",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Gradle Plugin for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+28
-1
@@ -8,12 +8,14 @@
|
||||
package com.facebook.react.utils
|
||||
|
||||
import com.facebook.react.utils.PropertyUtils.DEFAULT_INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.INCLUDE_JITPACK_REPOSITORY_DEFAULT
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_PUBLISHING_GROUP
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_USE_HERMES_NIGHTLY
|
||||
import com.facebook.react.utils.PropertyUtils.INTERNAL_VERSION_NAME
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY
|
||||
import com.facebook.react.utils.PropertyUtils.SCOPED_INCLUDE_JITPACK_REPOSITORY
|
||||
import java.io.File
|
||||
import java.net.URI
|
||||
@@ -28,6 +30,12 @@ internal object DependencyUtils {
|
||||
* party libraries which are auto-linked.
|
||||
*/
|
||||
fun configureRepositories(project: Project) {
|
||||
val exclusiveEnterpriseRepository = project.rootProject.exclusiveEnterpriseRepository()
|
||||
if (exclusiveEnterpriseRepository != null) {
|
||||
project.logger.lifecycle(
|
||||
"Replacing ALL Maven Repositories with: $exclusiveEnterpriseRepository")
|
||||
}
|
||||
|
||||
project.rootProject.allprojects { eachProject ->
|
||||
with(eachProject) {
|
||||
if (hasProperty(INTERNAL_REACT_NATIVE_MAVEN_LOCAL_REPO)) {
|
||||
@@ -36,8 +44,18 @@ internal object DependencyUtils {
|
||||
repo.content { it.excludeGroup("org.webkit") }
|
||||
}
|
||||
}
|
||||
|
||||
if (exclusiveEnterpriseRepository != null) {
|
||||
// We remove all previously set repositories and only configure the proxy provided by the
|
||||
// user.
|
||||
rootProject.repositories.clear()
|
||||
mavenRepoFromUrl(exclusiveEnterpriseRepository)
|
||||
// We return here as we don't want to configure other repositories as well.
|
||||
return@allprojects
|
||||
}
|
||||
|
||||
// We add the snapshot for users on nightlies.
|
||||
mavenRepoFromUrl("https://oss.sonatype.org/content/repositories/snapshots/") { repo ->
|
||||
mavenRepoFromUrl("https://central.sonatype.com/repository/maven-snapshots/") { repo ->
|
||||
repo.content { it.excludeGroup("org.webkit") }
|
||||
}
|
||||
repositories.mavenCentral { repo ->
|
||||
@@ -181,4 +199,13 @@ internal object DependencyUtils {
|
||||
property(INCLUDE_JITPACK_REPOSITORY).toString().toBoolean()
|
||||
else -> INCLUDE_JITPACK_REPOSITORY_DEFAULT
|
||||
}
|
||||
|
||||
internal fun Project.exclusiveEnterpriseRepository() =
|
||||
when {
|
||||
hasProperty(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
|
||||
property(SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
|
||||
hasProperty(EXCLUSIVE_ENTEPRISE_REPOSITORY) ->
|
||||
property(EXCLUSIVE_ENTEPRISE_REPOSITORY).toString()
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
||||
+7
-1
@@ -26,7 +26,13 @@ object PropertyUtils {
|
||||
const val INCLUDE_JITPACK_REPOSITORY = "includeJitpackRepository"
|
||||
const val SCOPED_INCLUDE_JITPACK_REPOSITORY = "react.includeJitpackRepository"
|
||||
|
||||
/** By default we include JitPack till React Native 0.80 where this is going to become false */
|
||||
/**
|
||||
* Public property that allows to configure an enterprise repository proxy as exclusive repository
|
||||
*/
|
||||
const val EXCLUSIVE_ENTEPRISE_REPOSITORY = "exclusiveEnterpriseRepository"
|
||||
const val SCOPED_EXCLUSIVE_ENTEPRISE_REPOSITORY = "react.exclusiveEnterpriseRepository"
|
||||
|
||||
/** By default we include JitPack to avoid breaking user builds */
|
||||
internal const val INCLUDE_JITPACK_REPOSITORY_DEFAULT = true
|
||||
|
||||
/**
|
||||
|
||||
+46
-3
@@ -10,6 +10,7 @@ package com.facebook.react.utils
|
||||
import com.facebook.react.tests.createProject
|
||||
import com.facebook.react.utils.DependencyUtils.configureDependencies
|
||||
import com.facebook.react.utils.DependencyUtils.configureRepositories
|
||||
import com.facebook.react.utils.DependencyUtils.exclusiveEnterpriseRepository
|
||||
import com.facebook.react.utils.DependencyUtils.getDependencySubstitutions
|
||||
import com.facebook.react.utils.DependencyUtils.mavenRepoFromURI
|
||||
import com.facebook.react.utils.DependencyUtils.mavenRepoFromUrl
|
||||
@@ -45,7 +46,7 @@ class DependencyUtilsTest {
|
||||
|
||||
@Test
|
||||
fun configureRepositories_containsSnapshotRepo() {
|
||||
val repositoryURI = URI.create("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
val repositoryURI = URI.create("https://central.sonatype.com/repository/maven-snapshots/")
|
||||
val project = createProject()
|
||||
|
||||
configureRepositories(project)
|
||||
@@ -99,6 +100,24 @@ class DependencyUtilsTest {
|
||||
.isNotNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureRepositories_withExclusiveEnterpriseRepository_replacesAllRepositories() {
|
||||
val repositoryURI = URI.create("https://maven.myfabolousorganization.it")
|
||||
|
||||
val project = createProject()
|
||||
project.rootProject.extensions.extraProperties.set(
|
||||
"exclusiveEnterpriseRepository", repositoryURI.toString())
|
||||
|
||||
configureRepositories(project)
|
||||
|
||||
assertThat(project.repositories).hasSize(1)
|
||||
assertThat(
|
||||
project.repositories.firstOrNull {
|
||||
it is MavenArtifactRepository && it.url == repositoryURI
|
||||
})
|
||||
.isNotNull()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun configureRepositories_withIncludeJitpackRepositoryFalse_doesNotContainJitPack() {
|
||||
val repositoryURI = URI.create("https://www.jitpack.io")
|
||||
@@ -176,7 +195,7 @@ class DependencyUtilsTest {
|
||||
|
||||
@Test
|
||||
fun configureRepositories_snapshotRepoHasHigherPriorityThanMavenCentral() {
|
||||
val repositoryURI = URI.create("https://oss.sonatype.org/content/repositories/snapshots/")
|
||||
val repositoryURI = URI.create("https://central.sonatype.com/repository/maven-snapshots/")
|
||||
val mavenCentralURI = URI.create("https://repo.maven.apache.org/maven2/")
|
||||
val project = createProject()
|
||||
|
||||
@@ -470,7 +489,7 @@ class DependencyUtilsTest {
|
||||
@Test
|
||||
fun shouldAddJitPack_withUnscopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set("react.includeJitpackRepository", "false")
|
||||
project.extensions.extraProperties.set("includeJitpackRepository", "false")
|
||||
assertThat(project.shouldAddJitPack()).isFalse()
|
||||
}
|
||||
|
||||
@@ -479,4 +498,28 @@ class DependencyUtilsTest {
|
||||
val project = createProject(tempFolder.root)
|
||||
assertThat(project.shouldAddJitPack()).isTrue()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_withScopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set(
|
||||
"react.exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
|
||||
assertThat(project.exclusiveEnterpriseRepository())
|
||||
.isEqualTo("https://maven.myfabolousorganization.it")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_withUnscopedProperty() {
|
||||
val project = createProject(tempFolder.root)
|
||||
project.extensions.extraProperties.set(
|
||||
"exclusiveEnterpriseRepository", "https://maven.myfabolousorganization.it")
|
||||
assertThat(project.exclusiveEnterpriseRepository())
|
||||
.isEqualTo("https://maven.myfabolousorganization.it")
|
||||
}
|
||||
|
||||
@Test
|
||||
fun exclusiveEnterpriseRepository_defaultIsTrue() {
|
||||
val project = createProject(tempFolder.root)
|
||||
assertThat(project.exclusiveEnterpriseRepository()).isNull()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "helloworld",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"bootstrap": "node ./cli.js bootstrap",
|
||||
@@ -13,16 +13,16 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"react": "19.0.0",
|
||||
"react-native": "0.78.2"
|
||||
"react-native": "0.78.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@babel/preset-env": "^7.25.3",
|
||||
"@babel/runtime": "^7.25.0",
|
||||
"@react-native/babel-preset": "0.78.2",
|
||||
"@react-native/core-cli-utils": "0.78.2",
|
||||
"@react-native/eslint-config": "0.78.2",
|
||||
"@react-native/metro-config": "0.78.2",
|
||||
"@react-native/babel-preset": "0.78.3",
|
||||
"@react-native/core-cli-utils": "0.78.3",
|
||||
"@react-native/eslint-config": "0.78.3",
|
||||
"@react-native/metro-config": "0.78.3",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^12.0.0",
|
||||
"eslint": "^8.19.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-config",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Metro configuration for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -26,8 +26,8 @@
|
||||
"dist"
|
||||
],
|
||||
"dependencies": {
|
||||
"@react-native/js-polyfills": "0.78.2",
|
||||
"@react-native/metro-babel-transformer": "0.78.2",
|
||||
"@react-native/js-polyfills": "0.78.3",
|
||||
"@react-native/metro-babel-transformer": "0.78.3",
|
||||
"metro-config": "^0.81.3",
|
||||
"metro-runtime": "^0.81.3"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/normalize-colors",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Color normalization for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/js-polyfills",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Polyfills for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/babel-preset",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Babel preset for React Native applications",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -55,7 +55,7 @@
|
||||
"@babel/plugin-transform-typescript": "^7.25.2",
|
||||
"@babel/plugin-transform-unicode-regex": "^7.24.7",
|
||||
"@babel/template": "^7.25.0",
|
||||
"@react-native/babel-plugin-codegen": "0.78.2",
|
||||
"@react-native/babel-plugin-codegen": "0.78.3",
|
||||
"babel-plugin-syntax-hermes-parser": "0.25.1",
|
||||
"babel-plugin-transform-flow-enums": "^0.0.2",
|
||||
"react-refresh": "^0.14.0"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/metro-babel-transformer",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Babel transformer for React Native applications.",
|
||||
"main": "src/index.js",
|
||||
"repository": {
|
||||
@@ -16,7 +16,7 @@
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.78.2",
|
||||
"@react-native/babel-preset": "0.78.3",
|
||||
"hermes-parser": "0.25.1",
|
||||
"nullthrows": "^1.1.1"
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/bots",
|
||||
"description": "React Native Bots",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"private": true,
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen-typescript-test",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"private": true,
|
||||
"description": "TypeScript related unit test for @react-native/codegen",
|
||||
"license": "MIT",
|
||||
@@ -19,7 +19,7 @@
|
||||
"prepare": "yarn run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native/codegen": "0.78.2"
|
||||
"@react-native/codegen": "0.78.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/codegen",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Code generation tools for React Native",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@react-native/fantom",
|
||||
"private": true,
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"main": "src/index.js",
|
||||
"description": "Internal integration testing and benchmarking tool for React Native",
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-info",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"main": "build/index.js",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/popup-menu-android",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "PopupMenu for the Android platform",
|
||||
"main": "index.js",
|
||||
"files": [
|
||||
@@ -17,7 +17,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@react-native/codegen": "0.78.2"
|
||||
"@react-native/codegen": "0.78.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^19.0.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/oss-library-example",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"private": true,
|
||||
"description": "Package that includes native module exapmle, native component example, targets both the old and the new architecture. It should serve as an example of a real-world OSS library.",
|
||||
"license": "MIT",
|
||||
@@ -26,8 +26,8 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"@react-native/babel-preset": "0.78.2",
|
||||
"react-native": "0.78.2"
|
||||
"@react-native/babel-preset": "0.78.3",
|
||||
"react-native": "0.78.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "*",
|
||||
|
||||
@@ -275,6 +275,10 @@ class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefau
|
||||
{
|
||||
return true;
|
||||
}
|
||||
bool enableFixForViewCommandRace() override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
- (void)_setUpFeatureFlags
|
||||
|
||||
@@ -16,7 +16,7 @@ const version: $ReadOnly<{
|
||||
}> = {
|
||||
major: 0,
|
||||
minor: 78,
|
||||
patch: 2,
|
||||
patch: 3,
|
||||
prerelease: null,
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
||||
__rnVersion = @{
|
||||
RCTVersionMajor: @(0),
|
||||
RCTVersionMinor: @(78),
|
||||
RCTVersionPatch: @(2),
|
||||
RCTVersionPatch: @(3),
|
||||
RCTVersionPrerelease: [NSNull null],
|
||||
};
|
||||
});
|
||||
|
||||
+18
-4
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
||||
|
||||
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
||||
{
|
||||
[_viewsToBeMounted addObject:@{
|
||||
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
||||
kRCTLegacyInteropChildComponentKey : childComponentView
|
||||
}];
|
||||
if (_adapter && index == _adapter.paperView.reactSubviews.count) {
|
||||
// This is a new child view that is being added to the end of the children array.
|
||||
// After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
|
||||
// Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
|
||||
// called and the `finalizeUpdate` is not invoked.
|
||||
if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
|
||||
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
|
||||
[_adapter.paperView insertReactSubview:target atIndex:index];
|
||||
} else {
|
||||
[_adapter.paperView insertReactSubview:childComponentView atIndex:index];
|
||||
}
|
||||
[_adapter.paperView didUpdateReactSubviews];
|
||||
} else {
|
||||
[_viewsToBeMounted addObject:@{
|
||||
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
||||
kRCTLegacyInteropChildComponentKey : childComponentView
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ using namespace facebook::react;
|
||||
const auto &newSwitchProps = static_cast<const SwitchProps &>(*props);
|
||||
|
||||
// `value`
|
||||
if (oldSwitchProps.value != newSwitchProps.value) {
|
||||
if (!_isInitialValueSet || oldSwitchProps.value != newSwitchProps.value) {
|
||||
BOOL shouldAnimate = _isInitialValueSet == YES;
|
||||
[_switchView setOn:newSwitchProps.value animated:shouldAnimate];
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ using namespace facebook::react;
|
||||
|
||||
if (!_view) {
|
||||
_view = [[RCTSurfaceView alloc] initWithSurface:(RCTSurface *)self];
|
||||
[self _updateLayoutContext];
|
||||
_touchHandler = [RCTSurfaceTouchHandler new];
|
||||
[_touchHandler attachToView:_view];
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
VERSION_NAME=0.78.2
|
||||
VERSION_NAME=0.78.3
|
||||
react.internal.publishingGroup=com.facebook.react
|
||||
|
||||
android.useAndroidX=true
|
||||
|
||||
+1
-1
@@ -17,6 +17,6 @@ public class ReactNativeVersion {
|
||||
public static final Map<String, Object> VERSION = MapBuilder.<String, Object>of(
|
||||
"major", 0,
|
||||
"minor", 78,
|
||||
"patch", 2,
|
||||
"patch", 3,
|
||||
"prerelease", null);
|
||||
}
|
||||
|
||||
+2
-2
@@ -136,10 +136,10 @@ public data class BorderRadiusStyle(
|
||||
(startStart ?: topStart ?: topLeft ?: uniform)?.resolve(width, height)
|
||||
?: zeroRadii,
|
||||
bottomLeft =
|
||||
(endEnd ?: bottomStart ?: bottomRight ?: uniform)?.resolve(width, height)
|
||||
(endEnd ?: bottomEnd ?: bottomRight ?: uniform)?.resolve(width, height)
|
||||
?: zeroRadii,
|
||||
bottomRight =
|
||||
(startEnd ?: bottomEnd ?: bottomLeft ?: uniform)?.resolve(width, height)
|
||||
(startEnd ?: bottomStart ?: bottomLeft ?: uniform)?.resolve(width, height)
|
||||
?: zeroRadii,
|
||||
width = width,
|
||||
height = height,
|
||||
|
||||
+2
-2
@@ -88,13 +88,13 @@ class BorderRadiusStyleTest {
|
||||
arrayOf(
|
||||
BorderRadiusProp.BORDER_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_RIGHT_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_START_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_END_RADIUS,
|
||||
BorderRadiusProp.BORDER_END_END_RADIUS),
|
||||
ComputedBorderRadiusProp.COMPUTED_BORDER_BOTTOM_RIGHT_RADIUS to
|
||||
arrayOf(
|
||||
BorderRadiusProp.BORDER_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_LEFT_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_END_RADIUS,
|
||||
BorderRadiusProp.BORDER_BOTTOM_START_RADIUS,
|
||||
BorderRadiusProp.BORDER_START_END_RADIUS),
|
||||
)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace facebook::react {
|
||||
constexpr struct {
|
||||
int32_t Major = 0;
|
||||
int32_t Minor = 78;
|
||||
int32_t Patch = 2;
|
||||
int32_t Patch = 3;
|
||||
std::string_view Prerelease = "";
|
||||
} ReactNativeVersion;
|
||||
|
||||
|
||||
@@ -300,8 +300,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
|
||||
}
|
||||
|
||||
if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
|
||||
// Do not throw any error to match web spec
|
||||
return timerIndex_++;
|
||||
// Do not throw any error to match web spec; instead return 0, an
|
||||
// invalid timer id
|
||||
return 0;
|
||||
}
|
||||
|
||||
auto callback = args[0].getObject(rt).getFunction(rt);
|
||||
@@ -358,8 +359,9 @@ void TimerManager::attachGlobals(jsi::Runtime& runtime) {
|
||||
}
|
||||
|
||||
if (!args[0].isObject() || !args[0].asObject(rt).isFunction(rt)) {
|
||||
throw jsi::JSError(
|
||||
rt, "The first argument to setInterval must be a function.");
|
||||
// Do not throw any error to match web spec; instead return 0, an
|
||||
// invalid timer id
|
||||
return 0;
|
||||
}
|
||||
auto callback = args[0].getObject(rt).getFunction(rt);
|
||||
auto delay = count > 1
|
||||
|
||||
@@ -93,7 +93,9 @@ class TimerManager {
|
||||
|
||||
// Each timeout that is registered on this queue gets a sequential id. This
|
||||
// is the global count from which those are assigned.
|
||||
TimerHandle timerIndex_{0};
|
||||
// As per WHATWG HTML 8.6.1 (Timers) ids must be greater than zero, i.e. start
|
||||
// at 1
|
||||
TimerHandle timerIndex_{1};
|
||||
|
||||
// The React Native microtask queue is used to back public APIs including
|
||||
// `queueMicrotask`, `clearImmediate`, and `setImmediate` (which is used by
|
||||
|
||||
@@ -267,7 +267,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithoutDelay) {
|
||||
EXPECT_CALL(
|
||||
*mockRegistry_,
|
||||
createTimer(_, 0)); // If delay is not provided, it should use 0
|
||||
eval("setTimeout(() => {});");
|
||||
auto val = eval("setTimeout(() => {});");
|
||||
expectNoError();
|
||||
EXPECT_EQ(val.asNumber(), 1); // First timer id should start at 1
|
||||
}
|
||||
|
||||
TEST_F(ReactInstanceTest, testSetTimeoutWithPassThroughArgs) {
|
||||
@@ -299,8 +301,9 @@ TEST_F(ReactInstanceTest, testSetTimeoutWithInvalidArgs) {
|
||||
getErrorMessage("setTimeout();"),
|
||||
"setTimeout must be called with at least one argument (the function to call).");
|
||||
|
||||
eval("setTimeout('invalid');");
|
||||
auto val = eval("setTimeout('invalid')");
|
||||
expectNoError();
|
||||
EXPECT_EQ(val.asNumber(), 0);
|
||||
|
||||
eval("setTimeout(() => {}, 'invalid');");
|
||||
expectNoError();
|
||||
@@ -417,9 +420,10 @@ TEST_F(ReactInstanceTest, testSetIntervalWithInvalidArgs) {
|
||||
EXPECT_EQ(
|
||||
getErrorMessage("setInterval();"),
|
||||
"setInterval must be called with at least one argument (the function to call).");
|
||||
EXPECT_EQ(
|
||||
getErrorMessage("setInterval('invalid', 100);"),
|
||||
"The first argument to setInterval must be a function.");
|
||||
|
||||
auto val = eval("setInterval('invalid', 100)");
|
||||
expectNoError();
|
||||
EXPECT_EQ(val.asNumber(), 0);
|
||||
}
|
||||
|
||||
TEST_F(ReactInstanceTest, testClearInterval) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "A framework for building native apps using React",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -108,13 +108,13 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/create-cache-key-function": "^29.6.3",
|
||||
"@react-native/assets-registry": "0.78.2",
|
||||
"@react-native/codegen": "0.78.2",
|
||||
"@react-native/community-cli-plugin": "0.78.2",
|
||||
"@react-native/gradle-plugin": "0.78.2",
|
||||
"@react-native/js-polyfills": "0.78.2",
|
||||
"@react-native/normalize-colors": "0.78.2",
|
||||
"@react-native/virtualized-lists": "0.78.2",
|
||||
"@react-native/assets-registry": "0.78.3",
|
||||
"@react-native/codegen": "0.78.3",
|
||||
"@react-native/community-cli-plugin": "0.78.3",
|
||||
"@react-native/gradle-plugin": "0.78.3",
|
||||
"@react-native/js-polyfills": "0.78.3",
|
||||
"@react-native/normalize-colors": "0.78.3",
|
||||
"@react-native/virtualized-lists": "0.78.3",
|
||||
"abort-controller": "^3.0.0",
|
||||
"anser": "^1.4.9",
|
||||
"ansi-regex": "^5.0.0",
|
||||
|
||||
@@ -324,22 +324,13 @@ function findExternalLibraries(pkgJson, projectRoot) {
|
||||
});
|
||||
}
|
||||
|
||||
function findLibrariesFromReactNativeConfig(projectRoot) {
|
||||
const rnConfigFileName = 'react-native.config.js';
|
||||
|
||||
function findLibrariesFromReactNativeConfig(projectRoot, rnConfig) {
|
||||
codegenLog(
|
||||
`Searching for codegen-enabled libraries in ${rnConfigFileName}`,
|
||||
`Searching for codegen-enabled libraries in react-native.config.js`,
|
||||
true,
|
||||
);
|
||||
|
||||
const rnConfigFilePath = path.resolve(projectRoot, rnConfigFileName);
|
||||
|
||||
if (!fs.existsSync(rnConfigFilePath)) {
|
||||
return [];
|
||||
}
|
||||
const rnConfig = require(rnConfigFilePath);
|
||||
|
||||
if (rnConfig.dependencies == null) {
|
||||
if (!rnConfig.dependencies) {
|
||||
return [];
|
||||
}
|
||||
return Object.keys(rnConfig.dependencies).flatMap(name => {
|
||||
@@ -591,7 +582,7 @@ function mustGenerateNativeCode(includeLibraryPath, schemaInfo) {
|
||||
);
|
||||
}
|
||||
|
||||
function findCodegenEnabledLibraries(pkgJson, projectRoot) {
|
||||
function findCodegenEnabledLibraries(pkgJson, projectRoot, reactNativeConfig) {
|
||||
const projectLibraries = findProjectRootLibraries(pkgJson, projectRoot);
|
||||
if (pkgJsonIncludesGeneratedCode(pkgJson)) {
|
||||
return projectLibraries;
|
||||
@@ -599,7 +590,7 @@ function findCodegenEnabledLibraries(pkgJson, projectRoot) {
|
||||
return [
|
||||
...projectLibraries,
|
||||
...findExternalLibraries(pkgJson, projectRoot),
|
||||
...findLibrariesFromReactNativeConfig(projectRoot),
|
||||
...findLibrariesFromReactNativeConfig(projectRoot, reactNativeConfig),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -924,9 +915,14 @@ function execute(projectRoot, targetPlatform, baseOutputPath, source) {
|
||||
|
||||
buildCodegenIfNeeded();
|
||||
|
||||
const libraries = findCodegenEnabledLibraries(pkgJson, projectRoot);
|
||||
const reactNativeConfig = readReactNativeConfig(projectRoot);
|
||||
const codegenEnabledLibraries = findCodegenEnabledLibraries(
|
||||
pkgJson,
|
||||
projectRoot,
|
||||
reactNativeConfig,
|
||||
);
|
||||
|
||||
if (libraries.length === 0) {
|
||||
if (codegenEnabledLibraries.length === 0) {
|
||||
codegenLog('No codegen-enabled libraries found.', true);
|
||||
return;
|
||||
}
|
||||
@@ -935,6 +931,18 @@ function execute(projectRoot, targetPlatform, baseOutputPath, source) {
|
||||
targetPlatform === 'all' ? supportedPlatforms : [targetPlatform];
|
||||
|
||||
for (const platform of platforms) {
|
||||
const disabledLibraries = findDisabledLibrariesByPlatform(
|
||||
reactNativeConfig,
|
||||
platform,
|
||||
);
|
||||
const libraries = codegenEnabledLibraries.filter(
|
||||
({name}) => !disabledLibraries.includes(name),
|
||||
);
|
||||
|
||||
if (!libraries.length) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const outputPath = computeOutputPath(
|
||||
projectRoot,
|
||||
baseOutputPath,
|
||||
@@ -970,6 +978,29 @@ function execute(projectRoot, targetPlatform, baseOutputPath, source) {
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all disabled libraries by platform based the react native config.
|
||||
*
|
||||
* This is needed when selectively disabling libraries in react-native.config.js since codegen should exclude those libraries as well.
|
||||
*/
|
||||
function findDisabledLibrariesByPlatform(reactNativeConfig, platform) {
|
||||
const dependencies = reactNativeConfig.dependencies ?? {};
|
||||
|
||||
return Object.keys(dependencies).filter(
|
||||
dependency => dependencies[dependency].platforms?.[platform] === null,
|
||||
);
|
||||
}
|
||||
|
||||
function readReactNativeConfig(projectRoot) {
|
||||
const rnConfigFilePath = path.resolve(projectRoot, 'react-native.config.js');
|
||||
|
||||
if (!fs.existsSync(rnConfigFilePath)) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return require(rnConfigFilePath);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
execute,
|
||||
generateRNCoreComponentsIOS,
|
||||
|
||||
@@ -10,3 +10,6 @@ gem 'rexml'
|
||||
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
|
||||
gem 'xcodeproj', '< 1.26.0'
|
||||
gem 'concurrent-ruby', '< 1.3.4'
|
||||
gem 'bigdecimal'
|
||||
gem 'logger'
|
||||
gem 'benchmark'
|
||||
|
||||
+289
-289
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/tester",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"private": true,
|
||||
"description": "React Native tester app.",
|
||||
"license": "MIT",
|
||||
@@ -27,8 +27,8 @@
|
||||
"e2e-test-ios": "./scripts/maestro-test-ios.sh"
|
||||
},
|
||||
"dependencies": {
|
||||
"@react-native/oss-library-example": "0.78.2",
|
||||
"@react-native/popup-menu-android": "0.78.2",
|
||||
"@react-native/oss-library-example": "0.78.3",
|
||||
"@react-native/popup-menu-android": "0.78.3",
|
||||
"flow-enums-runtime": "^0.0.6",
|
||||
"invariant": "^2.2.4",
|
||||
"nullthrows": "^1.1.1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/typescript-config",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Default TypeScript configuration for React Native apps",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@react-native/virtualized-lists",
|
||||
"version": "0.78.2",
|
||||
"version": "0.78.3",
|
||||
"description": "Virtualized lists for React Native.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
@@ -68,7 +68,7 @@ function publishAndroidArtifactsToMaven(
|
||||
// -------- For stable releases, we also need to close and release the staging repository.
|
||||
if (
|
||||
exec(
|
||||
'./gradlew findSonatypeStagingRepository closeAndReleaseSonatypeStagingRepository',
|
||||
'./gradlew publishAndroidToSonatype closeAndReleaseSonatypeStagingRepository',
|
||||
).code
|
||||
) {
|
||||
echo(
|
||||
|
||||
Reference in New Issue
Block a user