Add ResizeObserver polyfill by juggle

Potential fix for older browsers
This commit is contained in:
schroda
2024-09-30 04:53:56 +02:00
parent 6ca16b9449
commit f7e5388e2a
4 changed files with 18 additions and 0 deletions

View File

@@ -35,6 +35,7 @@
"@emotion/react": "11.13.3",
"@emotion/styled": "11.13.0",
"@fontsource/roboto": "5.0.14",
"@juggle/resize-observer": "^3.4.0",
"@loadable/component": "5.16.4",
"@mui/icons-material": "6.0.2",
"@mui/material": "6.0.2",

View File

@@ -6,6 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import '@/polyfill.manual';
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import { App } from '@/App';

11
src/polyfill.manual.ts Normal file
View File

@@ -0,0 +1,11 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { ResizeObserver as JuggleResizeObserver } from '@juggle/resize-observer';
window.ResizeObserver ??= JuggleResizeObserver;

View File

@@ -2659,6 +2659,11 @@
"@jridgewell/resolve-uri" "^3.1.0"
"@jridgewell/sourcemap-codec" "^1.4.14"
"@juggle/resize-observer@^3.4.0":
version "3.4.0"
resolved "https://registry.yarnpkg.com/@juggle/resize-observer/-/resize-observer-3.4.0.tgz#08d6c5e20cf7e4cc02fd181c4b0c225cd31dbb60"
integrity sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==
"@kamilkisiela/fast-url-parser@^1.1.4":
version "1.1.4"
resolved "https://registry.yarnpkg.com/@kamilkisiela/fast-url-parser/-/fast-url-parser-1.1.4.tgz#9d68877a489107411b953c54ea65d0658b515809"