From 3785c46bf7b1c09dfd25810b4e711f3cbdef58f6 Mon Sep 17 00:00:00 2001 From: vineyardbovines Date: Fri, 30 Jan 2026 10:29:49 -0500 Subject: [PATCH] replace radix imports --- metro.config.js | 3 +++ package.json | 2 +- {web => public}/index.html | 3 ++- src/components/Dialog/index.web.tsx | 14 ++++++++------ src/components/FocusScope/index.web.tsx | 6 +++--- src/components/Lightbox/Lightbox.web.tsx | 9 +++++---- src/components/WelcomeModal.tsx | 9 +++++---- src/view/shell/Composer.web.tsx | 14 ++++++++------ 8 files changed, 35 insertions(+), 25 deletions(-) rename {web => public}/index.html (98%) diff --git a/metro.config.js b/metro.config.js index 363956a77d..0991620563 100644 --- a/metro.config.js +++ b/metro.config.js @@ -11,6 +11,9 @@ if (cfg.resolver.resolveRequest) { throw Error('Update this override because it is conflicting now.') } +// Enforce "no RNGH on web" +cfg.resolver.blockList = [/react-native-gesture-handler\/.*/] + if (process.env.BSKY_PROFILE) { cfg.cacheVersion += ':PROFILE' } diff --git a/package.json b/package.json index 702dd93534..a832126bae 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "web": "expo start --web", "use-build-number": "./scripts/useBuildNumberEnv.sh", "use-build-number-with-bump": "./scripts/useBuildNumberEnvWithBump.sh", - "build-web": "expo export:web && node ./scripts/post-web-build.js", + "build-web": "expo export --platform web && node ./scripts/post-web-build.js", "build-all": "pnpm intl:build && pnpm use-build-number-with-bump eas build --platform all", "build-ios": "pnpm use-build-number-with-bump eas build -p ios", "build-android": "pnpm use-build-number-with-bump eas build -p android", diff --git a/web/index.html b/public/index.html similarity index 98% rename from web/index.html rename to public/index.html index 67500c1d21..21c0a8f1b8 100644 --- a/web/index.html +++ b/public/index.html @@ -16,7 +16,8 @@ --> - %WEB_TITLE% + + diff --git a/src/components/Dialog/index.web.tsx b/src/components/Dialog/index.web.tsx index 9666e9a7a4..e6364a2b86 100644 --- a/src/components/Dialog/index.web.tsx +++ b/src/components/Dialog/index.web.tsx @@ -18,7 +18,9 @@ import { } from 'react-native' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' -import {DismissableLayer, FocusGuards, FocusScope} from 'radix-ui/internal' +import {DismissableLayer} from '@radix-ui/react-dismissable-layer' +import {useFocusGuards} from '@radix-ui/react-focus-guards' +import {FocusScope} from '@radix-ui/react-focus-scope' import {RemoveScrollBar} from 'react-remove-scroll-bar' import {logger} from '#/logger' @@ -176,9 +178,9 @@ export function Inner({ const {close} = useContext(Context) const {gtMobile} = useBreakpoints() const {reduceMotionEnabled} = useA11y() - FocusGuards.useFocusGuards() + useFocusGuards() return ( - + - {children} - + - + ) } diff --git a/src/components/FocusScope/index.web.tsx b/src/components/FocusScope/index.web.tsx index 541cd72601..3fc8675d46 100644 --- a/src/components/FocusScope/index.web.tsx +++ b/src/components/FocusScope/index.web.tsx @@ -1,4 +1,4 @@ -import {FocusScope as RadixFocusScope} from 'radix-ui/internal' +import {FocusScope as RadixFocusScope} from '@radix-ui/react-focus-scope' /* * The web version of the FocusScope component is a proper implementation, we @@ -7,8 +7,8 @@ import {FocusScope as RadixFocusScope} from 'radix-ui/internal' */ export function FocusScope({children}: {children: React.ReactNode}) { return ( - + {children} - + ) } diff --git a/src/components/Lightbox/Lightbox.web.tsx b/src/components/Lightbox/Lightbox.web.tsx index 641b2c3402..ed8abf5c75 100644 --- a/src/components/Lightbox/Lightbox.web.tsx +++ b/src/components/Lightbox/Lightbox.web.tsx @@ -2,7 +2,8 @@ import {useCallback, useEffect, useRef, useState} from 'react' import {Pressable, StyleSheet, View} from 'react-native' import {Image} from 'expo-image' import {Trans, useLingui} from '@lingui/react/macro' -import {FocusGuards, FocusScope} from 'radix-ui/internal' +import {useFocusGuards} from '@radix-ui/react-focus-guards' +import {FocusScope} from '@radix-ui/react-focus-scope' import {RemoveScrollBar} from 'react-remove-scroll-bar' import {saveImageToMediaLibrary} from '#/lib/media/manip' @@ -66,7 +67,7 @@ function LightboxContainer({ handleBackgroundPress: () => void }) { const {t: l} = useLingui() - FocusGuards.useFocusGuards() + useFocusGuards() return ( - +
{children}
-
+
) } diff --git a/src/components/WelcomeModal.tsx b/src/components/WelcomeModal.tsx index 4b3bc4ca99..1cd3a792bc 100644 --- a/src/components/WelcomeModal.tsx +++ b/src/components/WelcomeModal.tsx @@ -4,7 +4,8 @@ import {ImageBackground} from 'expo-image' import {msg} from '@lingui/core/macro' import {useLingui} from '@lingui/react' import {Trans} from '@lingui/react/macro' -import {FocusGuards, FocusScope} from 'radix-ui/internal' +import {useFocusGuards} from '@radix-ui/react-focus-guards' +import {FocusScope} from '@radix-ui/react-focus-scope' import {useLoggedOutViewControls} from '#/state/shell/logged-out' import {Logo} from '#/view/icons/Logo' @@ -64,7 +65,7 @@ export function WelcomeModal({control}: WelcomeModalProps) { requestSwitchToAccount({requestedAccount: 'existing'}) } - FocusGuards.useFocusGuards() + useFocusGuards() return ( - + - + ) } diff --git a/src/view/shell/Composer.web.tsx b/src/view/shell/Composer.web.tsx index d3232f492b..e4d26693db 100644 --- a/src/view/shell/Composer.web.tsx +++ b/src/view/shell/Composer.web.tsx @@ -1,5 +1,7 @@ import {StyleSheet, View} from 'react-native' -import {DismissableLayer, FocusGuards, FocusScope} from 'radix-ui/internal' +import {DismissableLayer} from '@radix-ui/react-dismissable-layer' +import {useFocusGuards} from '@radix-ui/react-focus-guards' +import {FocusScope} from '@radix-ui/react-focus-scope' import {RemoveScrollBar} from 'react-remove-scroll-bar' import {useA11y} from '#/state/a11y' @@ -36,11 +38,11 @@ function Inner({state}: {state: ComposerOpts}) { const {gtMobile} = useBreakpoints() const {reduceMotionEnabled} = useA11y() - FocusGuards.useFocusGuards() + useFocusGuards() return ( - - + - - + + ) }