Add back some polyfills not covered by core-js

environments/review-polyfills-wo6d05/deployments/2423
Alex Gleason 2023-01-23 15:00:34 -06:00
rodzic f61b2bb96c
commit b2188016c2
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
7 zmienionych plików z 21 dodań i 8 usunięć

Wyświetl plik

@ -54,12 +54,12 @@ module.exports = {
},
},
polyfills: [
'es:all',
'fetch',
'IntersectionObserver',
'Promise',
'URL',
'URLSearchParams',
'es:all', // core-js
'IntersectionObserver', // npm:intersection-observer
'Promise', // core-js
'ResizeObserver', // npm:resize-observer-polyfill
'URL', // core-js
'URLSearchParams', // core-js
],
},

Wyświetl plik

@ -1,5 +1,4 @@
import { useEffect, useMemo, useState } from 'react';
import ResizeObserver from 'resize-observer-polyfill';
type UseDimensionsRect = { width: number, height: number };
type UseDimensionsResult = [Element | null, any, any]

Wyświetl plik

@ -20,6 +20,7 @@ import '../soapbox/iframe';
import '../styles/application.scss';
import '../styles/tailwind.css';
import './polyfills';
import './precheck';
import { default as Soapbox } from './containers/soapbox';
import * as monitoring from './monitoring';

Wyświetl plik

@ -0,0 +1,8 @@
import 'intersection-observer';
import ResizeObserver from 'resize-observer-polyfill';
// Needed by Virtuoso
// https://github.com/petyosi/react-virtuoso#browser-support
if (!window.ResizeObserver) {
window.ResizeObserver = ResizeObserver;
}

Wyświetl plik

@ -127,6 +127,7 @@
"http-link-header": "^1.0.2",
"immutable": "^4.2.1",
"imports-loader": "^4.0.0",
"intersection-observer": "^0.12.2",
"intl-messageformat": "9.13.0",
"intl-messageformat-parser": "^6.0.0",
"intl-pluralrules": "^1.3.1",

Wyświetl plik

@ -50,7 +50,6 @@ const configuration: Configuration = {
],
optional: [
'**/locale_*.js', // don't fetch every locale; the user only needs one
'**/*_polyfills-*.js', // the user may not need polyfills
'**/*.chunk.js', // only cache chunks when needed
'**/*.chunk.css',
'**/*.woff2', // the user may have system-fonts enabled

Wyświetl plik

@ -6653,6 +6653,11 @@ intersection-observer@^0.12.0:
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.0.tgz#6c84628f67ce8698e5f9ccf857d97718745837aa"
integrity sha512-2Vkz8z46Dv401zTWudDGwO7KiGHNDkMv417T5ItcNYfmvHR/1qCTVBO9vwH8zZmQ0WkA/1ARwpysR9bsnop4NQ==
intersection-observer@^0.12.2:
version "0.12.2"
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.2.tgz#4a45349cc0cd91916682b1f44c28d7ec737dc375"
integrity sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==
intl-messageformat-parser@6.1.2:
version "6.1.2"
resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-6.1.2.tgz#28c65f3689f538e66c7cf628881548d6a82ff3c2"