diff --git a/patches/react-native/details.md b/patches/react-native/details.md index be59cade91d99..f7b4c34790d15 100644 --- a/patches/react-native/details.md +++ b/patches/react-native/details.md @@ -210,3 +210,10 @@ - Upstream PR/issue: This is not intended to be upstreamed, since this is a low-level fix very specific to the Expensify app's requirements. - E/App issue: [#76859](https://github.com/Expensify/App/issues/76859) - PR introducing patch: [#76154](https://github.com/Expensify/App/pull/76154) + +### [react-native+0.81.4+028+strip-hermes-debug-info.patch](react-native+0.81.4+028+strip-hermes-debug-info.patch) + +- Reason: Always pass `-output-source-map` to `hermesc` for production iOS builds, stripping ~13.4MB of debug metadata from the Hermes bytecode. Previously this flag was only passed when `SOURCEMAP_FILE` was set; if the build environment didn't propagate that variable, debug info remained in the shipped bundle. +- Upstream PR/issue: This should ideally be the default behavior upstream, but no PR has been filed yet. +- E/App issue: [#83000](https://github.com/Expensify/App/issues/83000) +- PR introducing patch: [#83256](https://github.com/Expensify/App/pull/83256) diff --git a/patches/react-native/react-native+0.81.4+028+strip-hermes-debug-info.patch b/patches/react-native/react-native+0.81.4+028+strip-hermes-debug-info.patch new file mode 100644 index 0000000000000..199e0d9080b67 --- /dev/null +++ b/patches/react-native/react-native+0.81.4+028+strip-hermes-debug-info.patch @@ -0,0 +1,21 @@ +diff --git a/node_modules/react-native/scripts/react-native-xcode.sh b/node_modules/react-native/scripts/react-native-xcode.sh +--- a/node_modules/react-native/scripts/react-native-xcode.sh ++++ b/node_modules/react-native/scripts/react-native-xcode.sh +@@ -173,7 +173,7 @@ + else + EXTRA_COMPILER_ARGS=-O + fi +- if [[ $EMIT_SOURCEMAP == true ]]; then ++ if [[ $EMIT_SOURCEMAP == true || $DEV != true ]]; then + EXTRA_COMPILER_ARGS="$EXTRA_COMPILER_ARGS -output-source-map" + fi + "$HERMES_CLI_PATH" -emit-binary -max-diagnostic-width=80 $EXTRA_COMPILER_ARGS -out "$DEST/$BUNDLE_NAME.jsbundle" "$BUNDLE_FILE" +@@ -183,6 +183,8 @@ + "$NODE_BINARY" "$COMPOSE_SOURCEMAP_PATH" "$PACKAGER_SOURCEMAP_FILE" "$HBC_SOURCEMAP_FILE" -o "$SOURCEMAP_FILE" + rm "$HBC_SOURCEMAP_FILE" + rm "$PACKAGER_SOURCEMAP_FILE" ++ elif [[ $DEV != true ]]; then ++ rm -f "$DEST/$BUNDLE_NAME.jsbundle.map" + fi + BUNDLE_FILE="$DEST/$BUNDLE_NAME.jsbundle" + fi