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

build(deps): bump react-native from 0.72.17 to 0.73.9 #10739

Merged
merged 35 commits into from
Sep 19, 2024

Conversation

gkartalis
Copy link
Member

@gkartalis gkartalis commented Sep 10, 2024

This PR resolves PHIRE-1181

Description

Bumps react-native version from 0.72.17 to 0.73.9

What changed:

  • Debugging improvements
  • Console Log history in Hermes
  • Updated debugging docs
  • Experimental New Debugger
  • Stable Symlink Support in Metro
  • Better Android 14 support
  • Java bump from 11 to 17
  • Gradle Bump from 7.4.x to 8.1.x

You can read more info on RN 73 official blogpost

Which Deps were bumped and why:

  • @braze/react-native-sdk: 5.2.0 ~> 8.4.0
  • @react-native-async-storage/async-storage: 1.19.3 ~> 1.19.8
  • @react-native-clipboard/clipboard: 1.7.0 ~> 1.14.1
  • react-native-code-push: 8.1.0 ~> 8.3.1
  • react-native-gesture-handler: 2.13.1 ~> 2.19.0
  • react-native-webview: 13.6.2 ~> 13.6.3

React Native 0.73 will depend on Android Gradle Plugin (AGP) 8.x. This will require all the libraries to specify a namespace in their build.gradle file. RN team added a compatibility layer for libraries that haven't specified a namespace, but please consider updating your libraries nonetheless.

Read more here

Patches:

Enhanced react native patch with .mock('../Libraries/Image/Image', () => mockComponent('../Libraries/Image/Image')) due to this issue.

DevExperience Before / After:

Metro is way faster when bundling the app (around ~2x faster)

Android builds have an insane boost that is mostly due to java 17 and gradle updates:

On emulator with cleared cache / deleted app:

Before After
androidBuildBefore Screenshot 2024-09-13 at 12 43 39

on emulator with cached build:

Before After
Screenshot 2024-09-13 at 13 22 59 Screenshot 2024-09-13 at 12 44 32

Steps To Upgrade on your machine after this gets merged:

# Delete node modules and caches:
rm -rf node_modules && rm -rf .cache && rm -rf "$TMPDIR/metro*" && rm -rf "$TMPDIR/haste-map-*"

# install all the dependencies needed
yarn install:all

# you will most likely have to run also the following to bump hermes-engine:
cd ios && bundle exec pod update hermes-engine --no-repo-update & cd ..

Afterwards in order to bump JAVA:

For asdf users:

asdf install

For non-asdf users:

brew install --cask zulu@17

# Get path to where cask was installed to double-click installer
brew info --cask zulu@17

Important

For all (asdf/ non asdf users). After you install the JDK, update your JAVA_HOME environment variable in your .zshrc file. Afterwards run source ~/.zshrc to make it effective and restart your terminal.
If you used above steps, JDK will likely be at /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home.
You can try out in the terminal by typing $JAVA_HOME to make sure that it was updated properly.

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

  • bumps react-native to 0.73.9 - gkartalis

Need help with something? Have a look at our docs, or get in touch with us.

@gkartalis gkartalis self-assigned this Sep 10, 2024
@gkartalis gkartalis force-pushed the gkartalis/bump-rn-to-73.9 branch from 9615470 to 21b596e Compare September 10, 2024 14:03
@gkartalis gkartalis changed the title build(deps): bump react-native from 0.72.17 to 0.73.9 build(deps): bump react-native from 0.72.17 to 0.73.9 #WIP #DONOTMERGE Sep 10, 2024
@ArtsyOpenSource
Copy link
Contributor

ArtsyOpenSource commented Sep 10, 2024

This PR contains the following changes:

  • Dev changes (bumps react-native to 0.73.9 - gkartalis)

Generated by 🚫 dangerJS against 3a01245

@@ -1,3 +1,3 @@
nodejs 20.9.0
ruby 3.1.4
java zulu-11.58.15
java zulu-17.50.19
Copy link
Member Author

Choose a reason for hiding this comment

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

Java bump to 17

@@ -0,0 +1,99 @@
package net.artsy.app
Copy link
Member Author

Choose a reason for hiding this comment

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

we had to re-write this with Kotlin 🙈

@@ -0,0 +1,86 @@
package net.artsy.app

Copy link
Member Author

Choose a reason for hiding this comment

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

