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

Upgraded to React Native 0.76.1 #35

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
18 changes: 18 additions & 0 deletions .github/workflows/react-native-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
- name: Install dependencies
run: npm install -g yarn

- name: Enable Corepack
run: corepack enable

- name: Activate Yarn 3.6.4
run: corepack prepare [email protected] --activate

- name: Install dependencies
run: yarn install

Expand All @@ -49,6 +55,12 @@ jobs:
- name: Install dependencies
run: npm install -g yarn

- name: Enable Corepack
run: corepack enable

- name: Activate Yarn 3.6.4
run: corepack prepare [email protected] --activate

- name: Install dependencies
run: yarn install

Expand Down Expand Up @@ -98,6 +110,12 @@ jobs:
- name: Install dependencies
run: npm install -g yarn

- name: Enable Corepack
run: corepack enable

- name: Activate Yarn 3.6.4
run: corepack prepare [email protected] --activate

- name: Install dependencies
run: yarn install

Expand Down
15 changes: 13 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
**/.xcode.env.local

# Android/IntelliJ
#
Expand All @@ -36,7 +37,6 @@ android/app/build
node_modules/
npm-debug.log
yarn-error.log
yarn.lock
.env
.env.*

Expand All @@ -46,6 +46,17 @@ buck-out/
*.keystore
!debug.keystore

# testing
/coverage

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
Expand All @@ -61,7 +72,7 @@ buck-out/
*.jsbundle

# CocoaPods
/ios/Pods/
**/Pods/

# react-native-config codegen
ios/tmp.xcconfig
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
build/
ios/
android/
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 190,
"tabWidth": 4,
"jsxSingleQuote": true
}
9 changes: 0 additions & 9 deletions .prettierrc.js

This file was deleted.

13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"java.configuration.updateBuildConfiguration": "automatic",
"prettier.prettierPath": "./node_modules/prettier",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit"
},
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.formatOnType": false,
"prettier.configPath": ".prettierrc",
"prettier.ignorePath": ".prettierignore"
}
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
nodeLinker: node-modules

# yarnPath: .yarn/releases/yarn-3.6.4.cjs
54 changes: 0 additions & 54 deletions App.js

This file was deleted.

43 changes: 43 additions & 0 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React, { useEffect } from 'react';
import type { PropsWithChildren } from 'react';
import { useColorScheme } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { TamaguiProvider, Theme } from 'tamagui';
import { Toasts } from '@backpackapp-io/react-native-toast';
import { PortalProvider, PortalHost } from '@gorhom/portal';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import useTheme from './src/hooks/use-theme';
import AppNavigator from './src/navigation/AppNavigator';
import { AuthProvider } from './src/contexts/AuthContext';
import config from './tamagui.config';

function App(): React.JSX.Element {
const { theme } = useTheme();

return (
<TamaguiProvider config={config}>
<PortalProvider>
<Theme name={theme}>
<GestureHandlerRootView style={{ flex: 1 }}>
<PortalProvider>
<SafeAreaProvider>
<BottomSheetModalProvider>
<AuthProvider>
<AppNavigator />
<Toasts extraInsets={{ bottom: 80 }} />
<PortalHost name='MainPortal' />
<PortalHost name='BottomSheetPanelPortal' />
<PortalHost name='LocationPickerPortal' />
</AuthProvider>
</BottomSheetModalProvider>
</SafeAreaProvider>
</PortalProvider>
</GestureHandlerRootView>
</Theme>
</PortalProvider>
</TamaguiProvider>
);
}

export default App;
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'
ruby ">= 2.6.10"

gem 'cocoapods', '>= 1.11.2'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
4 changes: 3 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ PLATFORMS
ruby

DEPENDENCIES
cocoapods (>= 1.11.2)
activesupport (>= 6.1.7.5, != 7.1.0)
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
xcodeproj (< 1.26.0)

RUBY VERSION
ruby 2.6.10p210
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ Run the commands below; first clone the project, use npm or yarn to install the
```
git clone [email protected]:fleetbase/storefront-app.git
cd storefront-app
corepack enable
corepack prepare [email protected] --activate
yarn
npx pod-install
bundle install
cd ios
bundle exec pod install
touch .env
```

Expand Down
22 changes: 10 additions & 12 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ react {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

project.ext.react = [
Expand Down Expand Up @@ -92,11 +95,16 @@ def isNewArchitectureEnabled() {
android {
ndkVersion rootProject.ext.ndkVersion

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

namespace "com.storefrontapp"

defaultConfig {
applicationId project.env.get("APP_IDENTIFIER")
manifestPlaceholders = [
appAuthRedirectScheme: project.env.get("APP_LINK_PREFIX")
]
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy 'react-native-camera', 'general'
Expand Down Expand Up @@ -149,21 +157,11 @@ dependencies {
implementation project(':react-native-config')
implementation "androidx.core:core-splashscreen:1.0.0-alpha02"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}

apply plugin: 'com.google.gms.google-services'
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle") ; applyNativeModulesAppBuildGradle(project)
apply plugin: 'com.google.gms.google-services'
8 changes: 2 additions & 6 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
<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" />

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning"
android:appComponentFactory="whateverString"
tools:replace="android:appComponentFactory">
<activity
android:name="com.facebook.react.devsupport.DevSettingsActivity"
android:exported="false" />
tools:replace="android:appComponentFactory"
tools:ignore="GoogleAppIndexingWarning" />
</application>
</manifest>
17 changes: 12 additions & 5 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,18 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />

<application android:name=".MainApplication" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme" android:networkSecurityConfig="@xml/network_security_config"
android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="true"
tools:targetApi="s">
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="true"
tools:targetApi="s"
android:supportsRtl="true"
>
<!-- Change the value to true to enable pop-up for in foreground on receiving remote
notifications (for prevent duplicating while showing local notifications set this to false) -->
<meta-data android:name="com.dieam.reactnativepushnotification.notification_foreground"
Expand Down
29 changes: 0 additions & 29 deletions android/app/src/main/java/com/storefrontapp/MainActivity.java

This file was deleted.

Loading
Loading