Skip to content

Commit 2183711

Browse files
authored
Make osx example utilise the common example app (#3055)
## Description This PR makes the MacOS example utilise the common example app. This change will allow for more in-depth testing of MacOS functionalities. For now, it's still work in progress ## Test plan <!-- Describe how did you test this change here. -->
1 parent 10d154d commit 2183711

File tree

31 files changed

+2904
-1953
lines changed

31 files changed

+2904
-1953
lines changed

.github/workflows/macos-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
jobs:
1414
build:
1515
if: github.repository == 'software-mansion/react-native-gesture-handler'
16-
runs-on: macos-12
16+
runs-on: macos-15
1717
strategy:
1818
matrix:
1919
working-directory: [MacOSExample]
@@ -23,10 +23,10 @@ jobs:
2323
steps:
2424
- name: checkout
2525
uses: actions/checkout@v2
26-
- name: Use Node.js 16
26+
- name: Use Node.js 22
2727
uses: actions/setup-node@v2
2828
with:
29-
node-version: 16
29+
node-version: 22
3030
cache: 'yarn'
3131
- name: Install node dependencies
3232
working-directory: ${{ matrix.working-directory }}

MacOSExample/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.12'
6+
gem 'cocoapods', '~> 1.15.2'

MacOSExample/Gemfile.lock

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
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.1.3)
8+
activesupport (7.2.1)
79
base64
810
bigdecimal
9-
concurrent-ruby (~> 1.0, >= 1.0.2)
11+
concurrent-ruby (~> 1.0, >= 1.3.1)
1012
connection_pool (>= 2.2.5)
1113
drb
1214
i18n (>= 1.6, < 2)
15+
logger (>= 1.4.2)
1316
minitest (>= 5.1)
14-
mutex_m
15-
tzinfo (~> 2.0)
16-
addressable (2.8.6)
17-
public_suffix (>= 2.0.2, < 6.0)
17+
securerandom (>= 0.3)
18+
tzinfo (~> 2.0, >= 2.0.5)
19+
addressable (2.8.7)
20+
public_suffix (>= 2.0.2, < 7.0)
1821
algoliasearch (1.27.5)
1922
httpclient (~> 2.8, >= 2.8.3)
2023
json (>= 1.5.1)
2124
atomos (0.1.3)
2225
base64 (0.2.0)
23-
bigdecimal (3.1.6)
26+
bigdecimal (3.1.8)
2427
claide (1.1.0)
25-
cocoapods (1.14.2)
28+
cocoapods (1.15.2)
2629
addressable (~> 2.8)
2730
claide (>= 1.0.2, < 2.0)
28-
cocoapods-core (= 1.14.2)
31+
cocoapods-core (= 1.15.2)
2932
cocoapods-deintegrate (>= 1.0.3, < 2.0)
30-
cocoapods-downloader (>= 2.0)
33+
cocoapods-downloader (>= 2.1, < 3.0)
3134
cocoapods-plugins (>= 1.0.0, < 2.0)
3235
cocoapods-search (>= 1.0.0, < 2.0)
3336
cocoapods-trunk (>= 1.6.0, < 2.0)
@@ -40,7 +43,7 @@ GEM
4043
nap (~> 1.0)
4144
ruby-macho (>= 2.3.0, < 3.0)
4245
xcodeproj (>= 1.23.0, < 2.0)
43-
cocoapods-core (1.14.2)
46+
cocoapods-core (1.15.2)
4447
activesupport (>= 5.0, < 8)
4548
addressable (~> 2.8)
4649
algoliasearch (~> 1.0)
@@ -60,50 +63,48 @@ GEM
6063
netrc (~> 0.11)
6164
cocoapods-try (1.2.0)
6265
colored2 (3.1.2)
63-
concurrent-ruby (1.2.3)
66+
concurrent-ruby (1.3.4)
6467
connection_pool (2.4.1)
65-
drb (2.2.0)
66-
ruby2_keywords
68+
drb (2.2.1)
6769
escape (0.0.4)
6870
ethon (0.16.0)
6971
ffi (>= 1.15.0)
70-
ffi (1.16.3)
72+
ffi (1.17.0)
7173
fourflusher (2.3.1)
7274
fuzzy_match (2.0.4)
7375
gh_inspector (1.1.3)
7476
httpclient (2.8.3)
75-
i18n (1.14.1)
77+
i18n (1.14.6)
7678
concurrent-ruby (~> 1.0)
77-
json (2.7.1)
78-
minitest (5.21.2)
79+
json (2.7.2)
80+
logger (1.6.1)
81+
minitest (5.25.1)
7982
molinillo (0.8.0)
80-
mutex_m (0.2.0)
8183
nanaimo (0.3.0)
8284
nap (1.1.0)
8385
netrc (0.11.0)
86+
nkf (0.2.0)
8487
public_suffix (4.0.7)
85-
rexml (3.2.8)
86-
strscan (>= 3.0.9)
88+
rexml (3.3.7)
8789
ruby-macho (2.5.1)
88-
ruby2_keywords (0.0.5)
89-
strscan (3.1.0)
90+
securerandom (0.3.1)
9091
typhoeus (1.4.1)
9192
ethon (>= 0.9.0)
9293
tzinfo (2.0.6)
9394
concurrent-ruby (~> 1.0)
94-
xcodeproj (1.24.0)
95+
xcodeproj (1.25.0)
9596
CFPropertyList (>= 2.3.3, < 4.0)
9697
atomos (~> 0.1.3)
9798
claide (>= 1.0.2, < 2.0)
9899
colored2 (~> 3.1)
99100
nanaimo (~> 0.3.0)
100-
rexml (~> 3.2.4)
101+
rexml (>= 3.3.2, < 4.0)
101102

