Skip to content

Commit 918a79d

Browse files
nfcamposzzq889
authored andcommitted
hack for rn >= 0.50 and react >= 0.16
1 parent 47f1c10 commit 918a79d

File tree

6 files changed

+44
-28
lines changed

6 files changed

+44
-28
lines changed

example/ios/Podfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ use_frameworks!
33
project 'native-navigation.xcodeproj'
44

55
target 'native-navigation' do
6-
pod 'Yoga', :path => '../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec'
6+
pod 'yoga', :path => '../../node_modules/react-native/ReactCommon/yoga/yoga.podspec'
77
pod 'native-navigation', :path => '../../'
88
pod 'React', :path => '../../node_modules/react-native', :subspecs => [
99
'Core',
10+
'BatchedBridge',
1011
'RCTText',
1112
'RCTNetwork',
1213
'RCTWebSocket', # needed for debugging

example/ios/Podfile.lock

+28-20
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,58 @@
11
PODS:
22
- native-navigation (0.2.1):
33
- React
4-
- React (0.42.3):
5-
- React/Core (= 0.42.3)
6-
- React/Core (0.42.3):
7-
- React/cxxreact
8-
- Yoga (= 0.42.3.React)
9-
- React/cxxreact (0.42.3):
10-
- React/jschelpers
11-
- React/jschelpers (0.42.3)
12-
- React/RCTAnimation (0.42.3):
4+
- React (0.50.4):
5+
- React/Core (= 0.50.4)
6+
- React/BatchedBridge (0.50.4):
137
- React/Core
14-
- React/RCTImage (0.42.3):
8+
- React/cxxreact_legacy
9+
- React/Core (0.50.4):
10+
- yoga (= 0.50.4.React)
11+
- React/cxxreact_legacy (0.50.4):
12+
- React/jschelpers_legacy
13+
- React/fishhook (0.50.4)
14+
- React/jschelpers_legacy (0.50.4)
15+
- React/RCTAnimation (0.50.4):
16+
- React/Core
17+
- React/RCTBlob (0.50.4):
18+
- React/Core
19+
- React/RCTImage (0.50.4):
1520
- React/Core
1621
- React/RCTNetwork
17-
- React/RCTNetwork (0.42.3):
22+
- React/RCTNetwork (0.50.4):
1823
- React/Core
19-
- React/RCTText (0.42.3):
24+
- React/RCTText (0.50.4):
2025
- React/Core
21-
- React/RCTWebSocket (0.42.3):
26+
- React/RCTWebSocket (0.50.4):
2227
- React/Core
23-
- Yoga (0.42.3.React)
28+
- React/fishhook
29+
- React/RCTBlob
30+
- yoga (0.50.4.React)
2431

2532
DEPENDENCIES:
2633
- native-navigation (from `../../`)
34+
- React/BatchedBridge (from `../../node_modules/react-native`)
2735
- React/Core (from `../../node_modules/react-native`)
2836
- React/RCTAnimation (from `../../node_modules/react-native`)
2937
- React/RCTImage (from `../../node_modules/react-native`)
3038
- React/RCTNetwork (from `../../node_modules/react-native`)
3139
- React/RCTText (from `../../node_modules/react-native`)
3240
- React/RCTWebSocket (from `../../node_modules/react-native`)
33-
- Yoga (from `../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec`)
41+
- yoga (from `../../node_modules/react-native/ReactCommon/yoga/yoga.podspec`)
3442

3543
EXTERNAL SOURCES:
3644
native-navigation:
3745
:path: ../../
3846
React:
3947
:path: ../../node_modules/react-native
40-
Yoga:
41-
:path: ../../node_modules/react-native/ReactCommon/yoga/Yoga.podspec
48+
yoga:
49+
:path: ../../node_modules/react-native/ReactCommon/yoga/yoga.podspec
4250

4351
SPEC CHECKSUMS:
4452
native-navigation: bfb4dd993e94160c9d71804332c39f7e56f0283b
45-
React: 35e039680feacd0563677d49ba410112d2748559
46-
Yoga: 86ce777665c8259b94ef8dbea76b84634237f4ea
53+
React: 6d7efef18e0241eb832cf4c085405169a15080ed
54+
yoga: b9aebf996711e50fc31f5608c10aa108a5a0c29e
4755

48-
PODFILE CHECKSUM: 62780c26b71f717952c8247c70052484dc91c6b3
56+
PODFILE CHECKSUM: 3ed8e0cbbdfd66108be1c83b47cd8d5a458c353c
4957

5058
COCOAPODS: 1.3.1

example/ios/native-navigation.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,14 @@
172172
inputPaths = (
173173
"${SRCROOT}/Pods/Target Support Files/Pods-native-navigation/Pods-native-navigation-frameworks.sh",
174174
"${BUILT_PRODUCTS_DIR}/React/React.framework",
175-
"${BUILT_PRODUCTS_DIR}/Yoga/yoga.framework",
176175
"${BUILT_PRODUCTS_DIR}/native-navigation/NativeNavigation.framework",
176+
"${BUILT_PRODUCTS_DIR}/yoga/yoga.framework",
177177
);
178178
name = "[CP] Embed Pods Frameworks";
179179
outputPaths = (
180180
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/React.framework",
181-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework",
182181
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NativeNavigation.framework",
182+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/yoga.framework",
183183
);
184184
runOnlyForDeploymentPostprocessing = 0;
185185
shellPath = /bin/sh;

lib/ios/native-navigation/Dictionary+FunctionalExtensions.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ extension Dictionary {
4040
return dict
4141
}
4242

43-
43+
#if swift(>=3.2)
44+
#else
4445
public func mapValues<OutValue>(transform: (Value) throws -> OutValue) rethrows -> [Key: OutValue] {
4546
var dict = [Key: OutValue]()
4647
for (key, value) in self {
4748
dict[key] = try transform(value)
4849
}
4950
return dict
5051
}
52+
#endif
5153
}

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"description": "Native Navigation for React Native",
55
"main": "index.js",
66
"scripts": {
7+
"postinstall":"sh postinstall.sh",
78
"start": "node node_modules/react-native/local-cli/cli.js start",
89
"run:packager": "./node_modules/react-native/packager/packager.sh",
910
"run:ios": "react-native run-ios --project-path ./example/ios",
@@ -37,8 +38,8 @@
3738
},
3839
"homepage": "https://github.com/airbnb/native-navigation#readme",
3940
"peerDependencies": {
40-
"react": ">=15.3.1",
41-
"react-native": ">=0.42"
41+
"react": ">=16.0.0",
42+
"react-native": ">=0.50"
4243
},
4344
"dependencies": {
4445
"prop-types": "^15.5.10",
@@ -58,8 +59,8 @@
5859
"eslint-plugin-react": "^6.1.2",
5960
"gitbook-cli": "^2.3.0",
6061
"murmur2js": "^1.0.0",
61-
"react": "^15.4.1",
62-
"react-native": "^0.42.3"
62+
"react": "^16.1.1",
63+
"react-native": "^0.50.4"
6364
},
6465
"rnpm": {
6566
"android": {

postinstall.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
echo 'hacking...'
2+
sed -i '' 's/\#import <RCTAnimation\/RCTValueAnimatedNode.h>/\#import \"RCTValueAnimatedNode.h\"/' ./node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedNodesManager.h
3+
sed -i '' 's/\#import <fishhook\/fishhook.h>/\#import <React\/fishhook.h>/' ./node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m
4+
echo 'hacked'

0 commit comments

Comments
 (0)