Skip to content

Commit 7c12220

Browse files
Release: v5.0.0 - new architecture only (#709)
* New arch only for iOS * New arch only for Android * Do not build old arch in CI * Upgrade the example app to react-native v19 for iOS * Upgrage the example app to react-native v19 for Android * Inlcude kotlin dir in the gitignore * Fix the JSX import * Update version of the package * Fix the import in Props * Update the package version in examples * Update the Pods for the v5 * Update the compatibility table in README * Remove the Fabric setup of example - new arch is default now * Temporarily remove the Windows example build check
1 parent d60525d commit 7c12220

39 files changed

+6332
-8799
lines changed

.github/workflows/ReactNativeSlider-CI.yml

Lines changed: 4 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -89,38 +89,10 @@ jobs:
8989
- name: Run TypeScript on the sources
9090
run: cd example && npx tsc --noEmit
9191

92-
build-android-app-old-arch:
93-
name: Build example app Android
94-
runs-on: ubuntu-latest
95-
needs: [verify-example-sources]
96-
97-
steps:
98-
- uses: actions/checkout@v4
99-
100-
- name: Pull the npm dependencies
101-
run: npm install
102-
103-
- uses: actions/setup-java@v4
104-
with:
105-
distribution: 'zulu'
106-
java-version: '17'
107-
108-
- name: Use old arch config
109-
id: cache-old-arch-gradle
110-
uses: actions/cache@v4
111-
env:
112-
cache-name: cached-gradle-old-arch-prop
113-
with:
114-
path: example/android/gradle.properties
115-
key: gradle-prop-old-arch-config
116-
117-
- name: Build the Android OS app
118-
run: cd example/android && ./gradlew assembleDebug
119-
12092
build-android-app-new-arch:
12193
name: Build example app Android (Fabric)
12294
runs-on: ubuntu-latest
123-
needs: [build-android-app-old-arch]
95+
needs: [verify-example-sources]
12496

12597
steps:
12698
- uses: actions/checkout@v4
@@ -136,58 +108,10 @@ jobs:
136108
- name: Build the Android OS app
137109
run: cd example/android && ./gradlew assembleDebug
138110

139-
build-iOS-app:
140-
name: Build example app iOS
141-
runs-on: macos-latest
142-
needs: [verify-example-sources]
143-
steps:
144-
- uses: actions/checkout@v4
145-
146-
- name: Cache node modules
147-
id: cache-npm
148-
uses: actions/cache@v4
149-
env:
150-
cache-name: cached-ios-npm-deps
151-
with:
152-
path: example/node_modules
153-
key: ${{ hashFiles('./example/package-lock.json') }}-${{ hashFiles('./package/package-lock.json') }}
154-
155-
- name: Install required dependencies on cache miss (npm)
156-
if: steps.cache-npm.outputs.cache-hit != 'true'
157-
run: |
158-
npm install
159-
160-
- name: Cache Pods
161-
id: cache-pods
162-
uses: actions/cache@v4
163-
env:
164-
cache-name: cached-ios-pods-deps
165-
with:
166-
path: example/ios/Pods
167-
key: ${{ hashFiles('./example/ios/Podfile.lock') }}
168-
169-
- name: Install required dependencies on cache miss (Pods)
170-
if: steps.cache-pods.outputs.cache-hit != 'true'
171-
run: |
172-
cd example/ios && pod install
173-
174-
- name: Reinstall Pods only if using cached ones
175-
if: steps.cache-pods.outputs.cache-hit == 'true'
176-
run: cd example/ios && pod install
177-
178-
- name: Use the current package sources in build
179-
run: cd example && npm run refresh-package
180-
181-
- name: Build iOS
182-
run: |
183-
xcodebuild -workspace example.xcworkspace -scheme example -destination "platform=iOS Simulator" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO SKIP_BUNDLING=TRUE build | xcbeautify --renderer github-actions
184-
working-directory: example/ios
185-
186-
187111
build-iOS-new-arch-app:
188112
name: Build example app iOS (Fabric)
189113
runs-on: macos-latest
190-
needs: [build-iOS-app]
114+
needs: [verify-example-sources]
191115
steps:
192116
- uses: actions/checkout@v4
193117

@@ -220,34 +144,13 @@ jobs:
220144
- name: Install required dependencies on cache miss (Pods)
221145
if: steps.cache-pods.outputs.cache-hit != 'true'
222146
run: |
223-
cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install
147+
cd example/ios && pod install
224148
225149
- name: Reinstall Pods only if using cached ones
226150
if: steps.cache-pods.outputs.cache-hit == 'true'
227-
run: cd example/ios && RCT_NEW_ARCH_ENABLED=1 pod install
151+
run: cd example/ios && pod install
228152

229153
- name: Build iOS - Fabric
230154
run: |
231155
xcodebuild -workspace example.xcworkspace -scheme example -destination "platform=iOS Simulator" CODE_SIGNING_ALLOWED=NO COMPILER_INDEX_STORE_ENABLE=NO SKIP_BUNDLING=TRUE build | xcbeautify --renderer github-actions
232156
working-directory: example/ios
233-
234-
235-
build-Windows-app:
236-
name: Build example app Windows
237-
runs-on: windows-2022
238-
needs: [verify-example-sources]
239-
steps:
240-
- name: Ensure the cross-platform Git on Windows
241-
run: git config --global core.autocrlf false
242-
243-
- name: Checkout repository
244-
uses: actions/checkout@v4
245-
246-
- name: Install dependencies
247-
run: npm install
248-
249-
- name: Restore NuGet packages
250-
run: nuget restore .\example\windows\example.sln
251-
252-
- name: Build the Windows OS app
253-
run: cd example; npx react-native run-windows --arch x64 --no-launch --no-deploy --logging --sln .\windows\example.sln --proj .\windows\example\example.vcxproj

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ buck-out/
4747
\.buckd/
4848
*.keystore
4949
!debug.keystore
50+
.kotlin/
5051

5152
# fastlane
5253
#

README.md

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ To use this library you need to ensure you are using the correct version of Reac
6161

6262
| `@react-native-community/slider` version | Required React Native Version |
6363
| ---------------------------------------- | ---------------------------- |
64+
| `5.0.0` | `>=0.76` |
6465
| `4.5.1` | `>=0.69` |
6566
| `4.3.0` | `>=0.64` |
6667
| `4.x.x` | `>=0.60`; `>=0.62` (on Windows); |
@@ -225,59 +226,6 @@ You can also do this manually by:
225226
- Installing pods for iOS app
226227
- Running example app like always: `npx react-native run-<platform>`
227228

228-
### New architecture setup (Fabric)
229-
230-
In order to use the new architecture some extra steps are needed.
231-
#### iOS
232-
- Install pods with new arch flag inside `example/ios` folder: `RCT_NEW_ARCH_ENABLED=1 pod install`
233-
- Run `npm run example-ios`
234-
235-
#### Android
236-
- Set `newArchEnabled` to true inside `example/android/gradle.properties`
237-
- Run `npm run example-android`
238-
239-
<details>
240-
<summary>
241-
If you are using React Native version lower than 0.70, you need to setup manual linking for Android to work.
242-
</summary>
243-
244-
Inside `example/android/app/src/main/jni/Android.mk` add these lines:
245-
246-
```diff
247-
+ include $(NODE_MODULES_DIR)/@react-native-community/slider/android/build/generated/source/codegen/jni/Android.mk
248-
include $(CLEAR_VARS)
249-
```
250-
251-
```diff
252-
libreact_codegen_rncore \
253-
+ libreact_codegen_ReactSlider \
254-
libreact_debug \
255-
```
256-
257-
Inside `example/android/app/src/main/jni/MainComponentsRegistry.cpp` update these lines:
258-
259-
```diff
260-
#include <react/renderer/components/rncore/ComponentDescriptors.h>
261-
+ #include <react/renderer/components/ReactSlider/ComponentDescriptors.h>
262-
263-
...
264-
265-
MainComponentsRegistry::sharedProviderRegistry() {
266-
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
267-
268-
// Custom Fabric Components go here. You can register custom
269-
// components coming from your App or from 3rd party libraries here.
270-
//
271-
// providerRegistry->add(concreteComponentDescriptorProvider<
272-
// AocViewerComponentDescriptor>());
273-
+ providerRegistry->add(concreteComponentDescriptorProvider<RNCSliderComponentDescriptor>());
274-
275-
return providerRegistry;
276-
}
277-
```
278-
279-
</details>
280-
281229
## Maintainers
282230

283231
- [Bartosz Klonowski](https://github.com/BartoszKlonowski) - [Callstack](https://callstack.com/)

example/Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,10 @@ ruby ">= 2.6.10"
77
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
88
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
99
gem 'xcodeproj', '< 1.26.0'
10+
gem 'concurrent-ruby', '< 1.3.4'
11+
12+
# Ruby 3.4.0 has removed some libraries from the standard library.
13+
gem 'bigdecimal'
14+
gem 'logger'
15+
gem 'benchmark'
16+
gem 'mutex_m'

example/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ def enableProguardInReleaseBuilds = false
6262
* The preferred build flavor of JavaScriptCore (JSC)
6363
*
6464
* For example, to use the international variant, you can use:
65-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
65+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
6666
*
6767
* The international variant includes ICU i18n library and necessary data
6868
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
6969
* give correct results when using with locales other than en-US. Note that
7070
* this variant is about 6MiB larger per architecture than default.
7171
*/
72-
def jscFlavor = 'org.webkit:android-jsc:+'
72+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
7373

7474
android {
7575
ndkVersion rootProject.ext.ndkVersion

example/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ buildscript {
33
buildToolsVersion = "35.0.0"
44
minSdkVersion = 24
55
compileSdkVersion = 35
6-
targetSdkVersion = 34
7-
ndkVersion = "26.1.10909125"
8-
kotlinVersion = "1.9.24"
6+
targetSdkVersion = 35
7+
ndkVersion = "27.1.12297006"
8+
kotlinVersion = "2.0.21"
99
}
1010
repositories {
1111
google()
122 Bytes
Binary file not shown.

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/android/gradlew

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
206205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207206

208207
# Collect all arguments for the java command:
209-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210209
# and any embedded shellness will be escaped.
211210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212211
# treated as '${Hostname}' itself on the command line.

example/ios/Podfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ target 'example' do
2323
:app_path => "#{Pod::Config.instance.installation_root}/.."
2424
)
2525

26-
target 'exampleTests' do
27-
inherit! :complete
28-
# Pods for testing
29-
end
30-
3126
post_install do |installer|
3227
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
3328
react_native_post_install(

0 commit comments

Comments
 (0)