102103
PLATFORMS
103104
ruby
104105

105106
DEPENDENCIES
106-
cocoapods (~> 1.12)
107+
cocoapods (~> 1.15.2)
107108

108109
RUBY VERSION
109110
ruby 3.0.0p0

MacOSExample/babel.config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
33
plugins: [
44
'@babel/plugin-transform-modules-commonjs',
5-
'react-native-reanimated/plugin',
5+
['@babel/plugin-transform-private-methods', { loose: true }],
66
[
77
'module-resolver',
88
{
@@ -11,13 +11,14 @@ module.exports = {
1111
react: './node_modules/react',
1212
'react-native': './node_modules/react-native-macos',
1313
'react-native-reanimated': './node_modules/react-native-reanimated',
14-
'@babel': './node_modules/@babel',
15-
'@egjs/hammerjs': './node_modules/@egjs/hammerjs',
16-
fbjs: './node_modules/fbjs',
17-
'hoist-non-react-statics': './node_modules/hoist-non-react-statics',
18-
invariant: './node_modules/invariant',
14+
'react-native-gesture-handler/ReanimatedSwipeable':
15+
'../src/components/ReanimatedSwipeable',
16+
'react-native-gesture-handler/Swipeable':
17+
'../src/components/Swipeable',
18+
'react-native-gesture-handler': '../src/index',
1919
},
2020
},
2121
],
22+
'react-native-reanimated/plugin',
2223
],
2324
};

MacOSExample/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
import { AppRegistry } from 'react-native';
6-
import App from './src/App';
6+
import App from '../example/App';
77
import { name as appName } from './app.json';
88

99
AppRegistry.registerComponent(appName, () => App);

MacOSExample/macos/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# CocoaPods
22
Pods/
3+
4+
*.local

MacOSExample/macos/MacOSExample-macOS/AppDelegate.mm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)notification
1414
return [super applicationDidFinishLaunching:notification];
1515
}
1616

17-
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
17+
- (NSURL *)bundleURL
1818
{
1919
#if DEBUG
2020
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
@@ -23,6 +23,11 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
2323
#endif
2424
}
2525

26+
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
27+
{
28+
return [self bundleURL];
29+
}
30+
2631
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
2732
///
2833
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html

0 commit comments

Comments
 (0)