we had to re-write this with Kotlin 🙈

Comment on lines +23 to +25
extraNodeModules: {
images: path.resolve(__dirname, "./images"), // Add this line for Metro to resolve 'images folder'
},
Copy link
Member Author

Choose a reason for hiding this comment

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

Big GOTCHA, images/ path stopped being recognised after the rn bump and we had to let metro config know where they are

Comment on lines +120 to +121
"@react-native-async-storage/async-storage": "1.19.8",
"@react-native-clipboard/clipboard": "1.14.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to bump these in order for them to be rn 73 compliant

"react-native-blob-util": "0.19.9",
"react-native-blurhash": "1.1.11",
"react-native-bootsplash": "3.2.0",
"react-native-code-push": "8.1.0",
"react-native-code-push": "8.3.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to bump in order for them to be rn 73 compliant

@@ -190,7 +191,7 @@
"react-native-url-polyfill": "2.0.0",
"react-native-view-shot": "3.8.0",
"react-native-vimeo-iframe": "1.2.1",
"react-native-webview": "13.6.2",
"react-native-webview": "13.6.3",
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to bump in order for them to be rn 73 compliant

"react-native-config": "https://github.com/artsy/react-native-config.git#v1.4.12-artsy",
"react-native-context-menu-view": "git+https://github.com/artsy/react-native-context-menu-view.git#v1.10.10-artsy",
"react-native-dev-menu-android": "1.0.10",
"react-native-device-info": "10.3.0",
"react-native-document-picker": "9.3.0",
"react-native-fast-image": "8.6.3",
"react-native-fbsdk-next": "13.0.0",
"react-native-gesture-handler": "2.13.1",
"react-native-flipper": "0.265.0",
"react-native-gesture-handler": "2.19.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

Had to bump in order for them to be rn 73 compliant

Copy link
Contributor

@brainbicycle brainbicycle left a comment

Choose a reason for hiding this comment

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

This looks great!
Two small ones:

  • the braze push handling in MainActivity is commented out, I think it is still necessary? 🤔
  • I think the react native patch may have gotten some generated code carried along

#### Explanation/Context:

We had to patch Braze in order to proceed with the react native upgrade to 0.73.9. The patch was needed to support kotlin jvm target 17 and
in order to also make targetCompatibility and sourceCompatibility compatible with the JAVA 17 which is the standard for newer rn versions starting 0.73.
Copy link
Contributor

Choose a reason for hiding this comment

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

we should do some braze testing on Android in QA!

Copy link
Member Author

Choose a reason for hiding this comment

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

💯

Copy link
Member Author

Choose a reason for hiding this comment

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

we will probably need to test out both android & iOS thoroughly, had to bump to 8.4.0 in the end - will remove the hack entry

}
val token = task.result
// Log.i(TAG, "TOKEN firebase messaging token $token")
// Braze.getInstance(applicationContext).setRegisteredPushToken(token)
Copy link
Contributor

Choose a reason for hiding this comment

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

this meant to still be commented out? do we need this to get push tokens registered for braze on Android?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was getting an error here when trying to build ~ I think that in the end we will need to bump braze to be compliant 🫨 .

Seems like they moved this function to JS side ~ will trigger betas after I address that to test if it works

android/gradlew Show resolved Hide resolved
ios/Artsy/App_Resources/Info.plist Show resolved Hide resolved
ios/Podfile Show resolved Hide resolved
patches/react-native+0.73.9.patch Outdated Show resolved Hide resolved
@gkartalis
Copy link
Member Author

Bumped braze to 8.4.0 in the end ~ moved the registration of the token to the JS side since I was getting build errors from a depracated method from setRegisteredPushToken tried some others and no luck thus I moved the token to the JS side.

Let me know if you have any concerns ~ but I Was thinking to open a separate PR for braze 🤷‍♂️

@gkartalis gkartalis requested a review from damassi September 13, 2024 15:16
@gkartalis
Copy link
Member Author

FreshBetas:

android-8.51.0-1674645836
ios - 8.51.0 - 2024.9.13.15

@gkartalis
Copy link
Member Author

Braze works! Received notifications in both android / ios betas above

MrSltun
MrSltun previously approved these changes Sep 16, 2024
Copy link
Member

@MrSltun MrSltun left a comment

Choose a reason for hiding this comment

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

