Skip to content

Commit

Permalink
chore: Align with react-native@0.74 as oldest supported version (#6629)
Browse files Browse the repository at this point in the history
  • Loading branch information
tjzel authored Nov 5, 2024
1 parent 394c0b3 commit 208a96d
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/example-tvos-build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ jobs:
bundle exec pod install
- name: Build app
working-directory: ${{ env.WORKING_DIRECTORY }}
run: yarn react-native-tvos run-ios --no-packager --scheme TVOSExample-tvOS --simulator "Apple TV"
working-directory: ${{ env.WORKING_DIRECTORY }}/ios
run: xcodebuild -workspace TVOSExample.xcworkspace -configuration Debug -scheme TVOSExample -destination "generic/platform=tvOS Simulator" -quiet
10 changes: 5 additions & 5 deletions .github/workflows/reanimated-compatibility-check-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
# Update it when dropping support for RN versions.
react-native:
[
{ version: '0.72', architecture: 'Paper' },
{ version: '0.73', architecture: 'Paper' },
{ version: '0.74', architecture: 'Paper' },
{ version: '0.74', architecture: 'Fabric' },
{ version: '0.75', architecture: 'Paper' },
{ version: '0.75', architecture: 'Fabric' },
{ version: '0.76', architecture: 'Paper' },
{ version: '0.76', architecture: 'Fabric' },
]
fail-fast: false
env:
Expand Down Expand Up @@ -57,15 +57,15 @@ jobs:
- name: Install Pods
if: ${{ matrix.platform == 'iOS' }}
working-directory: ${{ env.APP_NAME }}/ios
run: bundle install && bundle exec pod install
run: bundle install && bundle exec pod update
- name: Setup Fabric (Android)
if: ${{ matrix.platform == 'Android' && matrix.react-native.architecture == 'Fabric' }}
working-directory: ${{ env.APP_NAME }}/android
run: sed -i 's/newArchEnabled=false/newArchEnabled=true/' gradle.properties
- name: Build app (iOS)
if: ${{ matrix.platform == 'iOS' }}
working-directory: ${{ env.APP_NAME }}
run: yarn react-native run-ios --simulator='iPhone 14' --terminal='Terminal'--mode=${{ matrix.mode }}
working-directory: ${{ env.APP_NAME }}/ios
run: xcodebuild -workspace ${{env.APP_NAME}}.xcworkspace -configuration ${{matrix.mode}} -scheme ${{env.APP_NAME}} -destination "generic/platform=iOS Simulator" -quiet
- name: Build app (Android)
if: ${{ matrix.platform == 'Android' }}
working-directory: ${{ env.APP_NAME }}/android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
# TODO: Fetch versions from common source.
react-native-version: ['0.72', '0.73', '0.74', '0.75', nightly]
react-native-version: ['0.74', '0.75', '0.76', nightly]
fail-fast: false
concurrency:
group: TS-react-native-nightly-${{ matrix.react-native-version }}-${{ github.ref }}
Expand Down
8 changes: 4 additions & 4 deletions apps/fabric-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNSVG (15.8.0-rc.1):
- RNSVG (15.8.0):
- DoubleConversion
- glog
- hermes-engine
Expand All @@ -1899,9 +1899,9 @@ PODS:
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNSVG/common (= 15.8.0-rc.1)
- RNSVG/common (= 15.8.0)
- Yoga
- RNSVG/common (15.8.0-rc.1):
- RNSVG/common (15.8.0):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2231,7 +2231,7 @@ SPEC CHECKSUMS:
RNGestureHandler: fc5ce5bf284640d3af6431c3a5c3bc121e98d045
RNReanimated: 2db902281618797873d75426f334ede4e503baf8
RNScreens: e389d6a6a66a4f0d3662924ecae803073ccce8ec
RNSVG: 08750404f92a36162a92522cc77dee437be1d257
RNSVG: 536cd3c866c878faf72beaba166c8b02fe2b762b
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: db69236006b8b1c6d55ab453390c882306cbf219

Expand Down
4 changes: 2 additions & 2 deletions apps/paper-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNSVG (15.8.0-rc.1):
- RNSVG (15.8.0):
- React-Core
- SocketRocket (0.7.1)
- Yoga (0.0.0)
Expand Down Expand Up @@ -2021,7 +2021,7 @@ SPEC CHECKSUMS:
RNGestureHandler: 511250b190a284388f9dd0d2e56c1df76f14cfb8
RNReanimated: 9ef3b1908a15b0b778edd6dacad9c71e7fe9e849
RNScreens: c7ceced6a8384cb9be5e7a5e88e9e714401fd958
RNSVG: 01eb8d8a0e2289ec3ecc9626ce920e00d2174992
RNSVG: 8b1a777d54096b8c2a0fd38fc9d5a454332bbb4d
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
Yoga: db69236006b8b1c6d55ab453390c882306cbf219

Expand Down
4 changes: 3 additions & 1 deletion packages/docs-reanimated/docs/guides/compatibility.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ sidebar_label: Compatibility

| | 0.63 | 0.64 | 0.65 | 0.66 | 0.67 | 0.68 | 0.69 | 0.70 | 0.71 | 0.72 | 0.73 | 0.74 | 0.75 | 0.76 |
| ------------------------------------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ | ------ |
| <Version version="3.17.0-nightly"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <Yes/> | <Yes/> |
| <Version version="3.16.x"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <Yes/> | <Yes/> | <Yes/> |
| <Version version="3.15.x"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <Yes/> | <Yes/> | <Yes/> | <No/> |
| <Version version="3.9.x – 3.14.x"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <Yes/> | <Yes/> | <Yes/> | <No/> | <No/> |
Expand All @@ -33,14 +34,15 @@ Reanimated 2 won't receive support for newest React Native versions. To get the

### Supported React Native versions on the New Architecture (Fabric)

To use Reanimated with [the experimental New Architecture](https://reactnative.dev/docs/the-new-architecture/landing-page), update the package to at least version 3.0.0. Due to the vast number of breaking-changes related to the New Architecture in each React Native version, as a rule of thumb Reanimated supports the latest stable version of React Native.
To use Reanimated with [the New Architecture](https://reactnative.dev/docs/the-new-architecture/landing-page), update the package to at least version 3.0.0.

Reanimated supports the [bridgeless mode](https://github.com/reactwg/react-native-new-architecture/discussions/154).

<div className="compatibility">

| | 0.63 | 0.64 | 0.65 | 0.66 | 0.67 | 0.68 | 0.69 | 0.70 | 0.71 | 0.72 | 0.73 | 0.74 | 0.75 | 0.76 |
| ----------------------------------- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ----- | ------ | ------ | ------ | ------ | ------ | ------ |
| <Version version="3.17.0-nightly"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <Yes/> | <Yes/> |
| <Version version="3.16.x"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <Yes/> | <Yes/> |
| <Version version="3.15.x"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <Yes/> | <No/> |
| <Version version="3.9.x – 3.14.x"/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <No/> | <Yes/> | <No/> | <No/> |
Expand Down
12 changes: 4 additions & 8 deletions packages/react-native-reanimated/RNReanimated.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ require_relative './scripts/reanimated_utils'

reanimated_package_json = JSON.parse(File.read(File.join(__dir__, "package.json")))
$config = find_config()
assert_latest_react_native_with_new_architecture($config, reanimated_package_json)
assert_minimal_react_native_version($config)

$new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
Expand All @@ -16,7 +15,7 @@ fabric_flags = $new_arch_enabled ? '-DRCT_NEW_ARCH_ENABLED' : ''
example_flag = $config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : ''
version_flag = "-DREANIMATED_VERSION=#{reanimated_package_json['version']}"
debug_flag = is_release ? '-DNDEBUG' : ''
ios_min_version = $config[:react_native_minor_version] >= 73 ? '13.4' : '9.0'
ios_min_version = '13.4'

# Directory in which data for further processing for clangd will be stored.
compilation_metadata_dir = "CompilationDatabase"
Expand All @@ -34,9 +33,6 @@ def self.install_modules_dependencies_legacy(s)
s.dependency "RCTRequired"
s.dependency "RCTTypeSafety"
s.dependency 'FBLazyVector'
if $config[:react_native_minor_version] <= 71
s.dependency 'FBReactNativeSpec'
end
s.dependency 'React-Core'
s.dependency 'React-CoreModules'
s.dependency 'React-Core/DevSupport'
Expand All @@ -58,12 +54,12 @@ def self.install_modules_dependencies_legacy(s)
s.dependency 'Yoga'
s.dependency 'DoubleConversion'
s.dependency 'glog'
if using_hermes && !$config[:is_tvos_target] && $config[:react_native_minor_version] >= 70
if using_hermes && !$config[:is_tvos_target]
s.dependency 'React-hermes'
s.dependency 'hermes-engine'
end
s.dependency 'React-callinvoker'
if $config[:react_native_minor_version] >= 72 && !$new_arch_enabled
if !$new_arch_enabled
s.dependency 'React-RCTAppDelegate'
end
end
Expand Down Expand Up @@ -101,7 +97,7 @@ Pod::Spec.new do |s|
end

gcc_debug_definitions = "$(inherited)"
if $config[:react_native_minor_version] >= 73 || !is_release
if !is_release
gcc_debug_definitions << " HERMES_ENABLE_DEBUGGER=1"
end

Expand Down
31 changes: 11 additions & 20 deletions packages/react-native-reanimated/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ buildscript {
}
}
dependencies {
classpath "com.android.tools.build:gradle:7.3.1"
classpath "de.undercouch:gradle-download-task:5.0.1"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.11.0"
classpath "com.android.tools.build:gradle:8.2.1"
classpath "de.undercouch:gradle-download-task:5.6.0"
classpath "com.diffplug.spotless:spotless-plugin-gradle:6.25.0"
}
}

Expand All @@ -211,7 +211,7 @@ apply plugin: "maven-publish"
apply plugin: "de.undercouch.download"

android {
compileSdkVersion safeExtGet("compileSdkVersion", 30)
compileSdkVersion safeExtGet("compileSdkVersion", 34)

def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
Expand Down Expand Up @@ -241,8 +241,8 @@ android {
}

defaultConfig {
minSdkVersion safeExtGet("minSdkVersion", 16)
targetSdkVersion safeExtGet("targetSdkVersion", 30)
minSdkVersion safeExtGet("minSdkVersion", 23)
targetSdkVersion safeExtGet("targetSdkVersion", 34)
versionCode 1
versionName "1.0"
buildConfigField("boolean", "IS_NEW_ARCHITECTURE_ENABLED", IS_NEW_ARCHITECTURE_ENABLED.toString())
Expand Down Expand Up @@ -435,21 +435,12 @@ android {
}
}

def assertLatestReactNativeWithNewArchitecture = task assertLatestReactNativeWithNewArchitectureTask {
onlyIf { IS_NEW_ARCHITECTURE_ENABLED && REANIMATED_MAJOR_VERSION == 3 && REACT_NATIVE_MINOR_VERSION < 74 }
doFirst {
// If you change the minimal React Native version remember to update Compatibility Table in docs
throw new GradleException(
"[Reanimated] Outdated version of React Native for New Architecture. Reanimated " + REANIMATED_VERSION + " supports the New Architecture on React Native 0.74.0+. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#outdated-version-of-react-native-for-new-architecture for more information."
)
}
}

def assertMinimalReactNativeVersion = task assertMinimalReactNativeVersionTask {
onlyIf { REACT_NATIVE_MINOR_VERSION < 71 }
// If you change the minimal React Native version remember to update Compatibility Table in docs
def minimalReactNativeVersion = 74
onlyIf { REACT_NATIVE_MINOR_VERSION < minimalReactNativeVersion }
doFirst {
// If you change the minimal React Native version remember to update Compatibility Table in docs
throw new GradleException("[Reanimated] Unsupported React Native version. Please use 0.71 or newer.")
throw new GradleException("[Reanimated] Unsupported React Native version. Please use $minimalReactNativeVersion. or newer.")
}
}

Expand All @@ -468,7 +459,7 @@ task prepareReanimatedHeadersForPrefabs(type: Copy) {
}

tasks.preBuild {
dependsOn assertLatestReactNativeWithNewArchitecture, assertMinimalReactNativeVersion
dependsOn assertMinimalReactNativeVersion
}

task cleanCmakeCache() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 4 additions & 14 deletions packages/react-native-reanimated/scripts/reanimated_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,10 @@ def find_config()
return result
end

def assert_latest_react_native_with_new_architecture(config, reanimated_package_json)
reanimated_version = reanimated_package_json['version']
reanimated_major_version = reanimated_version.split('.')[0].to_i
react_native_minor_version = config[:react_native_minor_version]
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
if fabric_enabled && reanimated_major_version == 3 && react_native_minor_version < 74
# If you change the minimal React Native version remember to update Compatibility Table in docs
raise "[Reanimated] Outdated version of React Native for New Architecture. Reanimated " + reanimated_version + " supports the New Architecture on React Native 0.74.0+. See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#outdated-version-of-react-native-for-new-architecture for more information."
end
end

def assert_minimal_react_native_version(config)
if config[:react_native_minor_version] < 71
# If you change the minimal React Native version remember to update Compatibility Table in docs
raise "[Reanimated] Unsupported React Native version. Please use 0.71 or newer."
# If you change the minimal React Native version remember to update Compatibility Table in docs
minimalReactNativeVersion = 74
if config[:react_native_minor_version] < minimalReactNativeVersion
raise "[Reanimated] Unsupported React Native version. Please use #{minimalReactNativeVersion} or newer."
end
end

0 comments on commit 208a96d

Please sign in to comment.