From 1858c2a1e1ba8f6dffcf6ce16cd5710863962451 Mon Sep 17 00:00:00 2001 From: Jack Nam <30609178+thienlnam@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:50:37 -0700 Subject: [PATCH] Merge pull request #44006 from Expensify/revert-43971-revert-43785-fullstory-plugin-update Revert "Revert "Fullstory plugin update. Annotation plugin fix."" (cherry picked from commit cf0e8a3ca2f51bed263150af928315aee1898a0e) --- android/build.gradle | 2 +- babel.config.js | 19 ++++++++++++++----- ios/Podfile | 2 +- ios/Podfile.lock | 12 ++++++------ package-lock.json | 4 ++-- package.json | 1 + web/index.html | 2 +- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 52c998998ba0..9fc585ab9f05 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -29,7 +29,7 @@ buildscript { classpath("com.google.firebase:firebase-crashlytics-gradle:2.7.1") classpath("com.google.firebase:perf-plugin:1.4.1") // Fullstory integration - classpath ("com.fullstory:gradle-plugin-local:1.47.0") + classpath ("com.fullstory:gradle-plugin-local:1.49.0") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/babel.config.js b/babel.config.js index 060bc0313950..e04e589166f4 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,16 +3,13 @@ require('dotenv').config(); const IS_E2E_TESTING = process.env.E2E_TESTING === 'true'; const defaultPresets = ['@babel/preset-react', '@babel/preset-env', '@babel/preset-flow', '@babel/preset-typescript']; -const defaultPlugins = [ +let defaultPlugins = [ // Adding the commonjs: true option to react-native-web plugin can cause styling conflicts ['react-native-web'], '@babel/transform-runtime', '@babel/plugin-proposal-class-properties', - // This will serve to map the classes correctly in FullStory - '@fullstory/babel-plugin-annotate-react', - // We use `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. 'transform-class-properties', @@ -21,6 +18,19 @@ const defaultPlugins = [ 'react-native-reanimated/plugin', ]; +// The Fullstory annotate plugin generated a few errors when executed in Electron. Let's +// ignore it for desktop builds. +if (!process.env.ELECTRON_ENV && process.env.npm_lifecycle_event !== 'desktop') { + console.debug('This is not a desktop build, adding babel-plugin-annotate-react'); + defaultPlugins.push([ + '@fullstory/babel-plugin-annotate-react', + { + 'react-native-web': true, + native: true, + }, + ]); +} + const webpack = { presets: defaultPresets, plugins: defaultPlugins, @@ -45,7 +55,6 @@ const metro = { '@fullstory/babel-plugin-annotate-react', { native: true, - setFSTagName: true, }, ], diff --git a/ios/Podfile b/ios/Podfile index d72086d4c07b..6330bb3d8d52 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -118,4 +118,4 @@ target 'NotificationServiceExtension' do pod 'AirshipServiceExtension' end -pod 'FullStory', :http => 'https://ios-releases.fullstory.com/fullstory-1.48.0-xcframework.tar.gz' \ No newline at end of file +pod 'FullStory', :http => 'https://ios-releases.fullstory.com/fullstory-1.49.0-xcframework.tar.gz' \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index d0fafd89305f..4857cab9bb24 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -138,7 +138,7 @@ PODS: - GoogleUtilities/Environment (~> 7.7) - "GoogleUtilities/NSData+zlib (~> 7.7)" - fmt (6.2.1) - - FullStory (1.48.0) + - FullStory (1.49.0) - fullstory_react-native (1.4.2): - FullStory (~> 1.14) - glog @@ -2098,7 +2098,7 @@ DEPENDENCIES: - ExpoImageManipulator (from `../node_modules/expo-image-manipulator/ios`) - ExpoModulesCore (from `../node_modules/expo-modules-core`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) - - "FullStory (from `{:http=>\"https://ios-releases.fullstory.com/fullstory-1.48.0-xcframework.tar.gz\"}`)" + - "FullStory (from `{:http=>\"https://ios-releases.fullstory.com/fullstory-1.49.0-xcframework.tar.gz\"}`)" - "fullstory_react-native (from `../node_modules/@fullstory/react-native`)" - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) - hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`) @@ -2263,7 +2263,7 @@ EXTERNAL SOURCES: FBLazyVector: :path: "../node_modules/react-native/Libraries/FBLazyVector" FullStory: - :http: https://ios-releases.fullstory.com/fullstory-1.48.0-xcframework.tar.gz + :http: https://ios-releases.fullstory.com/fullstory-1.49.0-xcframework.tar.gz fullstory_react-native: :path: "../node_modules/@fullstory/react-native" glog: @@ -2458,7 +2458,7 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: FullStory: - :http: https://ios-releases.fullstory.com/fullstory-1.48.0-xcframework.tar.gz + :http: https://ios-releases.fullstory.com/fullstory-1.49.0-xcframework.tar.gz SPEC CHECKSUMS: Airship: 5a6d3f8a982398940b0d48423bb9b8736717c123 @@ -2485,7 +2485,7 @@ SPEC CHECKSUMS: FirebasePerformance: 0c01a7a496657d7cea86d40c0b1725259d164c6c FirebaseRemoteConfig: 2d6e2cfdb49af79535c8af8a80a4a5009038ec2b fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - FullStory: 097347c823c21c655ca25fd8d5e6355a9326ec54 + FullStory: c95f74445f871bc344cdc4a4e4ece61b5554e55d fullstory_react-native: 6cba8a2c054374a24a44dc4310407d9435459cae glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2 GoogleAppMeasurement: 5ba1164e3c844ba84272555e916d0a6d3d977e91 @@ -2608,6 +2608,6 @@ SPEC CHECKSUMS: VisionCamera: 1394a316c7add37e619c48d7aa40b38b954bf055 Yoga: 1b901a6d6eeba4e8a2e8f308f708691cdb5db312 -PODFILE CHECKSUM: 66a5c97ae1059e4da1993a4ad95abe5d819f555b +PODFILE CHECKSUM: d5e281e5370cb0211a104efd90eb5fa7af936e14 COCOAPODS: 1.13.0 diff --git a/package-lock.json b/package-lock.json index dbad52e50031..e35c7a15e3be 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,7 @@ "@formatjs/intl-locale": "^3.3.0", "@formatjs/intl-numberformat": "^8.5.0", "@formatjs/intl-pluralrules": "^5.2.2", + "@fullstory/babel-plugin-annotate-react": "github:fullstorydev/fullstory-babel-plugin-annotate-react#ryanwang/react-native-web-demo", "@fullstory/babel-plugin-react-native": "^1.2.1", "@fullstory/browser": "^2.0.3", "@fullstory/react-native": "^1.4.2", @@ -5587,8 +5588,7 @@ }, "node_modules/@fullstory/babel-plugin-annotate-react": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@fullstory/babel-plugin-annotate-react/-/babel-plugin-annotate-react-2.3.0.tgz", - "integrity": "sha512-gYLUL6Tu0exbvTIhK9nSCaztmqBlQAm07Fvtl/nKTc+lxwFkcX9vR8RrdTbyjJZKbPaA5EMlExQ6GeLCXkfm5g==" + "resolved": "git+ssh://git@github.com/fullstorydev/fullstory-babel-plugin-annotate-react.git#25c26dadb644d5355e381a4ea4ca1cd05af4a8f6" }, "node_modules/@fullstory/babel-plugin-react-native": { "version": "1.2.1", diff --git a/package.json b/package.json index b1a22e2c4ed0..4b1ce3d73f0e 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "@formatjs/intl-locale": "^3.3.0", "@formatjs/intl-numberformat": "^8.5.0", "@formatjs/intl-pluralrules": "^5.2.2", + "@fullstory/babel-plugin-annotate-react": "github:fullstorydev/fullstory-babel-plugin-annotate-react#ryanwang/react-native-web-demo", "@fullstory/babel-plugin-react-native": "^1.2.1", "@fullstory/browser": "^2.0.3", "@fullstory/react-native": "^1.4.2", diff --git a/web/index.html b/web/index.html index ccdd4edb4355..84b19c4e56f8 100644 --- a/web/index.html +++ b/web/index.html @@ -130,7 +130,7 @@ - <% if (htmlWebpackPlugin.options.isWeb && htmlWebpackPlugin.options.isProduction) { %> + <% if (htmlWebpackPlugin.options.isWeb && (htmlWebpackPlugin.options.isProduction || htmlWebpackPlugin.options.isStaging)) { %>