Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bring 0.74 support #2047

Merged
merged 10 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions FabricExample/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
**/.xcode.env.local

# Android/IntelliJ
#
Expand Down Expand Up @@ -56,11 +56,19 @@ yarn-error.log
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
**/Pods/
/vendor/bundle/

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

# testing
/coverage

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
116 changes: 80 additions & 36 deletions FabricExample/App.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,86 @@
import React from 'react';
import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {NavigationContainer} from '@react-navigation/native';
import {I18nManager} from 'react-native';
import Chapter from './src/Chapter';
import chapters from './src/chapters';
import HeaderDemo from './src/HeaderDemo';
import {WHITE} from './src/colors';
// import React from 'react';
// import {createNativeStackNavigator} from '@react-navigation/native-stack';
// import {NavigationContainer} from '@react-navigation/native';
// import {I18nManager} from 'react-native';
// import Chapter from './src/Chapter';
// import chapters from './src/chapters';
// import HeaderDemo from './src/HeaderDemo';
// import {WHITE} from './src/colors';

// const Stack = createNativeStackNavigator();

// const App = () => (
// <NavigationContainer>
// <Stack.Navigator
// screenOptions={{
// headerHideBackButton: true,
// direction: I18nManager.isRTL ? 'rtl' : 'ltr',
// }}>
// <Stack.Screen
// name="Chapter"
// options={{
// title: 'Fabric Example',
// headerShown: false,
// }}
// initialParams={{
// index: 0,
// chapters: chapters,
// chapterRoute: 'Chapter',
// afterChapterRoute: 'HeaderDemo',
// }}
// component={Chapter}
// />
// <Stack.Screen
// name="HeaderDemo"
// component={HeaderDemo}
// options={{title: 'Header Demo', headerTintColor: WHITE}}
// />
// </Stack.Navigator>
// </NavigationContainer>
// );

const Stack = createNativeStackNavigator();
// export default App;

import React from 'react';
import {ScrollView, View} from 'react-native';
import {ScreenStack, Screen} from 'react-native-screens';

const App = () => (
<NavigationContainer>
<Stack.Navigator
screenOptions={{
headerHideBackButton: true,
direction: I18nManager.isRTL ? 'rtl' : 'ltr',
}}>
<Stack.Screen
name="Chapter"
options={{
title: 'Fabric Example',
headerShown: false,
}}
initialParams={{
index: 0,
chapters: chapters,
chapterRoute: 'Chapter',
afterChapterRoute: 'HeaderDemo',
}}
component={Chapter}
/>
<Stack.Screen
name="HeaderDemo"
component={HeaderDemo}
options={{title: 'Header Demo', headerTintColor: WHITE}}
/>
</Stack.Navigator>
</NavigationContainer>
<ScreenStack style={{flex: 1}}>
{/* <Screen style={{flex: 1}}>
<View style={{flex: 1, backgroundColor: 'blue'}} />
</Screen> */}
<Screen
style={{flex: 1}}
// onHeaderHeightChange={e => {
// const headerHeight = e.nativeEvent.headerHeight;
// console.log(headerHeight);
// // if (cachedAnimatedHeaderHeight.current !== headerHeight) {
// // Currently, we're setting value by Animated#setValue, because we want to cache animated value.
// // Also, in React Native 0.72 there was a bug on Fabric causing a large delay between the screen transition,
// // which should not occur.
// // TODO: Check if it's possible to replace animated#setValue to Animated#event.
// // animatedHeaderHeight.setValue(headerHeight);
// // cachedAnimatedHeaderHeight.current = headerHeight;
// // }
// }}
>
{/* <ScrollView contentInsetAdjustmentBehavior="automatic"> */}
<View
style={{ width: 50, height: 50, backgroundColor: 'blue'}}
/>
<View
style={{ width: 50, height: 50, backgroundColor: 'red'}}
/>
<View
style={{ width: 50, height: 50, backgroundColor: 'red'}}
/>
<View
style={{ width: 50, height: 50, backgroundColor: 'red'}}
/>
{/* </ScrollView> */}
</Screen>
</ScreenStack>
);

export default App;
103 changes: 103 additions & 0 deletions FabricExample/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.7)
base64
nkf
rexml
activesupport (7.0.8.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
addressable (2.8.6)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
claide (1.1.0)
cocoapods (1.15.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.15.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (2.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.2.3)
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.16.3)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
json (2.7.1)
minitest (5.22.2)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.2.6)
ruby-macho (2.5.1)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.24.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)

PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.5, < 7.1.0)
cocoapods (~> 1.15.2)

RUBY VERSION
ruby 3.2.1p31

BUNDLED WITH
2.4.6
2 changes: 0 additions & 2 deletions FabricExample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def jscFlavor = 'org.webkit:android-jsc:+'

android {
ndkVersion rootProject.ext.ndkVersion

buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

Expand Down Expand Up @@ -108,7 +107,6 @@ android {
dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation("com.facebook.react:flipper-integration")

if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
Expand Down
2 changes: 0 additions & 2 deletions FabricExample/android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to remove that permission?


<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,17 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages
}
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}

override fun getJSMainModuleName(): String = "index"

Expand All @@ -31,15 +30,14 @@ class MainApplication : Application(), ReactApplication {
}

override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
get() = getDefaultReactHost(applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
SoLoader.init(this, /* native exopackage */ false)
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
>

<selector>
<!--
Expand Down

This file was deleted.

10 changes: 3 additions & 7 deletions FabricExample/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 21
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 34

// We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
ndkVersion = "25.1.8937393"
kotlinVersion = "1.8.22"
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
}
repositories {
google()
Expand Down
Binary file added FabricExample/android/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions FabricExample/android/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
WoLewicki marked this conversation as resolved.
Show resolved Hide resolved
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file modified FabricExample/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading
Loading