Thank you for pushing through this!! 💪 ⚡ 📈

@@ -235,6 +236,8 @@ export async function configure() {
// (optional) Called when Token is generated (iOS and Android)
onRegister: async (token) => {
try {
registerPushToken(token.token)
Copy link
Contributor

Choose a reason for hiding this comment

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

nice

brainbicycle
brainbicycle previously approved these changes Sep 16, 2024
@gkartalis gkartalis dismissed stale reviews from brainbicycle and MrSltun via 759d3c6 September 16, 2024 14:31
@gkartalis gkartalis force-pushed the gkartalis/bump-rn-to-73.9 branch 2 times, most recently from 759d3c6 to c709193 Compare September 19, 2024 09:01
@gkartalis gkartalis force-pushed the gkartalis/bump-rn-to-73.9 branch from 1090bec to 3a01245 Compare September 19, 2024 15:30
@gkartalis gkartalis added the Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green label Sep 19, 2024
@artsy-peril artsy-peril bot merged commit 552c9dc into main Sep 19, 2024
7 checks passed
@artsy-peril artsy-peril bot deleted the gkartalis/bump-rn-to-73.9 branch September 19, 2024 15:56
@brainbicycle brainbicycle changed the title build(deps): bump react-native from 0.72.17 to 0.73.9 #WIP #DONOTMERGE build(deps): bump react-native from 0.72.17 to 0.73.9 Sep 23, 2024
@artsy-peril
Copy link
Contributor

artsy-peril bot commented Sep 23, 2024

@react-native/typescript-config

Author: Unknown

Description: Default TypeScript configuration for React Native apps

Homepage: https://github.com/facebook/react-native/tree/HEAD/packages/typescript-config#readme

Createdover 1 year ago
Last Updatedabout 13 hours ago
LicenseMIT
Maintainers2
Releases365
Keywordstypescript, tsconfig and react-native

@react-native/babel-preset

Author: Unknown

Description: Babel preset for React Native applications

Homepage: https://github.com/facebook/react-native#readme

Createdover 1 year ago
Last Updatedabout 13 hours ago
LicenseMIT
Maintainers2
Releases388
Direct Dependencies@babel/core, react-refresh, @babel/template, @babel/plugin-syntax-flow, @babel/plugin-transform-for-of, @babel/plugin-transform-spread, @babel/plugin-transform-classes, @babel/plugin-transform-runtime, @babel/plugin-transform-literals, @babel/plugin-transform-react-jsx, babel-plugin-transform-flow-enums, @babel/plugin-transform-parameters, @babel/plugin-transform-typescript, @react-native/babel-plugin-codegen, @babel/plugin-syntax-dynamic-import, @babel/plugin-transform-regenerator, @babel/plugin-transform-sticky-regex, @babel/plugin-transform-block-scoping, @babel/plugin-transform-destructuring, @babel/plugin-transform-function-name, @babel/plugin-transform-unicode-regex, @babel/plugin-syntax-optional-chaining, @babel/plugin-transform-react-jsx-self, @babel/plugin-transform-arrow-functions, @babel/plugin-transform-private-methods, @babel/plugin-syntax-export-default-from, @babel/plugin-transform-class-properties, @babel/plugin-transform-flow-strip-types, @babel/plugin-transform-modules-commonjs, @babel/plugin-transform-react-jsx-source, @babel/plugin-transform-numeric-separator, @babel/plugin-transform-optional-chaining, @babel/plugin-proposal-export-default-from, @babel/plugin-transform-async-to-generator, @babel/plugin-transform-object-rest-spread, @babel/plugin-transform-react-display-name, @babel/plugin-transform-computed-properties, @babel/plugin-transform-shorthand-properties, @babel/plugin-transform-optional-catch-binding, @babel/plugin-syntax-nullish-coalescing-operator, @babel/plugin-transform-async-generator-functions, @babel/plugin-transform-private-property-in-object, @babel/plugin-transform-nullish-coalescing-operator, @babel/plugin-transform-logical-assignment-operators and @babel/plugin-transform-named-capturing-groups-regex
Keywordsbabel, preset and react-native

New dependencies added: @react-native/babel-preset and @react-native/typescript-config.

Generated by 🚫 dangerJS against 3a01245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Jira Synced post-react-conf-updates Squash On Green A label to indicate that Peril should squash-merge this PR when all statuses are green
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants