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

chore: [IOPLT-764] Upgrade to react-native 0.75 #6348

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
eebefd8
chore: first attemp at upgrading rn 075
LazyAfternoons Oct 24, 2024
619a649
chore: temporary removal of reactotron
LazyAfternoons Oct 25, 2024
d467685
chore: update tsconfig
LazyAfternoons Oct 25, 2024
4da7f82
fix: breaking changes issues
LazyAfternoons Oct 25, 2024
d392db0
fix: android project
LazyAfternoons Oct 25, 2024
0166878
deps: update dependency for the new rn version
LazyAfternoons Oct 25, 2024
3d36895
removes react-native-barcode-builder for svg version
CrisTofani Oct 28, 2024
5400995
adds yarn v3 config file
CrisTofani Oct 28, 2024
ac01df3
deps: remove react native art
LazyAfternoons Oct 28, 2024
0854288
reverts barcode lib applying patch
CrisTofani Oct 29, 2024
bb1628d
fixes android build
CrisTofani Oct 29, 2024
0d8a036
fix dependencies
CrisTofani Oct 30, 2024
71ffabc
Merge branch 'master' into upgrade-to-rn-075
CrisTofani Oct 30, 2024
fd2dbf7
fix: enables yarn v3
CrisTofani Oct 30, 2024
61832da
Merge branch 'upgrade-to-rn-075' of github.com:pagopa/io-app into upg…
CrisTofani Oct 30, 2024
515c61a
fix: enables yarn cache on CI
CrisTofani Oct 30, 2024
9c68225
generate scripts moved to bash file
CrisTofani Oct 31, 2024
84d4006
generate scripts moved to bash file
CrisTofani Oct 31, 2024
f7b90c4
fix danger
CrisTofani Oct 31, 2024
3b64c3c
removes and restore patches
CrisTofani Oct 31, 2024
7856a52
Merge branch 'master' into upgrade-to-rn-075
CrisTofani Oct 31, 2024
bbc832a
fix missing PN models
CrisTofani Oct 31, 2024
771e24e
fixes danger action
CrisTofani Oct 31, 2024
8c1b721
fixes lint problems
CrisTofani Oct 31, 2024
053d60e
fixes tests and snapshots
CrisTofani Nov 4, 2024
0001d32
adds missing patch to react-native
CrisTofani Nov 4, 2024
19f8ef5
fixes
CrisTofani Nov 4, 2024
328f5db
Merge remote-tracking branch 'origin/HEAD' into upgrade-to-rn-075
CrisTofani Nov 4, 2024
2c6fbcd
Merge branch 'master' into upgrade-to-rn-075
CrisTofani Nov 5, 2024
c50fa79
Merge branch 'master' into upgrade-to-rn-075
CrisTofani Nov 5, 2024
c7a9611
removes danger action
CrisTofani Nov 5, 2024
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
22 changes: 12 additions & 10 deletions .github/actions/setup-composite/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@ description: 'This action collects the steps to setup any job'
runs:
using: "composite"
steps:
- id: enable-corepack
shell: bash
run: corepack enable
- id: setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3.8.2
with:
node-version-file: '.node-version'
- id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
shell: bash
- id: yarn-cache
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- id: install-packages
path: |
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
shell: bash
- id: generate-api-client
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/danger.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/pr-title-linter-and-linker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: "Lint and Link PR title"

on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize

jobs:
lint:
name: Validate PR title And link Jira Issue
runs-on: ubuntu-22.04
env:
JIRA_COMMENT_REGEX: "^.*Jira.*"
steps:
- uses: Slashgear/action-check-pr-title@860e8dc639f8e60335a6f5e8936ba67ed2536890 #v4.3.0
id: lint
with:
regexp: "\\[(#?[A-Z]*-[0-9]*( |, )?){1,}\\]" # Regex the title should match.
continue-on-error: true

- name: Find Jira Comment
uses: peter-evans/find-comment@81e2da3af01c92f83cb927cf3ace0e085617c556 #v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-regex: "${{ env.JIRA_COMMENT_REGEX }}"

