Skip to content

Commit

Permalink
feat: support React Native 0.76 (#753)
Browse files Browse the repository at this point in the history
* chore: upgrade to RN 0.76.0-rc.1

* fix: patch react-native (broken flow annotations)

* fix: make native code compatible with RN 0.76 reduction of .so libraries, update RNTA, update minSdkVersion

* fix: make DevServerClient comply with all required exports

* fix: upgrade deps in tester-federation (react-native-screens still incompatible)

* chore: updated pods in tester-app iOS project

* chore: updated dependencies of tester apps

* fix: proper CMakeLists.txt linkage

* chore: remove redundant babel plugins

* chore: pnpm dedupe

* chore: strip unnecessary dependencies

* fix: adjust CMakeLists as REACTNATIVE_MERGED_SO is not set for now

* fix: sanitize test asset path when react-native is patched

* fix: simplify regex, move configs to a separate dir

* fix: add babel-plugin-syntax-hermes-parser for now

* fix: path to config for start tests

* chore: track issue fixing REACTNATIVE_MERGED_SO

* chore: upgrade to RN 0.76.0-rc.2, remove to-be-unneeded patch for RN

* chore: upgrade flow-remove-types

* chore: update Podfile.lock files for tester apps

* chore: upgrade to RN to 76 rc3

* chore: cleanup in bundle tests

* chore: update podfile locks

* chore: upgrade related packages to rc.3

* fix: use hermes parser for codegen

* chore: remove Cmake workaround

* chore: update flow-remove-types

* chore: upgrade to RN to rc5

* refactor: remove unnecessary config from codegenRule

* chore: downgrade RNScreens to stable version, update requiredVersions in rspack configs, update podfile.lock

* fix: use version check instead of REACT_NATIVE_MERGED_SO flag

* chore: patch RNScreens

* chore: fix RNScreens patch

* chore: upgrade to rc6

* chore: pnpm dedupe

* chore: upgrade flow-remove-types to 2.250.0

* chore: fix rnscreens patch

* chore: add changset

---------

Co-authored-by: Jakub Romanczyk <[email protected]>
  • Loading branch information
artus9033 and jbroma authored Oct 18, 2024
1 parent f119ab3 commit 176324a
Show file tree
Hide file tree
Showing 26 changed files with 2,901 additions and 2,294 deletions.
5 changes: 5 additions & 0 deletions .changeset/proud-students-return.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@callstack/repack": minor
---

Add support for React Native 0.76
4 changes: 2 additions & 2 deletions apps/tester-app/__tests__/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const RELATIVE_REACT_NATIVE_PATH = path.relative(
const REACT_NATIVE_ANDROID_ASSET_PATH = RELATIVE_REACT_NATIVE_PATH.replaceAll(
path.sep,
'_'
).replaceAll(/[-.@+]/g, '');
).replaceAll(/[-.@+=]/g, '');

describe('bundle command', () => {
describe.each([
Expand Down Expand Up @@ -140,7 +140,7 @@ describe('bundle command', () => {
platform === 'ios' ? 'main.jsbundle' : `index.${platform}.bundle`
),
dev: false,
webpackConfig: path.join(__dirname, configFile),
webpackConfig: path.join(__dirname, 'configs', configFile),
};
process.env.TEST_WEBPACK_OUTPUT_DIR = TMP_DIR;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import baseConfig from '../rspack.config.mjs';
import baseConfig from '../../rspack.config.mjs';

export default (env) => {
const config = baseConfig(env);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
export default async (env) => {
const config = (await import('../webpack.config.mjs')).default(env);
const config = (await import('../../webpack.config.mjs')).default(env);
return {
...config,
cache: false,
output: {
...config.output,
path: process.env.TEST_WEBPACK_OUTPUT_DIR,
Expand Down
2 changes: 1 addition & 1 deletion apps/tester-app/__tests__/start.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('start command', () => {
platform,
silent: true,
logFile: path.join(TMP_DIR, 'server.log'),
webpackConfig: path.join(__dirname, configFile),
webpackConfig: path.join(__dirname, 'configs', configFile),
};

// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions apps/tester-app/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions apps/tester-app/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
Loading

0 comments on commit 176324a

Please sign in to comment.