Update Sentry to 8.x (#11147)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-07-14 15:39:05 +03:00
committed by GitHub
parent 6f69ded492
commit 4b5138fdc1
10 changed files with 239 additions and 237 deletions
@@ -0,0 +1,14 @@
diff --git a/cli.js b/cli.js
index 2a2e6afbd46a6a5182918373d71853193945ff31..44e5888e869003438fc7ef4931b9992f2896a23f 100755
--- a/cli.js
+++ b/cli.js
@@ -304,6 +304,9 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) {
if (isHermes) {
args.push('--debug-id-reference');
}
+ if (process.env.SENTRY_DIST) {
+ args.push('--dist', process.env.SENTRY_DIST);
+ }
args.push(...assets);
const result = spawnSync(sentryCliBin, args, {
@@ -0,0 +1,7 @@
# @sentry/expo-upload-sourcemaps patch
Adds `--dist $SENTRY_DIST` to the `sentry-cli sourcemaps upload` call, when the
env var is set. Symbolication matches on debug IDs so this isn't strictly
required, but it keeps OTA sourcemap artifacts associated with the commit hash
(`dist`) in the Sentry UI, matching the runtime `dist` set in
`src/logger/sentry/setup/index.ts`.
@@ -1,33 +0,0 @@
diff --git a/dist/js/tools/sentryMetroSerializer.js b/dist/js/tools/sentryMetroSerializer.js
index d7f2350196fc008f9f1ce530e224fe3d052347e9..4ce7b6614e38c8af747ebcf166dba556affea3de 100644
--- a/dist/js/tools/sentryMetroSerializer.js
+++ b/dist/js/tools/sentryMetroSerializer.js
@@ -12,12 +12,9 @@ exports.createSentryMetroSerializer = exports.unstable_beforeAssetSerializationP
const crypto = require("crypto");
const utils_1 = require("./utils");
const utils_2 = require("./vendor/metro/utils");
-let countLines;
-try {
- countLines = require('metro/private/lib/countLines');
-}
-catch (e) {
- countLines = require('metro/src/lib/countLines');
+const newline = /\r\n?|\n|\u2028|\u2029/g;
+function countLines(string) {
+ return (string.match(newline) || []).length + 1;
}
const DEBUG_ID_PLACE_HOLDER = '__debug_id_place_holder__';
const DEBUG_ID_MODULE_PATH = '__debugid__';
diff --git a/scripts/expo-upload-sourcemaps.js b/scripts/expo-upload-sourcemaps.js
index b3783b572171482778d31a96b8d6ebadbcc8783b..d5e3e45477c07b5419285237372d99ddd83c56a6 100755
--- a/scripts/expo-upload-sourcemaps.js
+++ b/scripts/expo-upload-sourcemaps.js
@@ -218,7 +218,7 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) {
const isHermes = assets.find(asset => asset.endsWith('.hbc'));
const windowsCallback = process.platform === "win32" ? 'node ' : '';
- execSync(`${windowsCallback}${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')}`, {
+ execSync(`${windowsCallback}${sentryCliBin} sourcemaps upload ${isHermes ? '--debug-id-reference' : ''} ${assets.join(' ')} --dist ${process.env.SENTRY_DIST}`, {
env: {
...process.env,
[SENTRY_PROJECT]: sentryProject,
@@ -1,9 +0,0 @@
# @sentry/react-native/scripts/expo-upload-sourcemaps.js patch
Lets us specify the output directory for the sourcemaps via an environment variable.
# @sentry/react-native/dist/js/tools/sentryMetroSerializer.js patch
Patch of this: https://github.com/getsentry/sentry-react-native/issues/5180#issuecomment-3311772038
Will be fixed in an upcoming release of @sentry/react-native - remove when available.