Skip to content

Commit 2d5e9d9

Browse files
authored
chore(example): Update example to rn0.74 (#829)
* Update example to react-native 0.74 * Update build flow for iOS * Fix workflow on android
1 parent bccd97d commit 2d5e9d9

34 files changed

+2973
-1710
lines changed

.github/workflows/android.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- uses: actions/setup-java@v4
4848
with:
4949
distribution: 'zulu'
50-
java-version: '11'
50+
java-version: '17'
5151

5252
- name: Gradle cache
5353
uses: actions/cache@v4

.github/workflows/ios.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,16 @@ concurrency:
2020

2121
jobs:
2222
ios-build:
23-
runs-on: macos-latest
23+
runs-on: macos-14
2424
steps:
2525
- uses: actions/checkout@v4
2626
- uses: ./.github/actions/install-dependencies
2727

28+
- name: Use latest stable Xcode
29+
uses: maxim-lobanov/setup-xcode@v1
30+
with:
31+
xcode-version: latest-stable
32+
2833
- name: Pull dependencies
2934
uses: actions/cache@v4
3035
with:
@@ -55,7 +60,7 @@ jobs:
5560
key: ${{ hashFiles('./example/ios/Podfile.lock') }}
5661

5762
- name: Install example Pods
58-
run: NO_FLIPPER=1 pod install
63+
run: pod install
5964
working-directory: example/ios
6065

6166
- name: Install Maestro CLI

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ DerivedData
2828
*.ipa
2929
*.xcuserstate
3030
project.xcworkspace
31+
**/.xcode.env.local
3132

3233
# Android/IJ
3334
#
@@ -71,3 +72,11 @@ lefthook.yml
7172
/coverage
7273
.cxx
7374
example/ios/PagerViewExample.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
75+
76+
# Yarn
77+
.yarn/*
78+
!.yarn/patches
79+
!.yarn/plugins
80+
!.yarn/releases
81+
!.yarn/sdks
82+
!.yarn/versions

android/src/main/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.reactnativepagerview">
2+
>
33

44
</manifest>

example/Gemfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@ source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
5-
gem 'cocoapods', '~> 1.12'
5+
6+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'

example/Gemfile.lock

+33-18
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,35 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.6)
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
57
rexml
6-
activesupport (7.0.7.2)
8+
activesupport (7.1.3.3)
9+
base64
10+
bigdecimal
711
concurrent-ruby (~> 1.0, >= 1.0.2)
12+
connection_pool (>= 2.2.5)
13+
drb
814
i18n (>= 1.6, < 2)
915
minitest (>= 5.1)
16+
mutex_m
1017
tzinfo (~> 2.0)
11-
addressable (2.8.5)
18+
addressable (2.8.6)
1219
public_suffix (>= 2.0.2, < 6.0)
1320
algoliasearch (1.27.5)
1421
httpclient (~> 2.8, >= 2.8.3)
1522
json (>= 1.5.1)
1623
atomos (0.1.3)
24+
base64 (0.2.0)
25+
bigdecimal (3.1.8)
1726
claide (1.1.0)
18-
cocoapods (1.12.1)
27+
cocoapods (1.14.3)
1928
addressable (~> 2.8)
2029
claide (>= 1.0.2, < 2.0)
21-
cocoapods-core (= 1.12.1)
30+
cocoapods-core (= 1.14.3)
2231
cocoapods-deintegrate (>= 1.0.3, < 2.0)
23-
cocoapods-downloader (>= 1.6.0, < 2.0)
32+
cocoapods-downloader (>= 2.1, < 3.0)
2433
cocoapods-plugins (>= 1.0.0, < 2.0)
2534
cocoapods-search (>= 1.0.0, < 2.0)
2635
cocoapods-trunk (>= 1.6.0, < 2.0)
@@ -32,8 +41,8 @@ GEM
3241
molinillo (~> 0.8.0)
3342
nap (~> 1.0)
3443
ruby-macho (>= 2.3.0, < 3.0)
35-
xcodeproj (>= 1.21.0, < 2.0)
36-
cocoapods-core (1.12.1)
44+
xcodeproj (>= 1.23.0, < 2.0)
45+
cocoapods-core (1.14.3)
3746
activesupport (>= 5.0, < 8)
3847
addressable (~> 2.8)
3948
algoliasearch (~> 1.0)
@@ -44,7 +53,7 @@ GEM
4453
public_suffix (~> 4.0)
4554
typhoeus (~> 1.0)
4655
cocoapods-deintegrate (1.0.5)
47-
cocoapods-downloader (1.6.3)
56+
cocoapods-downloader (2.1)
4857
cocoapods-plugins (1.0.0)
4958
nap
5059
cocoapods-search (1.0.1)
@@ -53,31 +62,37 @@ GEM
5362
netrc (~> 0.11)
5463
cocoapods-try (1.2.0)
5564
colored2 (3.1.2)
56-
concurrent-ruby (1.2.2)
65+
concurrent-ruby (1.2.3)
66+
connection_pool (2.4.1)
67+
drb (2.2.1)
5768
escape (0.0.4)
5869
ethon (0.16.0)
5970
ffi (>= 1.15.0)
60-
ffi (1.15.5)
71+
ffi (1.16.3)
6172
fourflusher (2.3.1)
6273
fuzzy_match (2.0.4)
6374
gh_inspector (1.1.3)
6475
httpclient (2.8.3)
65-
i18n (1.14.1)
76+
i18n (1.14.5)
6677
concurrent-ruby (~> 1.0)
67-
json (2.6.3)
68-
minitest (5.19.0)
78+
json (2.7.2)
79+
minitest (5.23.1)
6980
molinillo (0.8.0)
81+
mutex_m (0.2.0)
7082
nanaimo (0.3.0)
7183
nap (1.1.0)
7284
netrc (0.11.0)
85+
nkf (0.2.0)
7386
public_suffix (4.0.7)
74-
rexml (3.2.6)
87+
rexml (3.2.8)
88+
strscan (>= 3.0.9)
7589
ruby-macho (2.5.1)
76-
typhoeus (1.4.0)
90+
strscan (3.1.0)
91+
typhoeus (1.4.1)
7792
ethon (>= 0.9.0)
7893
tzinfo (2.0.6)
7994
concurrent-ruby (~> 1.0)
80-
xcodeproj (1.22.0)
95+
xcodeproj (1.24.0)
8196
CFPropertyList (>= 2.3.3, < 4.0)
8297
atomos (~> 0.1.3)
8398
claide (>= 1.0.2, < 2.0)
@@ -89,7 +104,7 @@ PLATFORMS
89104
ruby
90105

91106
DEPENDENCIES
92-
cocoapods (~> 1.12)
107+
cocoapods (>= 1.13, < 1.15)
93108

94109
RUBY VERSION
95110
ruby 2.7.5p203

example/android/app/build.gradle

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
import com.android.build.OutputFile
@@ -91,6 +92,7 @@ def reactNativeArchitectures() {
9192
android {
9293
ndkVersion rootProject.ext.ndkVersion
9394

95+
buildToolsVersion rootProject.ext.buildToolsVersion
9496
compileSdkVersion rootProject.ext.compileSdkVersion
9597

9698
namespace "com.pagerviewexample"
@@ -157,12 +159,6 @@ dependencies {
157159
implementation 'com.google.android.material:material:1.4.+'
158160
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
159161

160-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
161-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
162-
exclude group:'com.squareup.okhttp3', module:'okhttp'
163-
}
164-
165-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
166162
if (hermesEnabled.toBoolean()) {
167163
implementation("com.facebook.react:hermes-android")
168164
} else {

example/android/app/src/debug/AndroidManifest.xml

+1-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
75
<application
86
android:usesCleartextTraffic="true"
97
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
8+
tools:ignore="GoogleAppIndexingWarning"/>
139
</manifest>

example/android/app/src/debug/java/com/pagerviewexample/ReactNativeFlipper.java

-73
This file was deleted.

example/android/app/src/main/java/com/pagerviewexample/MainActivity.java

-38
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.pagerviewexample
2+
3+
import com.facebook.react.ReactActivity
4+
import com.facebook.react.ReactActivityDelegate
5+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6+
import com.facebook.react.defaults.DefaultReactActivityDelegate
7+
8+
9+
class MainActivity : ReactActivity() {
10+
11+
/**
12+
* Returns the name of the main component registered from JavaScript. This is used to schedule
13+
* rendering of the component.
14+
*/
15+
override fun getMainComponentName(): String = "PagerViewExample"
16+
17+
/**
18+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
19+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
20+
*/
21+
override fun createReactActivityDelegate(): ReactActivityDelegate =
22+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
23+
}

0 commit comments

Comments
 (0)