diff --git a/app/components/LazyPolyfills.tsx b/app/components/LazyPolyfills.tsx deleted file mode 100644 index eac9e89228..0000000000 --- a/app/components/LazyPolyfills.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import * as React from "react"; -import Logger from "~/utils/Logger"; -import { loadPolyfills } from "~/utils/polyfills"; - -type Props = { - children?: React.ReactNode; -}; - -/** - * Asynchronously load required polyfills. Should wrap the React tree. - */ -export const LazyPolyfill: React.FC = ({ children }: Props) => { - const [isLoaded, setIsLoaded] = React.useState(false); - - React.useEffect(() => { - loadPolyfills() - .then(() => { - setIsLoaded(true); - }) - .catch((error) => { - Logger.error("Polyfills failed to load", error); - }); - }, []); - - if (!isLoaded) { - return null; - } - - return <>{children}; -}; - -export default LazyPolyfill; diff --git a/app/index.tsx b/app/index.tsx index 44d8e27d51..198a1a99d7 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -21,7 +21,6 @@ import Toasts from "~/components/Toasts"; import env from "~/env"; import { initI18n } from "~/utils/i18n"; import Desktop from "./components/DesktopEventHandler"; -import LazyPolyfill from "./components/LazyPolyfills"; import PageScroll from "./components/PageScroll"; import Routes from "./routes"; import Logger from "./utils/Logger"; @@ -76,20 +75,18 @@ if (element) { - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/app/utils/polyfills.ts b/app/utils/polyfills.ts index c19c2f749b..5fe32efb62 100644 --- a/app/utils/polyfills.ts +++ b/app/utils/polyfills.ts @@ -54,34 +54,4 @@ if (typeof String.prototype.isWellFormed !== "function") { }); } -/** - * Loads required polyfills. - * - * @returns A promise that resolves when all required polyfills are loaded - */ -export async function loadPolyfills() { - const polyfills = []; - - if (!supportsResizeObserver()) { - polyfills.push( - import("@juggle/resize-observer").then((module) => { - window.ResizeObserver = module.ResizeObserver; - }) - ); - } - - return Promise.all(polyfills); -} - -/** - * Detect ResizeObserver compatibility. - * - * @returns true if the current browser supports ResizeObserver - */ -function supportsResizeObserver() { - return ( - "ResizeObserver" in window && - "ResizeObserverEntry" in window && - "contentRect" in ResizeObserverEntry.prototype - ); -} +export {}; diff --git a/package.json b/package.json index 71e0379dfa..88a569f78d 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,6 @@ "@hocuspocus/extension-throttle": "1.1.3", "@hocuspocus/provider": "1.1.3", "@hocuspocus/server": "1.1.3", - "@juggle/resize-observer": "^3.4.0", "@koa/router": "^15.7.0", "@koa/send": "^6.0.0", "@linear/sdk": "^97.0.0", diff --git a/yarn.lock b/yarn.lock index 5764f265ae..e803ecc137 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2462,13 +2462,6 @@ __metadata: languageName: node linkType: hard -"@juggle/resize-observer@npm:^3.4.0": - version: 3.4.0 - resolution: "@juggle/resize-observer@npm:3.4.0" - checksum: 10c0/12930242357298c6f2ad5d4ec7cf631dfb344ca7c8c830ab7f64e6ac11eb1aae486901d8d880fd08fb1b257800c160a0da3aee1e7ed9adac0ccbb9b7c5d93347 - languageName: node - linkType: hard - "@keyv/serialize@npm:^1.1.1": version: 1.1.1 resolution: "@keyv/serialize@npm:1.1.1" @@ -14269,7 +14262,6 @@ __metadata: "@hocuspocus/extension-throttle": "npm:1.1.3" "@hocuspocus/provider": "npm:1.1.3" "@hocuspocus/server": "npm:1.1.3" - "@juggle/resize-observer": "npm:^3.4.0" "@koa/router": "npm:^15.7.0" "@koa/send": "npm:^6.0.0" "@linear/sdk": "npm:^97.0.0"