Add back some polyfills not covered by core-js
This commit is contained in:
parent
f61b2bb96c
commit
b2188016c2
7 changed files with 21 additions and 8 deletions
|
@ -54,12 +54,12 @@ module.exports = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
polyfills: [
|
polyfills: [
|
||||||
'es:all',
|
'es:all', // core-js
|
||||||
'fetch',
|
'IntersectionObserver', // npm:intersection-observer
|
||||||
'IntersectionObserver',
|
'Promise', // core-js
|
||||||
'Promise',
|
'ResizeObserver', // npm:resize-observer-polyfill
|
||||||
'URL',
|
'URL', // core-js
|
||||||
'URLSearchParams',
|
'URLSearchParams', // core-js
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { useEffect, useMemo, useState } from 'react';
|
import { useEffect, useMemo, useState } from 'react';
|
||||||
import ResizeObserver from 'resize-observer-polyfill';
|
|
||||||
|
|
||||||
type UseDimensionsRect = { width: number, height: number };
|
type UseDimensionsRect = { width: number, height: number };
|
||||||
type UseDimensionsResult = [Element | null, any, any]
|
type UseDimensionsResult = [Element | null, any, any]
|
||||||
|
|
|
@ -20,6 +20,7 @@ import '../soapbox/iframe';
|
||||||
import '../styles/application.scss';
|
import '../styles/application.scss';
|
||||||
import '../styles/tailwind.css';
|
import '../styles/tailwind.css';
|
||||||
|
|
||||||
|
import './polyfills';
|
||||||
import './precheck';
|
import './precheck';
|
||||||
import { default as Soapbox } from './containers/soapbox';
|
import { default as Soapbox } from './containers/soapbox';
|
||||||
import * as monitoring from './monitoring';
|
import * as monitoring from './monitoring';
|
||||||
|
|
8
app/soapbox/polyfills.ts
Normal file
8
app/soapbox/polyfills.ts
Normal file
|
@ -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;
|
||||||
|
}
|
|
@ -127,6 +127,7 @@
|
||||||
"http-link-header": "^1.0.2",
|
"http-link-header": "^1.0.2",
|
||||||
"immutable": "^4.2.1",
|
"immutable": "^4.2.1",
|
||||||
"imports-loader": "^4.0.0",
|
"imports-loader": "^4.0.0",
|
||||||
|
"intersection-observer": "^0.12.2",
|
||||||
"intl-messageformat": "9.13.0",
|
"intl-messageformat": "9.13.0",
|
||||||
"intl-messageformat-parser": "^6.0.0",
|
"intl-messageformat-parser": "^6.0.0",
|
||||||
"intl-pluralrules": "^1.3.1",
|
"intl-pluralrules": "^1.3.1",
|
||||||
|
|
|
@ -50,7 +50,6 @@ const configuration: Configuration = {
|
||||||
],
|
],
|
||||||
optional: [
|
optional: [
|
||||||
'**/locale_*.js', // don't fetch every locale; the user only needs one
|
'**/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.js', // only cache chunks when needed
|
||||||
'**/*.chunk.css',
|
'**/*.chunk.css',
|
||||||
'**/*.woff2', // the user may have system-fonts enabled
|
'**/*.woff2', // the user may have system-fonts enabled
|
||||||
|
|
|
@ -6653,6 +6653,11 @@ intersection-observer@^0.12.0:
|
||||||
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.0.tgz#6c84628f67ce8698e5f9ccf857d97718745837aa"
|
resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.0.tgz#6c84628f67ce8698e5f9ccf857d97718745837aa"
|
||||||
integrity sha512-2Vkz8z46Dv401zTWudDGwO7KiGHNDkMv417T5ItcNYfmvHR/1qCTVBO9vwH8zZmQ0WkA/1ARwpysR9bsnop4NQ==
|
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:
|
intl-messageformat-parser@6.1.2:
|
||||||
version "6.1.2"
|
version "6.1.2"
|
||||||
resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-6.1.2.tgz#28c65f3689f538e66c7cf628881548d6a82ff3c2"
|
resolved "https://registry.yarnpkg.com/intl-messageformat-parser/-/intl-messageformat-parser-6.1.2.tgz#28c65f3689f538e66c7cf628881548d6a82ff3c2"
|
||||||
|
|
Loading…
Reference in a new issue