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

IGAPP-1061: Upgrade react and react native #843

Merged
merged 35 commits into from
Feb 13, 2023

Conversation

sarahsporck
Copy link
Contributor

This pull request belongs to an issue on our bugtracker.
You can find it there by looking for an issue with the key which is mentioned in the title of this pull request.
It starts with the keyword IGAPP.

What was updated?

  • react
  • react-native
  • jest

Why are there patches?
Check out this issue facebook/react-native#33557.
The removed types will temporarily be readded in react-native 0.71 (which our mapbox version currently does not support). See facebook/react-native@b966d29

Also most of the new arch stuff will be removed in later versions.

What has changed in jest?

  • mostly enforced typings
  • transform seems to have changed for ts-jest

The iOS update is still missing. @LeandraH or @f1sh1918 ? :) https://react-native-community.github.io/upgrade-helper/?from=0.67.5&to=0.70.6 (maybe in a separate branch for a better overview?)

@LeandraH
Copy link
Contributor

Will do

native/src/assets/licenses.json Outdated Show resolved Hide resolved
native/src/components/List.tsx Outdated Show resolved Hide resolved
native/src/components/__tests__/SnackbarContainer.spec.tsx Outdated Show resolved Hide resolved
@sarahsporck sarahsporck changed the title IGAPP-1061: Upgrade react and react native WIP: IGAPP-1061: Upgrade react and react native Jan 25, 2023
Copy link
Member

@steffenkleinle steffenkleinle left a comment

Choose a reason for hiding this comment

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

Tested on android and firefox

assets/licenses.json
src/assets/licenses.json
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Had to be moved. Maybe react resolves path now relative to src 🤷🏼‍♀️ (you'll need to remove your license.json in assets/licenses.json after this merge.

@@ -1,7 +1,7 @@
#!/usr/bin/env sh
Copy link
Contributor Author

Choose a reason for hiding this comment

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

auto generated by ./gradlew wrapper

@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
Copy link
Contributor Author

Choose a reason for hiding this comment

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

also auto generated by ./gradlew wrapper

@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.13)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

all the /jni/ files are basicly copy/pasted

@@ -54,18 +54,16 @@
"@react-native-async-storage/async-storage": "^1.16.3",
"@react-native-clipboard/clipboard": "^1.10.0",
"@react-native-community/geolocation": "^2.1.0",
"@react-native-community/masked-view": "^0.1.11",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

afaik not used

"@react-native-community/progress-view": "1.3.1",
"@react-native-firebase/app": "13.0.1",
"@react-native-firebase/messaging": "13.0.1",
"@react-native-mapbox-gl/maps": "^8.5.0",
"@react-navigation/elements": "^1.3.4",
"@react-navigation/native": "^6.0.11",
"@react-navigation/stack": "^6.2.2",
"@sentry/react-native": "^4.1.2",
"@sentry/types": "^7.5.0",
"@sentry/react-native": "^5.0.0-alpha.10",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

compatibility upgrade

},
},
watchFolders: [path.resolve(__dirname, '../')],
transformer: {
assetPlugins: ['react-native-svg-asset-plugin'],
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

option does not exist

@@ -1,4 +1,4 @@
import { act, render, screen, waitFor } from '@testing-library/react'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

half the tests in this file were failing after the upgrade. Therefore, many changes here.

Comment on lines -13 to +14
ReactDOM.render(<App />, container)
const root = createRoot(container)
root.render(<App />)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Enables concurrent renderer in web

@sarahsporck sarahsporck force-pushed the IGAPP-1061-upgrade-react-and-react-native branch 2 times, most recently from acdc849 to 7704e60 Compare January 31, 2023 13:13
@sarahsporck sarahsporck force-pushed the IGAPP-1061-upgrade-react-and-react-native branch from b79840f to f80c1a9 Compare February 1, 2023 08:16
@sarahsporck sarahsporck force-pushed the IGAPP-1061-upgrade-react-and-react-native branch from f80c1a9 to 0c5f2f3 Compare February 1, 2023 08:38
/**
* only needed as FormData is a web-specific type
* @jest-environment jsdom
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

jest-environment jsdom has been removed from jest. So to avoid adding another dependency I mocked FormData instead.

Copy link
Contributor

@LeandraH LeandraH left a comment

Choose a reason for hiding this comment

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

Tested it pretty thoroughly on a real iPhone :)

@sarahsporck sarahsporck force-pushed the IGAPP-1061-upgrade-react-and-react-native branch from 903ed77 to 4ebe9aa Compare February 6, 2023 08:08
@sarahsporck sarahsporck changed the title WIP: IGAPP-1061: Upgrade react and react native IGAPP-1061: Upgrade react and react native Feb 6, 2023
Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

@LeandraH looks like some stuff was messed up in project.pbxproj
At least the provisioning has to be reverted. I just roughly went through
Each change in this file should be tested if its needed. It was my bad not to check properly in your pr before

@sarahsporck
Copy link
Contributor Author

Finally the build finishes! Thank you @LeandraH and @f1sh1918 for your help with iOS <3

Copy link
Contributor

@f1sh1918 f1sh1918 left a comment

Choose a reason for hiding this comment

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

Tested on ios real device. works fine.

Maybe we could merge it monday, since martin is not working next week? Just an idea

@ztefanie
Copy link
Member

Please squash the commits and undo changes in version.json.

@f1sh1918 f1sh1918 merged commit fffb708 into main Feb 13, 2023
@f1sh1918 f1sh1918 deleted the IGAPP-1061-upgrade-react-and-react-native branch February 13, 2023 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants