Skip to content

Commit 3604301

Browse files
authored
feat: Support RN 0.74 and Bridgeless (#551)
1 parent 85c1c06 commit 3604301

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+20079
-25741
lines changed

.clang-format

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
AccessModifierOffset: -1
3+
AlignAfterOpenBracket: AlwaysBreak
4+
AlignConsecutiveAssignments: false
5+
AlignConsecutiveDeclarations: false
6+
AlignEscapedNewlinesLeft: true
7+
AlignOperands: false
8+
AlignTrailingComments: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: false
11+
AllowShortCaseLabelsOnASingleLine: false
12+
AllowShortFunctionsOnASingleLine: Empty
13+
AllowShortIfStatementsOnASingleLine: false
14+
AllowShortLoopsOnASingleLine: false
15+
AlwaysBreakAfterReturnType: None
16+
AlwaysBreakBeforeMultilineStrings: true
17+
AlwaysBreakTemplateDeclarations: true
18+
BinPackArguments: false
19+
BinPackParameters: false
20+
BraceWrapping:
21+
AfterClass: false
22+
AfterControlStatement: false
23+
AfterEnum: false
24+
AfterFunction: false
25+
AfterNamespace: false
26+
AfterObjCDeclaration: false
27+
AfterStruct: false
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
BreakBeforeBinaryOperators: None
33+
BreakBeforeBraces: Attach
34+
BreakBeforeTernaryOperators: true
35+
BreakConstructorInitializersBeforeComma: false
36+
BreakAfterJavaFieldAnnotations: false
37+
BreakStringLiterals: false
38+
ColumnLimit: 80
39+
CommentPragmas: '^ IWYU pragma:'
40+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
41+
ConstructorInitializerIndentWidth: 4
42+
ContinuationIndentWidth: 4
43+
Cpp11BracedListStyle: true
44+
DerivePointerAlignment: false
45+
DisableFormat: false
46+
ForEachMacros: [ FOR_EACH_RANGE, FOR_EACH, ]
47+
IncludeCategories:
48+
- Regex: '^<.*\.h(pp)?>'
49+
Priority: 1
50+
- Regex: '^<.*'
51+
Priority: 2
52+
- Regex: '.*'
53+
Priority: 3
54+
IndentCaseLabels: true
55+
IndentWidth: 2
56+
IndentWrappedFunctionNames: false
57+
KeepEmptyLinesAtTheStartOfBlocks: false
58+
MacroBlockBegin: ''
59+
MacroBlockEnd: ''
60+
MaxEmptyLinesToKeep: 1
61+
NamespaceIndentation: None
62+
ObjCBlockIndentWidth: 2
63+
ObjCSpaceAfterProperty: true
64+
ObjCSpaceBeforeProtocolList: true
65+
PenaltyBreakBeforeFirstCallParameter: 1
66+
PenaltyBreakComment: 300
67+
PenaltyBreakFirstLessLess: 120
68+
PenaltyBreakString: 1000
69+
PenaltyExcessCharacter: 1000000
70+
PenaltyReturnTypeOnItsOwnLine: 200
71+
PointerAlignment: Left
72+
ReflowComments: true
73+
SortIncludes: true
74+
SpaceAfterCStyleCast: false
75+
SpaceBeforeAssignmentOperators: true
76+
SpaceBeforeParens: ControlStatements
77+
SpaceInEmptyParentheses: false
78+
SpacesBeforeTrailingComments: 1
79+
SpacesInAngles: false
80+
SpacesInContainerLiterals: true
81+
SpacesInCStyleCastParentheses: false
82+
SpacesInParentheses: false
83+
SpacesInSquareBrackets: false
84+
Standard: Cpp11
85+
TabWidth: 8
86+
UseTab: Never
87+
---
88+
Language: ObjC
89+
ColumnLimit: 120
90+
BreakBeforeBraces: WebKit
91+
PointerAlignment: Right
92+
...

FabricExample/.gitignore

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
ios/.xcode.env.local
23+
**/.xcode.env.local
2424

2525
# Android/IntelliJ
2626
#
@@ -56,11 +56,18 @@ yarn-error.log
5656
*.jsbundle
5757

5858
# Ruby / CocoaPods
59-
/ios/Pods/
59+
**/Pods/
6060
/vendor/bundle/
6161

6262
# Temporary files created by Metro to check the health of the file watcher
6363
.metro-health-check*
6464

6565
# testing
6666
/coverage
67+
68+
.yarn/*
69+
!.yarn/patches
70+
!.yarn/plugins
71+
!.yarn/releases
72+
!.yarn/sdks
73+
!.yarn/versions

FabricExample/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default function App() {
2525
<View style={styles.rtlSwitchContainer}>
2626
<Switch
2727
value={isRTL}
28-
onValueChange={(newValue) => {
28+
onValueChange={newValue => {
2929
setIsRTL(newValue);
3030
I18nManager.forceRTL(newValue);
3131
}}
@@ -34,7 +34,7 @@ export default function App() {
3434
</View>
3535
<View style={styles.container}>
3636
<Text style={styles.heading}>Picker Examples</Text>
37-
{PickerExamples.examples.map((element) => (
37+
{PickerExamples.examples.map(element => (
3838
<View style={styles.elementContainer} key={element.title}>
3939
<Text style={styles.title}> {element.title} </Text>
4040
{element.render()}
@@ -44,7 +44,7 @@ export default function App() {
4444
<Text style={styles.heading}>PickerIOS Examples</Text>
4545
)}
4646
{Platform.OS === 'ios' &&
47-
PickerIOSExamples.examples.map((element) => (
47+
PickerIOSExamples.examples.map(element => (
4848
<View style={styles.elementContainer} key={element.title}>
4949
<Text style={styles.title}> {element.title} </Text>
5050
{element.render()}

FabricExample/android/app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ android {
107107
dependencies {
108108
// The version of react-native is set by the React Native Gradle Plugin
109109
implementation("com.facebook.react:react-android")
110-
implementation("com.facebook.react:flipper-integration")
111110

112111
if (hermesEnabled.toBoolean()) {
113112
implementation("com.facebook.react:hermes-android")

FabricExample/android/app/src/main/java/com/fabricexample/MainApplication.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,17 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.flipper.ReactNativeFlipper
1312
import com.facebook.soloader.SoLoader
1413

1514
class MainApplication : Application(), ReactApplication {
1615

1716
override val reactNativeHost: ReactNativeHost =
1817
object : DefaultReactNativeHost(this) {
19-
override fun getPackages(): List<ReactPackage> {
20-
// Packages that cannot be autolinked yet can be added manually here, for example:
21-
// packages.add(new MyReactNativePackage());
22-
return PackageList(this).packages
23-
}
18+
override fun getPackages(): List<ReactPackage> =
19+
PackageList(this).packages.apply {
20+
// Packages that cannot be autolinked yet can be added manually here, for example:
21+
// add(MyReactNativePackage())
22+
}
2423

2524
override fun getJSMainModuleName(): String = "index"
2625

@@ -31,7 +30,7 @@ class MainApplication : Application(), ReactApplication {
3130
}
3231

3332
override val reactHost: ReactHost
34-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
33+
get() = getDefaultReactHost(applicationContext, reactNativeHost)
3534

3635
override fun onCreate() {
3736
super.onCreate()
@@ -40,6 +39,5 @@ class MainApplication : Application(), ReactApplication {
4039
// If you opted-in for the New Architecture, we load the native entry point for this app.
4140
load()
4241
}
43-
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
4442
}
4543
}

FabricExample/android/app/src/main/res/drawable/rn_edit_text_material.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
1818
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
1919
android:insetTop="@dimen/abc_edit_text_inset_top_material"
20-
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
20+
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
21+
>
2122

2223
<selector>
2324
<!--

FabricExample/android/build.gradle

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
buildscript {
44
ext {
55
buildToolsVersion = "34.0.0"
6-
minSdkVersion = 21
6+
minSdkVersion = 23
77
compileSdkVersion = 34
88
targetSdkVersion = 34
9-
ndkVersion = "25.1.8937393"
10-
kotlinVersion = "1.8.0"
9+
10+
ndkVersion = "26.1.10909125"
11+
kotlinVersion = "1.9.22"
1112
}
1213
repositories {
1314
google()
@@ -19,3 +20,5 @@ buildscript {
1920
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
2021
}
2122
}
23+
24+
apply plugin: "com.facebook.react.rootproject"

FabricExample/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.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

FabricExample/ios/FabricExample.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)