diff --git a/Gemfile.lock b/Gemfile.lock index 95a250ee3a52..3dae6208e9af 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -172,10 +172,10 @@ GEM google-apis-firebaseappdistribution_v1alpha (~> 0.2.0) fastlane-sirp (1.0.0) sysrandom (~> 1.0) - ffi (1.17.0) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86_64-darwin) - ffi (1.17.0-x86_64-linux) + ffi (1.17.2) + ffi (1.17.2-arm64-darwin) + ffi (1.17.2-x86_64-darwin) + ffi (1.17.2-x86_64-linux-gnu) fourflusher (2.3.1) fuzzy_match (2.0.4) gh_inspector (1.1.3) diff --git a/babel.config.js b/babel.config.js index e1add8f250e4..2ce2cd62b04b 100644 --- a/babel.config.js +++ b/babel.config.js @@ -42,9 +42,9 @@ const defaultPluginsForWebpack = [ // We use `@babel/plugin-transform-class-properties` for transforming ReactNative libraries and do not use it for our own // source code transformation as we do not use class property assignment. '@babel/plugin-transform-class-properties', - + '@babel/plugin-proposal-export-namespace-from', // Keep it last - 'react-native-reanimated/plugin', + 'react-native-worklets/plugin', '@babel/plugin-transform-export-namespace-from', ]; @@ -81,8 +81,6 @@ const metro = { ['@babel/plugin-proposal-class-properties', {loose: true}], ['@babel/plugin-proposal-private-methods', {loose: true}], ['@babel/plugin-proposal-private-property-in-object', {loose: true}], - // The reanimated babel plugin needs to be last, as stated here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation - 'react-native-reanimated/plugin', /* Fullstory */ '@fullstory/react-native', @@ -134,6 +132,8 @@ const metro = { }, ], '@babel/plugin-transform-export-namespace-from', + // The worklets babel plugin needs to be last, as stated here: https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started/ + 'react-native-worklets/plugin', ], env: { production: { diff --git a/config/webpack/webpack.common.ts b/config/webpack/webpack.common.ts index ad3124aed049..33f78002d5b0 100644 --- a/config/webpack/webpack.common.ts +++ b/config/webpack/webpack.common.ts @@ -29,6 +29,7 @@ const PreloadWebpackPlugin = require('@vue/preload-webpack-plugin') as PreloadWe const includeModules = [ 'react-native-reanimated', + 'react-native-worklets', 'react-native-picker-select', 'react-native-web', 'react-native-webview', diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d0255ff13c93..659b5b6fa627 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -3559,7 +3559,7 @@ PODS: - RNGoogleSignin (10.0.1): - GoogleSignIn (~> 7.0) - React-Core - - RNLiveMarkdown (0.1.308): + - RNLiveMarkdown (0.1.310): - boost - DoubleConversion - fast_float @@ -3587,7 +3587,7 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNReanimated/worklets + - RNWorklets - SocketRocket - Yoga - RNLocalize (3.5.4): @@ -3735,7 +3735,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNReanimated (3.19.1): + - RNReanimated (4.1.2): - boost - DoubleConversion - fast_float @@ -3762,11 +3762,11 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNReanimated/reanimated (= 3.19.1) - - RNReanimated/worklets (= 3.19.1) + - RNReanimated/reanimated (= 4.1.2) + - RNWorklets - SocketRocket - Yoga - - RNReanimated/reanimated (3.19.1): + - RNReanimated/reanimated (4.1.2): - boost - DoubleConversion - fast_float @@ -3793,10 +3793,11 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNReanimated/reanimated/apple (= 3.19.1) + - RNReanimated/reanimated/apple (= 4.1.2) + - RNWorklets - SocketRocket - Yoga - - RNReanimated/reanimated/apple (3.19.1): + - RNReanimated/reanimated/apple (4.1.2): - boost - DoubleConversion - fast_float @@ -3823,9 +3824,10 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core + - RNWorklets - SocketRocket - Yoga - - RNReanimated/worklets (3.19.1): + - RNScreens (4.15.4): - boost - DoubleConversion - fast_float @@ -3841,21 +3843,21 @@ PODS: - React-Fabric - React-featureflags - React-graphics - - React-hermes - React-ImageManager - React-jsi - React-NativeModulesApple - React-RCTFabric + - React-RCTImage - React-renderercss - React-rendererdebug - React-utils - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNReanimated/worklets/apple (= 3.19.1) + - RNScreens/common (= 4.15.4) - SocketRocket - Yoga - - RNReanimated/worklets/apple (3.19.1): + - RNScreens/common (4.15.4): - boost - DoubleConversion - fast_float @@ -3871,11 +3873,11 @@ PODS: - React-Fabric - React-featureflags - React-graphics - - React-hermes - React-ImageManager - React-jsi - React-NativeModulesApple - React-RCTFabric + - React-RCTImage - React-renderercss - React-rendererdebug - React-utils @@ -3884,7 +3886,7 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNScreens (4.15.4): + - RNSentry (7.4.0): - boost - DoubleConversion - fast_float @@ -3900,21 +3902,21 @@ PODS: - React-Fabric - React-featureflags - React-graphics + - React-hermes - React-ImageManager - React-jsi - React-NativeModulesApple - React-RCTFabric - - React-RCTImage - React-renderercss - React-rendererdebug - React-utils - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNScreens/common (= 4.15.4) + - Sentry/HybridSDK (= 8.57.0) - SocketRocket - Yoga - - RNScreens/common (4.15.4): + - RNShare (11.0.2): - boost - DoubleConversion - fast_float @@ -3934,7 +3936,6 @@ PODS: - React-jsi - React-NativeModulesApple - React-RCTFabric - - React-RCTImage - React-renderercss - React-rendererdebug - React-utils @@ -3943,7 +3944,12 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNSentry (7.4.0): + - RNSound (0.11.2): + - React-Core + - RNSound/Core (= 0.11.2) + - RNSound/Core (0.11.2): + - React-Core + - RNSVG (15.12.1): - boost - DoubleConversion - fast_float @@ -3959,7 +3965,6 @@ PODS: - React-Fabric - React-featureflags - React-graphics - - React-hermes - React-ImageManager - React-jsi - React-NativeModulesApple @@ -3970,10 +3975,10 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - Sentry/HybridSDK (= 8.57.0) + - RNSVG/common (= 15.12.1) - SocketRocket - Yoga - - RNShare (11.0.2): + - RNSVG/common (15.12.1): - boost - DoubleConversion - fast_float @@ -4001,12 +4006,37 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNSound (0.11.2): - - React-Core - - RNSound/Core (= 0.11.2) - - RNSound/Core (0.11.2): + - RNWorklets (0.6.0): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety - React-Core - - RNSVG (15.12.1): + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - RNWorklets/worklets (= 0.6.0) + - SocketRocket + - Yoga + - RNWorklets/worklets (0.6.0): - boost - DoubleConversion - fast_float @@ -4022,6 +4052,7 @@ PODS: - React-Fabric - React-featureflags - React-graphics + - React-hermes - React-ImageManager - React-jsi - React-NativeModulesApple @@ -4032,10 +4063,10 @@ PODS: - ReactCodegen - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - - RNSVG/common (= 15.12.1) + - RNWorklets/worklets/apple (= 0.6.0) - SocketRocket - Yoga - - RNSVG/common (15.12.1): + - RNWorklets/worklets/apple (0.6.0): - boost - DoubleConversion - fast_float @@ -4051,6 +4082,7 @@ PODS: - React-Fabric - React-featureflags - React-graphics + - React-hermes - React-ImageManager - React-jsi - React-NativeModulesApple @@ -4227,6 +4259,7 @@ DEPENDENCIES: - RNShare (from `../node_modules/react-native-share`) - RNSound (from `../node_modules/react-native-sound`) - RNSVG (from `../node_modules/react-native-svg`) + - RNWorklets (from `../node_modules/react-native-worklets`) - SocketRocket (~> 0.7.1) - VisionCamera (from `../node_modules/react-native-vision-camera`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) @@ -4559,6 +4592,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-sound" RNSVG: :path: "../node_modules/react-native-svg" + RNWorklets: + :path: "../node_modules/react-native-worklets" VisionCamera: :path: "../node_modules/react-native-vision-camera" Yoga: @@ -4735,18 +4770,19 @@ SPEC CHECKSUMS: RNFS: 4ac0f0ea233904cb798630b3c077808c06931688 RNGestureHandler: 9339994ea5d1ff6ad2679b7d0cc3d49053111369 RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 - RNLiveMarkdown: 835074fb8fd0afb493c7c2b73076a0f2738a8f63 + RNLiveMarkdown: 51e46a8300e2eb6f2d3e898b7734b3833532dba6 RNLocalize: 0aa716b7d0f1316ca5f8f16ed42b79b9e3093279 rnmapbox-maps: 870cd752e1d132e05465f3074b582ce6c7e742e9 RNNitroSQLite: d5cf8c550c51015e1ecc93ff6e7509187c6c1c9e RNPermissions: d507f1fe0ee109c8f6f882808fcf8a173645e40b RNReactNativeHapticFeedback: 43c09eb41d8321be2e1375cb87ae734e58f677b0 - RNReanimated: 8d0f830cd94d0d9cc86eed5850e567a89807586e + RNReanimated: 91d075aaf0c89d51a0708cd64cd6c77f7fa42cdc RNScreens: 0c5341cc352632758171de6453502a6a757d0369 RNSentry: 34bead6afbfce1bb89837b84da1dec001f890329 RNShare: 385bf6a127cb075d4fdbe7bb85587cad88fe9afe RNSound: 6c156f925295bdc83e8e422e7d8b38d33bc71852 RNSVG: 9be2bc57df95a874e8c4b0f7dd71866139f321d2 + RNWorklets: e752b7443b51916158d3b6ca6700294827e8a1ea SDWebImage: 9f177d83116802728e122410fb25ad88f5c7608a SDWebImageAVIFCoder: afe194a084e851f70228e4be35ef651df0fc5c57 SDWebImageSVGCoder: 15a300a97ec1c8ac958f009c02220ac0402e936c diff --git a/jest/setup.ts b/jest/setup.ts index 161133fbd6b7..c12d8aa09cf1 100644 --- a/jest/setup.ts +++ b/jest/setup.ts @@ -90,6 +90,7 @@ jest.mock('react-native-reanimated', () => ({ useScrollViewOffset: jest.fn(() => 0), useAnimatedRef: jest.fn(() => jest.fn()), LayoutAnimationConfig: jest.fn, + makeShareableCloneRecursive: jest.fn, })); jest.mock('react-native-keyboard-controller', () => require('react-native-keyboard-controller/jest')); diff --git a/package-lock.json b/package-lock.json index b74e967387b5..f69d29fc5c30 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@expensify/nitro-utils": "file:./modules/ExpensifyNitroUtils", "@expensify/react-native-background-task": "file:./modules/background-task", "@expensify/react-native-hybrid-app": "file:./modules/hybrid-app", - "@expensify/react-native-live-markdown": "0.1.308", + "@expensify/react-native-live-markdown": "0.1.310", "@expensify/react-native-wallet": "0.1.11", "@expo/metro-runtime": "^6.0.2", "@firebase/app": "^0.13.2", @@ -126,7 +126,7 @@ "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#07d60d78d4772d47afd7a744940fc6b6d1881806", "react-native-plaid-link-sdk": "12.5.3", "react-native-qrcode-svg": "6.3.14", - "react-native-reanimated": "3.19.1", + "react-native-reanimated": "4.1.2", "react-native-release-profiler": "0.4.2", "react-native-render-html": "6.3.1", "react-native-safe-area-context": "5.4.0", @@ -140,6 +140,7 @@ "react-native-vision-camera": "^4.7.2", "react-native-web": "0.21.2", "react-native-webview": "13.16.0", + "react-native-worklets": "0.6.0", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", "react-webcam": "^7.1.1", @@ -4191,9 +4192,9 @@ "link": true }, "node_modules/@expensify/react-native-live-markdown": { - "version": "0.1.308", - "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.308.tgz", - "integrity": "sha512-KRmWSL2KVidNzaDS4RnyUx68suF6i/UPcaIHHvmK90LhnpmkOa9wUrxO3RIpmkJWf2AYk9BfMtN0fpXLxl/arw==", + "version": "0.1.310", + "resolved": "https://registry.npmjs.org/@expensify/react-native-live-markdown/-/react-native-live-markdown-0.1.310.tgz", + "integrity": "sha512-3uFLW1YWrliLFYcPzQkSanhyLDaA5MzBQGtvm4bh68aH5KwpHUv9Z3HByDBbIrrTsXc3pkncunIHM0g23KW/aw==", "license": "MIT", "workspaces": [ "./example", @@ -33061,7 +33062,9 @@ "license": "MIT" }, "node_modules/react-native-is-edge-to-edge": { - "version": "1.1.7", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/react-native-is-edge-to-edge/-/react-native-is-edge-to-edge-1.2.1.tgz", + "integrity": "sha512-FLbPWl/MyYQWz+KwqOZsSyj2JmLKglHatd3xLZWskXOpRaio4LfEDEz8E/A6uD8QoTHW6Aobw1jbEwK7KMgR7Q==", "license": "MIT", "peerDependencies": { "react": "*", @@ -33100,14 +33103,6 @@ "react-native-reanimated": ">=3.0.0" } }, - "node_modules/react-native-keyboard-controller/node_modules/react-native-is-edge-to-edge": { - "version": "1.2.1", - "license": "MIT", - "peerDependencies": { - "react": "*", - "react-native": "*" - } - }, "node_modules/react-native-launch-arguments": { "version": "4.0.2", "license": "MIT", @@ -33503,26 +33498,31 @@ } }, "node_modules/react-native-reanimated": { - "version": "3.19.1", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/react-native-reanimated/-/react-native-reanimated-4.1.2.tgz", + "integrity": "sha512-qzmQiFrvjm62pRBcj97QI9Xckc3EjgHQoY1F2yjktd0kpjhoyePeuTEXjYRCAVIy7IV/1cfeSup34+zFThFoHQ==", "license": "MIT", "dependencies": { - "@babel/plugin-transform-arrow-functions": "^7.0.0-0", - "@babel/plugin-transform-class-properties": "^7.0.0-0", - "@babel/plugin-transform-classes": "^7.0.0-0", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", - "@babel/plugin-transform-optional-chaining": "^7.0.0-0", - "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", - "@babel/plugin-transform-template-literals": "^7.0.0-0", - "@babel/plugin-transform-unicode-regex": "^7.0.0-0", - "@babel/preset-typescript": "^7.16.7", - "convert-source-map": "^2.0.0", - "invariant": "^2.2.4", - "react-native-is-edge-to-edge": "1.1.7" + "react-native-is-edge-to-edge": "^1.2.1", + "semver": "7.7.2" }, "peerDependencies": { "@babel/core": "^7.0.0-0", "react": "*", - "react-native": "*" + "react-native": "*", + "react-native-worklets": ">=0.5.0" + } + }, + "node_modules/react-native-reanimated/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/react-native-release-profiler": { @@ -33665,16 +33665,6 @@ "react-native": "*" } }, - "node_modules/react-native-screens/node_modules/react-native-is-edge-to-edge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/react-native-is-edge-to-edge/-/react-native-is-edge-to-edge-1.2.1.tgz", - "integrity": "sha512-FLbPWl/MyYQWz+KwqOZsSyj2JmLKglHatd3xLZWskXOpRaio4LfEDEz8E/A6uD8QoTHW6Aobw1jbEwK7KMgR7Q==", - "license": "MIT", - "peerDependencies": { - "react": "*", - "react-native": "*" - } - }, "node_modules/react-native-share": { "version": "11.0.2", "license": "MIT", @@ -33806,6 +33796,42 @@ "react-native": "*" } }, + "node_modules/react-native-worklets": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/react-native-worklets/-/react-native-worklets-0.6.0.tgz", + "integrity": "sha512-yETMNuCcivdYWteuG4eRqgiAk2DzRCrVAaEBIEWPo4emrf3BNjadFo85L5QvyEusrX9QKE3ZEAx8U5A/nbyFgg==", + "license": "MIT", + "dependencies": { + "@babel/plugin-transform-arrow-functions": "^7.0.0-0", + "@babel/plugin-transform-class-properties": "^7.0.0-0", + "@babel/plugin-transform-classes": "^7.0.0-0", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.0.0-0", + "@babel/plugin-transform-optional-chaining": "^7.0.0-0", + "@babel/plugin-transform-shorthand-properties": "^7.0.0-0", + "@babel/plugin-transform-template-literals": "^7.0.0-0", + "@babel/plugin-transform-unicode-regex": "^7.0.0-0", + "@babel/preset-typescript": "^7.16.7", + "convert-source-map": "^2.0.0", + "semver": "7.7.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0", + "react": "*", + "react-native": "*" + } + }, + "node_modules/react-native-worklets/node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/react-native/node_modules/@react-native/normalize-colors": { "version": "0.81.4", "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.81.4.tgz", diff --git a/package.json b/package.json index 02ce3999d504..15d401846b95 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "@expensify/nitro-utils": "file:./modules/ExpensifyNitroUtils", "@expensify/react-native-background-task": "file:./modules/background-task", "@expensify/react-native-hybrid-app": "file:./modules/hybrid-app", - "@expensify/react-native-live-markdown": "0.1.308", + "@expensify/react-native-live-markdown": "0.1.310", "@expensify/react-native-wallet": "0.1.11", "@expo/metro-runtime": "^6.0.2", "@firebase/app": "^0.13.2", @@ -196,7 +196,7 @@ "react-native-picker-select": "git+https://github.com/Expensify/react-native-picker-select.git#07d60d78d4772d47afd7a744940fc6b6d1881806", "react-native-plaid-link-sdk": "12.5.3", "react-native-qrcode-svg": "6.3.14", - "react-native-reanimated": "3.19.1", + "react-native-reanimated": "4.1.2", "react-native-release-profiler": "0.4.2", "react-native-render-html": "6.3.1", "react-native-safe-area-context": "5.4.0", @@ -210,6 +210,7 @@ "react-native-vision-camera": "^4.7.2", "react-native-web": "0.21.2", "react-native-webview": "13.16.0", + "react-native-worklets": "0.6.0", "react-plaid-link": "3.3.2", "react-web-config": "^1.0.0", "react-webcam": "^7.1.1", diff --git a/patches/react-native-reanimated/details.md b/patches/react-native-reanimated/details.md index fb80b770dd63..5762a8e68282 100644 --- a/patches/react-native-reanimated/details.md +++ b/patches/react-native-reanimated/details.md @@ -1,37 +1,9 @@ # `react-native-reanimated` patches -### [react-native-reanimated+3.19.1+001+catch-all-exceptions-on-stoi.patch](react-native-reanimated+3.19.1+001+catch-all-exceptions-on-stoi.patch) +### [react-native-reanimated+4.1.2+001+catch-all-exceptions-on-stoi.patch](react-native-reanimated+4.1.2+001+catch-all-exceptions-on-stoi.patch) - Reason: Reanimated wasn't able to catch an exception here, so the catch clause was broadened. - Upstream PR/issue: 🛑 - E/App issue: 🛑 -- PR Introducing Patch: [Upgrade to React Native 0.76](https://github.com/Expensify/App/pull/51475) - -### [react-native-reanimated+3.19.1+002+dontWhitelistTextProp.patch](react-native-reanimated+3.19.1+002+dontWhitelistTextProp.patch) - -- Reason: In Expensify `text` prop in a JS prop and not in native code. Recheck if this is still needed when migrating to v4. -- Upstream PR/issue: 🛑 -- E/App issue: 🛑 -- PR Introducing Patch: [NR 0.75 upgrade](https://github.com/Expensify/App/pull/45289) - -### [react-native-reanimated+3.19.1+003+correctly-handle-Easing.bezier.patch](react-native-reanimated+3.19.1+003+correctly-handle-Easing.bezier.patch) - -- Reason: The Easing.bezier animation doesn't work on web -- Upstream PR/issue: https://github.com/software-mansion/react-native-reanimated/pull/8049 -- E/App issue: https://github.com/Expensify/App/pull/63623 -- PR Introducing Patch: 🛑 - -### [react-native-reanimated+3.19.1+004+reduce-motion-animation-callbacks.patch](react-native-reanimated+3.19.1+004+reduce-motion-animation-callbacks.patch) - -- Reason: The layout animation callbacks were not called when Reduce Motion accessibility setting was enabled on mobile devices (on native apps). This caused the app to be unresponsive after opening a modal. -- Upstream PR/issue: https://github.com/software-mansion/react-native-reanimated/pull/8142 -- E/App issue: https://github.com/Expensify/App/issues/69190 -- PR Introducing Patch: https://github.com/Expensify/App/pull/69444 - -### [react-native-reanimated+3.19.1+005+fix-broken-slideInUp-animation.patch](react-native-reanimated+3.19.1+005+fix-broken-slideInUp-animation.patch) - -- Reason: `SlideInUp` animation is not working correctly with React Native 0.81. The fix is already present in reanimated v4, but has not been backported yet -- Upstream PR/issue: https://github.com/software-mansion/react-native-reanimated/pull/8089 -- E/App issue: -- PR Introducing Patch: https://github.com/Expensify/App/pull/69535 +- PR Introducing Patch: [Upgrade to React Native 0.76](https://github.com/Expensify/App/pull/51475) \ No newline at end of file diff --git a/patches/react-native-reanimated/react-native-reanimated+3.19.1+002+dontWhitelistTextProp.patch b/patches/react-native-reanimated/react-native-reanimated+3.19.1+002+dontWhitelistTextProp.patch deleted file mode 100644 index 583cc7015ee4..000000000000 --- a/patches/react-native-reanimated/react-native-reanimated+3.19.1+002+dontWhitelistTextProp.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx b/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx -index d4b31f2..ced6561 100644 ---- a/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx -+++ b/node_modules/react-native-reanimated/src/component/PerformanceMonitor.tsx -@@ -46,7 +46,6 @@ function createCircularDoublesBuffer(size: number) { - } - - const DEFAULT_BUFFER_SIZE = 20; --addWhitelistedNativeProps({ text: true }); - const AnimatedTextInput = createAnimatedComponent(TextInput); - - function loopAnimationFrame(fn: (lastTime: number, time: number) => void) { diff --git a/patches/react-native-reanimated/react-native-reanimated+3.19.1+003+correctly-handle-Easing.bezier.patch b/patches/react-native-reanimated/react-native-reanimated+3.19.1+003+correctly-handle-Easing.bezier.patch deleted file mode 100644 index b623fc7f758e..000000000000 --- a/patches/react-native-reanimated/react-native-reanimated+3.19.1+003+correctly-handle-Easing.bezier.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff --git a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js -index ed0f9d3..6baf136 100644 ---- a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js -+++ b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/Easing.web.js -@@ -14,4 +14,18 @@ export const WebEasings = { - export function getEasingByName(easingName) { - return `cubic-bezier(${WebEasings[easingName].toString()})`; - } --//# sourceMappingURL=Easing.web.js.map -\ No newline at end of file -+export function maybeGetBezierEasing(easing) { -+ if (!('factory' in easing)) { -+ return null; -+ } -+ const easingFactory = easing.factory; -+ if (!('__closure' in easingFactory)) { -+ return null; -+ } -+ const closure = easingFactory.__closure; -+ if (!('Bezier' in closure)) { -+ return null; -+ } -+ return `cubic-bezier(${closure.x1}, ${closure.y1}, ${closure.x2}, ${closure.y2})`; -+} -+ -diff --git a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js -index 7f724c4..ad53a74 100644 ---- a/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js -+++ b/node_modules/react-native-reanimated/lib/module/layoutReanimation/web/componentUtils.js -@@ -10,18 +10,28 @@ import { setElementPosition, snapshots } from "./componentStyle.js"; - import { Animations, TransitionType } from "./config.js"; - import { TransitionGenerator } from "./createAnimation.js"; - import { scheduleAnimationCleanup } from "./domUtils.js"; --import { getEasingByName, WebEasings } from "./Easing.web.js"; -+import { -+ getEasingByName, -+ maybeGetBezierEasing, -+ WebEasings -+} from "./Easing.web.js"; - import { prepareCurvedTransition } from "./transition/Curved.web.js"; - function getEasingFromConfig(config) { - if (!config.easingV) { - return getEasingByName('linear'); - } - const easingName = config.easingV[EasingNameSymbol]; -- if (!(easingName in WebEasings)) { -- logger.warn(`Selected easing is not currently supported on web.`); -+ if (easingName in WebEasings) { -+ return getEasingByName(easingName); -+ } -+ const bezierEasing = maybeGetBezierEasing(config.easingV); -+ if (!bezierEasing) { -+ logger.warn( -+ `Selected easing is not currently supported on web. Using linear easing instead.` -+ ); - return getEasingByName('linear'); - } -- return getEasingByName(easingName); -+ return bezierEasing; - } - function getRandomDelay(maxDelay = 1000) { - return Math.floor(Math.random() * (maxDelay + 1)) / 1000; diff --git a/patches/react-native-reanimated/react-native-reanimated+3.19.1+004+reduce-motion-animation-callbacks.patch b/patches/react-native-reanimated/react-native-reanimated+3.19.1+004+reduce-motion-animation-callbacks.patch deleted file mode 100644 index 03310811d5df..000000000000 --- a/patches/react-native-reanimated/react-native-reanimated+3.19.1+004+reduce-motion-animation-callbacks.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff --git a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx -index a2f6cf1..93a37f5 100644 ---- a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx -+++ b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx -@@ -503,13 +503,6 @@ export function createAnimatedComponent( - return; - } - -- if (this._isReducedMotion(currentConfig)) { -- if (!previousConfig) { -- return; -- } -- currentConfig = undefined; -- } -- - updateLayoutAnimations( - isFabric() && type === LayoutAnimationType.ENTERING - ? this.reanimatedID -@@ -608,14 +601,6 @@ export function createAnimatedComponent( - }, - }); - -- _isReducedMotion(config?: LayoutAnimationOrBuilder): boolean { -- return config && -- 'getReduceMotion' in config && -- typeof config.getReduceMotion === 'function' -- ? getReduceMotionFromConfig(config.getReduceMotion()) -- : getReduceMotionFromConfig(); -- } -- - // This is a component lifecycle method from React, therefore we are not calling it directly. - // It is called before the component gets rerendered. This way we can access components' position before it changed - // and later on, in componentDidUpdate, calculate translation for layout transition. diff --git a/patches/react-native-reanimated/react-native-reanimated+3.19.1+005+fix-broken-slideInUp-animation.patch b/patches/react-native-reanimated/react-native-reanimated+3.19.1+005+fix-broken-slideInUp-animation.patch deleted file mode 100644 index 2e4e06749b85..000000000000 --- a/patches/react-native-reanimated/react-native-reanimated+3.19.1+005+fix-broken-slideInUp-animation.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/node_modules/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt b/node_modules/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt -index c61b03a..a3a3428 100644 ---- a/node_modules/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt -+++ b/node_modules/react-native-reanimated/android/src/main/cpp/reanimated/CMakeLists.txt -@@ -36,3 +36,6 @@ if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) - else() - target_link_libraries(reanimated ReactAndroid::react_nativemodule_core) - endif() -+ -+include("${REACT_NATIVE_DIR}/ReactCommon/cmake-utils/react-native-flags.cmake") -+target_compile_reactnative_options(reanimated PUBLIC) diff --git a/patches/react-native-reanimated/react-native-reanimated+3.19.1+001+catch-all-exceptions-on-stoi.patch b/patches/react-native-reanimated/react-native-reanimated+4.1.2+001+catch-all-exceptions-on-stoi.patch similarity index 87% rename from patches/react-native-reanimated/react-native-reanimated+3.19.1+001+catch-all-exceptions-on-stoi.patch rename to patches/react-native-reanimated/react-native-reanimated+4.1.2+001+catch-all-exceptions-on-stoi.patch index 2fdf25db7f64..4e168c22a926 100644 --- a/patches/react-native-reanimated/react-native-reanimated+3.19.1+001+catch-all-exceptions-on-stoi.patch +++ b/patches/react-native-reanimated/react-native-reanimated+4.1.2+001+catch-all-exceptions-on-stoi.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp b/node_modules/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp -index 8102462..f2738d2 100644 +index 6574d2d..8cb9b2f 100644 --- a/node_modules/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp +++ b/node_modules/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsProxy.cpp -@@ -853,7 +853,7 @@ void LayoutAnimationsProxy::transferConfigFromNativeID( +@@ -805,7 +805,7 @@ void LayoutAnimationsProxy::transferConfigFromNativeID( auto nativeId = stoi(nativeIdString); layoutAnimationsManager_->transferConfigFromNativeID(nativeId, tag); } catch (std::invalid_argument) { @@ -10,4 +10,4 @@ index 8102462..f2738d2 100644 + } catch (...) { } } - + diff --git a/tests/perf-test/ReportActionCompose.perf-test.tsx b/tests/perf-test/ReportActionCompose.perf-test.tsx index f9edb3db4631..92c7b77456e8 100644 --- a/tests/perf-test/ReportActionCompose.perf-test.tsx +++ b/tests/perf-test/ReportActionCompose.perf-test.tsx @@ -28,6 +28,7 @@ jest.mock('react-native-reanimated', () => ({ easing: jest.fn().mockReturnThis(), withCallback: jest.fn().mockReturnThis(), })), + makeShareableCloneRecursive: jest.fn, })); jest.mock('../../src/libs/Navigation/Navigation', () => ({