- name: Extract Jira Issue to Link
id: extract_jira_issue
if: steps.lint.outcome == 'success'
run: |
PR_TITLE=$(echo "${{ github.event.pull_request.title }}")
ISSUES_STR=$(awk -F'\\[|\\]' '{print $2}' <<< "$PR_TITLE" | sed "s/#//g" | sed "s/,//g")
ISSUES=($ISSUES_STR)
JIRA_ISSUE=$(echo ${ISSUES_STR##* })
MARKDOWN_CARRIAGE_RETURN="<br>"
MARKDOWN_PREFIX="- Link to"
JIRA_COMMENT_MARKDOWN="This Pull Request refers to Jira issues:<br>"
if [[ ${#ISSUES[@]} -eq 1 ]]
then
JIRA_COMMENT_MARKDOWN="This Pull Request refers to the following Jira issue"
MARKDOWN_PREFIX=""
fi

for ISSUE in "${ISSUES[@]}"
do
JIRA_COMMENT_MARKDOWN+="$MARKDOWN_PREFIX [$ISSUE](https://pagopa.atlassian.net/browse/$ISSUE) $MARKDOWN_CARRIAGE_RETURN"
done

echo "JIRA_ISSUE=$JIRA_ISSUE" >> $GITHUB_ENV
echo "JIRA_COMMENT_MARKDOWN=$JIRA_COMMENT_MARKDOWN" >> $GITHUB_ENV

- name: Create Jira Link comment
if: steps.lint.outcome == 'success'
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 #v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Jira Pull Request Link ##
${{ env.JIRA_COMMENT_MARKDOWN }}
edit-mode: replace
- name: Create Empty Jira Link comment
if: steps.lint.outcome != 'success'
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808 #v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## Jira Pull request Link ##
It seems this Pull Request has no issues that refers to Jira!!!
Please check it out.
edit-mode: replace
- name: Failure message
if: steps.lint.outcome != 'success'
run: |
echo "Pull request title (${{ github.event.pull_request.title }}) is not properly formatted or it is not related to any Jira issue"
exit 1
13 changes: 9 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
**/.xcode.env.local

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

# Android/IntelliJ
Expand Down Expand Up @@ -112,5 +112,10 @@ sentry.properties
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# yarn cache dir
.yarn/cache
# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
2 changes: 2 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
nodeLinker: node-modules
enableScripts: true
7 changes: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ source "https://rubygems.org"
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>=2.6.10'

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
# 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 "fastlane", "~> 2.223.1"
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ PLATFORMS
ruby

DEPENDENCIES
activesupport (>= 6.1.7.3, < 7.1.0)
cocoapods (>= 1.13, < 1.15)
activesupport (>= 6.1.7.5, != 7.1.0)
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
fastlane (~> 2.223.1)

RUBY VERSION
Expand Down
30 changes: 13 additions & 17 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ project.ext.envConfigFiles = [
]

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
Expand All @@ -23,14 +24,14 @@ if (project.hasProperty(bundleInDebugPropertyName)) {

react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down Expand Up @@ -64,6 +65,9 @@ if (project.hasProperty(bundleInDebugPropertyName)) {
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

/**
Expand All @@ -87,6 +91,7 @@ def jscFlavor = 'org.webkit:android-jsc:+'
apply from: new File(["node", "--print", "require.resolve('@sentry/react-native/package.json')"].execute().text.trim(), "../sentry.gradle")
android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdkVersion rootProject.ext.compileSdkVersion

namespace "it.pagopa.io.app"
Expand Down Expand Up @@ -172,13 +177,6 @@ dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

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

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")

implementation project(':react-native-cie')

implementation ("com.squareup.okhttp3:okhttp:4.9.2")
Expand All @@ -191,7 +189,6 @@ dependencies {
}

implementation project(':react-native-fingerprint-scanner')
implementation project(':react-native-art')
implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.41"
implementation('com.google.firebase:firebase-iid:21.1.0') {
because "Firebase messaging 22.0.0 removes Firebase Instance ID API but out current version of the mixpanel sdk requires it https://github.com/mixpanel/mixpanel-android/issues/744 https://firebase.google.com/support/release-notes/android#messaging_v22-0-0"
Expand All @@ -203,4 +200,3 @@ dependencies {

// Add the following line to the bottom of the file:
apply plugin: 'com.google.gms.google-services' // Google Play services Gradle plugin
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
7 changes: 4 additions & 3 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

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

<application android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
</application>
<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>

This file was deleted.

2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<!-- Media permission for Android API Level 33+-->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:requestLegacyExternalStorage="true" android:theme="@style/AppTheme" android:largeHeap="true">
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:requestLegacyExternalStorage="true" android:theme="@style/AppTheme" android:supportsRtl="true" android:largeHeap="true">

<!-- START Required by react-native-push-notification -->

Expand Down
Loading
Loading