From fdcc75628109964ad4d1abf5492dd1b452c3c82d Mon Sep 17 00:00:00 2001 From: OTKUSteyler <90369564+OTKUSteyler@users.noreply.github.com> Date: Wed, 10 Dec 2025 17:27:54 +0100 Subject: [PATCH] Delete polyfills directory --- polyfills/redesign.ts | 136 ------------------------------------------ 1 file changed, 136 deletions(-) delete mode 100644 polyfills/redesign.ts diff --git a/polyfills/redesign.ts b/polyfills/redesign.ts deleted file mode 100644 index 9e5c1a8..0000000 --- a/polyfills/redesign.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { getPolyfillModuleCacher } from "@metro/internals/caches"; -import { LiteralUnion } from "type-fest"; - -const redesignProps = new Set([ - "AlertActionButton", - "AlertModal", - "AlertModalContainer", - "AvatarDuoPile", - "AvatarPile", - "BACKDROP_OPAQUE_MAX_OPACITY", - "Backdrop", - "Button", - "Card", - "ContextMenu", - "ContextMenuContainer", - "FauxHeader", - "FloatingActionButton", - "GhostInput", - "GuildIconPile", - "HeaderActionButton", - "HeaderButton", - "HeaderSubmittingIndicator", - "IconButton", - "Input", - "InputButton", - "InputContainer", - "LayerContext", - "LayerScope", - "Modal", - "ModalActionButton", - "ModalContent", - "ModalDisclaimer", - "ModalFloatingAction", - "ModalFloatingActionSpacer", - "ModalFooter", - "ModalScreen", - "ModalStepIndicator", - "NAV_BAR_HEIGHT", - "NAV_BAR_HEIGHT_MULTILINE", - "Navigator", - "NavigatorHeader", - "NavigatorScreen", - "Pile", - "PileOverflow", - "RedesignCompat", - "RedesignCompatContext", - "RowButton", - "STATUS_BAR_HEIGHT", - "SceneLoadingIndicator", - "SearchField", - "SegmentedControl", - "SegmentedControlPages", - "Slider", - "Stack", - "StepModal", - "StickyContext", - "StickyHeader", - "StickyWrapper", - "TABLE_ROW_CONTENT_HEIGHT", - "TABLE_ROW_HEIGHT", - "TableCheckboxRow", - "TableRadioGroup", - "TableRadioRow", - "TableRow", - "TableRowGroup", - "TableRowGroupTitle", - "TableRowIcon", - "TableSwitchRow", - "Tabs", - "TextArea", - "TextField", - "TextInput", - "Toast", - "dismissAlerts", - "getHeaderBackButton", - "getHeaderCloseButton", - "getHeaderConditionalBackButton", - "getHeaderNoTitle", - "getHeaderTextButton", - "hideContextMenu", - "navigatorShouldCrossfade", - "openAlert", - "useAccessibilityNativeStackOptions", - "useAndroidNavScrim", - "useCoachmark", - "useFloatingActionButtonScroll", - "useFloatingActionButtonState", - "useNativeStackNavigation", - "useNavigation", - "useNavigationTheme", - "useNavigatorBackPressHandler", - "useNavigatorScreens", - "useNavigatorShouldCrossfade", - "useSegmentedControlState", - "useStackNavigation", - "useTabNavigation", - "useTooltip" -] as const); - -type Keys = LiteralUnion ? U : string, string>; - -const _module = {} as Record; -const _source = {} as Record; - -const cacher = getPolyfillModuleCacher("redesign_module"); - -for (const [id, moduleExports] of cacher.getModules()) { - for (const prop of redesignProps) { - let actualExports: any; - - if (moduleExports[prop]) { - actualExports = moduleExports; - } else if (moduleExports.default?.[prop]) { - actualExports = moduleExports.default; - } else { - continue; - } - - const exportsKeysLength = Reflect.ownKeys(actualExports).length; - if (_source[prop] && exportsKeysLength >= _source[prop]) { - continue; - } - - _module[prop] = actualExports[prop]; - _source[prop] = Reflect.ownKeys(actualExports).length; - cacher.cacheId(id); - - if (exportsKeysLength === 1) { - redesignProps.delete(prop); - } - } -} - -cacher.finish(); - -export default _module;