Skip to content

Commit 1acb668

Browse files
authored
Merge pull request #9 from Doublemme/turbo-module-impl
Feat: update react-native-fast-url to support new architecture
2 parents 90880fb + d290c79 commit 1acb668

File tree

9 files changed

+325
-79
lines changed

9 files changed

+325
-79
lines changed

android/build.gradle

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,14 @@ repositories {
118118
google()
119119
}
120120

121+
// Only configure react block when new architecture is enabled
122+
if (isNewArchitectureEnabled()) {
123+
react {
124+
jsRootDir = file("../src/")
125+
libraryName = "FastUrl"
126+
codegenJavaPackageName = "com.fasturl"
127+
}
128+
}
121129

122130
dependencies {
123131
// For < 0.71, this will be from the local maven repo
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.fasturl;
2+
3+
public class FastUrlModuleImpl {
4+
public static final String NAME = "FastUrl";
5+
6+
public static boolean install() {
7+
try {
8+
System.loadLibrary("fast-url");
9+
return true;
10+
} catch (Exception exception) {
11+
return false;
12+
}
13+
}
14+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.fasturl;
2+
3+
import androidx.annotation.NonNull;
4+
import com.facebook.react.bridge.ReactApplicationContext;
5+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
6+
import com.facebook.react.bridge.ReactMethod;
7+
8+
public class FastUrlModule extends ReactContextBaseJavaModule {
9+
FastUrlModule(ReactApplicationContext context) {
10+
super(context);
11+
}
12+
13+
@NonNull
14+
@Override
15+
public String getName() {
16+
return FastUrlModuleImpl.NAME;
17+
}
18+
19+
@ReactMethod(isBlockingSynchronousMethod = true)
20+
public boolean install() {
21+
return FastUrlModuleImpl.install();
22+
}
23+
}

example/Gemfile.lock

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (7.1.5.1)
9+
base64
10+
benchmark (>= 0.3)
11+
bigdecimal
12+
concurrent-ruby (~> 1.0, >= 1.0.2)
13+
connection_pool (>= 2.2.5)
14+
drb
15+
i18n (>= 1.6, < 2)
16+
logger (>= 1.4.2)
17+
minitest (>= 5.1)
18+
mutex_m
19+
securerandom (>= 0.3)
20+
tzinfo (~> 2.0)
21+
addressable (2.8.7)
22+
public_suffix (>= 2.0.2, < 7.0)
23+
algoliasearch (1.27.5)
24+
httpclient (~> 2.8, >= 2.8.3)
25+
json (>= 1.5.1)
26+
atomos (0.1.3)
27+
base64 (0.3.0)
28+
benchmark (0.4.1)
29+
bigdecimal (3.2.2)
30+
claide (1.1.0)
31+
cocoapods (1.15.2)
32+
addressable (~> 2.8)
33+
claide (>= 1.0.2, < 2.0)
34+
cocoapods-core (= 1.15.2)
35+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
36+
cocoapods-downloader (>= 2.1, < 3.0)
37+
cocoapods-plugins (>= 1.0.0, < 2.0)
38+
cocoapods-search (>= 1.0.0, < 2.0)
39+
cocoapods-trunk (>= 1.6.0, < 2.0)
40+
cocoapods-try (>= 1.1.0, < 2.0)
41+
colored2 (~> 3.1)
42+
escape (~> 0.0.4)
43+
fourflusher (>= 2.3.0, < 3.0)
44+
gh_inspector (~> 1.0)
45+
molinillo (~> 0.8.0)
46+
nap (~> 1.0)
47+
ruby-macho (>= 2.3.0, < 3.0)
48+
xcodeproj (>= 1.23.0, < 2.0)
49+
cocoapods-core (1.15.2)
50+
activesupport (>= 5.0, < 8)
51+
addressable (~> 2.8)
52+
algoliasearch (~> 1.0)
53+
concurrent-ruby (~> 1.1)
54+
fuzzy_match (~> 2.0.4)
55+
nap (~> 1.0)
56+
netrc (~> 0.11)
57+
public_suffix (~> 4.0)
58+
typhoeus (~> 1.0)
59+
cocoapods-deintegrate (1.0.5)
60+
cocoapods-downloader (2.1)
61+
cocoapods-plugins (1.0.0)
62+
nap
63+
cocoapods-search (1.0.1)
64+
cocoapods-trunk (1.6.0)
65+
nap (>= 0.8, < 2.0)
66+
netrc (~> 0.11)
67+
cocoapods-try (1.2.0)
68+
colored2 (3.1.2)
69+
concurrent-ruby (1.3.3)
70+
connection_pool (2.5.3)
71+
drb (2.2.3)
72+
escape (0.0.4)
73+
ethon (0.16.0)
74+
ffi (>= 1.15.0)
75+
ffi (1.17.2)
76+
fourflusher (2.3.1)
77+
fuzzy_match (2.0.4)
78+
gh_inspector (1.1.3)
79+
httpclient (2.9.0)
80+
mutex_m
81+
i18n (1.14.7)
82+
concurrent-ruby (~> 1.0)
83+
json (2.13.1)
84+
logger (1.7.0)
85+
minitest (5.25.5)
86+
molinillo (0.8.0)
87+
mutex_m (0.3.0)
88+
nanaimo (0.3.0)
89+
nap (1.1.0)
90+
netrc (0.11.0)
91+
nkf (0.2.0)
92+
public_suffix (4.0.7)
93+
rexml (3.4.1)
94+
ruby-macho (2.5.1)
95+
securerandom (0.3.2)
96+
typhoeus (1.4.1)
97+
ethon (>= 0.9.0)
98+
tzinfo (2.0.6)
99+
concurrent-ruby (~> 1.0)
100+
xcodeproj (1.25.1)
101+
CFPropertyList (>= 2.3.3, < 4.0)
102+
atomos (~> 0.1.3)
103+
claide (>= 1.0.2, < 2.0)
104+
colored2 (~> 3.1)
105+
nanaimo (~> 0.3.0)
106+
rexml (>= 3.3.6, < 4.0)
107+
108+
PLATFORMS
109+
ruby
110+
111+
DEPENDENCIES
112+
activesupport (>= 6.1.7.5, != 7.1.0)
113+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
114+
concurrent-ruby (< 1.3.4)
115+
xcodeproj (< 1.26.0)
116+
117+
RUBY VERSION
118+
ruby 2.7.5p203
119+
120+
BUNDLED WITH
121+
2.4.22

example/ios/.xcode.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
# For example, to use nvm with brew, add the following line
1010
# . "$(brew --prefix nvm)/nvm.sh" --no-use
1111
export NODE_BINARY=$(command -v node)
12+
export RCT_NEW_ARCH_ENABLED=true

example/ios/Podfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ require Pod::Executable.execute_command('node', ['-p',
88
platform :ios, min_ios_version_supported
99
prepare_react_native_project!
1010

11+
ENV['RCT_NEW_ARCH_ENABLED'] = '1'
12+
1113
linkage = ENV['USE_FRAMEWORKS']
1214
if linkage != nil
1315
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green

0 commit comments

Comments
 (0)