diff --git a/patches/@sentry+react-native+6.20.0.patch b/patches/@sentry+react-native+6.20.0.patch index 2291c598c..95a65ee7c 100644 --- a/patches/@sentry+react-native+6.20.0.patch +++ b/patches/@sentry+react-native+6.20.0.patch @@ -1,8 +1,28 @@ +diff --git a/node_modules/@sentry/react-native/dist/js/tools/sentryMetroSerializer.js b/node_modules/@sentry/react-native/dist/js/tools/sentryMetroSerializer.js +index d7f2350..e9c0368 100644 +--- a/node_modules/@sentry/react-native/dist/js/tools/sentryMetroSerializer.js ++++ b/node_modules/@sentry/react-native/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/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js b/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js -index c282ade..8777755 100755 +index b3783b5..d5e3e45 100755 --- a/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js +++ b/node_modules/@sentry/react-native/scripts/expo-upload-sourcemaps.js -@@ -215,7 +215,7 @@ for (const [assetGroupName, assets] of Object.entries(groupedAssets)) { +@@ -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 ' : ''; diff --git a/patches/@sentry+react-native+6.20.0.patch.md b/patches/@sentry+react-native+6.20.0.patch.md new file mode 100644 index 000000000..d358fb444 --- /dev/null +++ b/patches/@sentry+react-native+6.20.0.patch.md @@ -0,0 +1,9 @@ +# @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. -- 2.51.2 From 6d85fe05d1c09cca2474efb403fbbd6cf8cb97cc Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Tue, 23 Sep 2025 17:24:31 +0300 Subject: [PATCH 2/2] Constraint video max height to 14/9 (#8611) * constraint video max height to 14/9 * Apply new default to web video embed too * Retain web handling * Rename prop for clarity * Align no-crop handling on native/web * make it always constrained --------- Co-authored-by: Eric Bailey --- src/components/Post/Embed/VideoEmbed/index.tsx | 5 ++++- .../Post/Embed/VideoEmbed/index.web.tsx | 18 +++++++++++++++--- src/components/Post/Embed/index.tsx | 2 +- src/view/com/util/images/AutoSizedImage.tsx | 6 ++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/components/Post/Embed/VideoEmbed/index.tsx b/src/components/Post/Embed/VideoEmbed/index.tsx index c66d1a218..2212be83d 100644 --- a/src/components/Post/Embed/VideoEmbed/index.tsx +++ b/src/components/Post/Embed/VideoEmbed/index.tsx @@ -71,7 +71,10 @@ export function VideoEmbed({embed, crop}: Props) { ) : ( + aspectRatio={constrained || 1} + // slightly smaller max height than images + // images use 16 / 9, for reference + minMobileAspectRatio={14 / 9}> {contents} )} diff --git a/src/components/Post/Embed/VideoEmbed/index.web.tsx b/src/components/Post/Embed/VideoEmbed/index.web.tsx index e988bc830..8965e8b90 100644 --- a/src/components/Post/Embed/VideoEmbed/index.web.tsx +++ b/src/components/Post/Embed/VideoEmbed/index.web.tsx @@ -14,7 +14,7 @@ import {useLingui} from '@lingui/react' import {isFirefox} from '#/lib/browser' import {ErrorBoundary} from '#/view/com/util/ErrorBoundary' import {ConstrainedImage} from '#/view/com/util/images/AutoSizedImage' -import {atoms as a} from '#/alf' +import {atoms as a, useTheme} from '#/alf' import {useIsWithinMessage} from '#/components/dms/MessageContext' import {useFullscreen} from '#/components/hooks/useFullscreen' import { @@ -32,6 +32,7 @@ export function VideoEmbed({ embed: AppBskyEmbedVideo.View crop?: 'none' | 'square' | 'constrained' }) { + const t = useTheme() const ref = useRef(null) const {active, setActive, sendPosition, currentActiveView} = useActiveVideoWeb() @@ -114,13 +115,24 @@ export function VideoEmbed({ sendPosition={sendPosition} isAnyViewActive={currentActiveView !== null}> {cropDisabled ? ( - + {contents} ) : ( + aspectRatio={constrained || 1} + // slightly smaller max height than images + // images use 16 / 9, for reference + minMobileAspectRatio={14 / 9}> {contents} )} diff --git a/src/components/Post/Embed/index.tsx b/src/components/Post/Embed/index.tsx index 8566c2fe6..3efd23136 100644 --- a/src/components/Post/Embed/index.tsx +++ b/src/components/Post/Embed/index.tsx @@ -112,7 +112,7 @@ function MediaEmbed({ - + ) } diff --git a/src/view/com/util/images/AutoSizedImage.tsx b/src/view/com/util/images/AutoSizedImage.tsx index 4e9c61d47..e16ab0259 100644 --- a/src/view/com/util/images/AutoSizedImage.tsx +++ b/src/view/com/util/images/AutoSizedImage.tsx @@ -21,9 +21,11 @@ export function ConstrainedImage({ aspectRatio, fullBleed, children, + minMobileAspectRatio, }: { aspectRatio: number fullBleed?: boolean + minMobileAspectRatio?: number children: React.ReactNode }) { const t = useTheme() @@ -35,10 +37,10 @@ export function ConstrainedImage({ const outerAspectRatio = React.useMemo(() => { const ratio = isNative || !gtMobile - ? Math.min(1 / aspectRatio, 16 / 9) // 9:16 bounding box + ? Math.min(1 / aspectRatio, minMobileAspectRatio ?? 16 / 9) // 9:16 bounding box : Math.min(1 / aspectRatio, 1) // 1:1 bounding box return `${ratio * 100}%` - }, [aspectRatio, gtMobile]) + }, [aspectRatio, gtMobile, minMobileAspectRatio]) return (