chore(core): reorg polyfill (#11528)
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
import 'core-js/es/array/to-reversed';
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
import 'core-js/es/array/to-spliced.js';
|
|
||||||
3
packages/frontend/core/src/bootstrap/polyfill/array.ts
Normal file
3
packages/frontend/core/src/bootstrap/polyfill/array.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import 'core-js/es/array/to-spliced';
|
||||||
|
import 'core-js/es/array/to-reversed';
|
||||||
|
import 'core-js/es/array/to-sorted';
|
||||||
@@ -1,12 +1,7 @@
|
|||||||
import './array-to-reversed';
|
import './array';
|
||||||
import './array-to-spliced';
|
import './set';
|
||||||
import './dispose';
|
import './dispose';
|
||||||
import './iterator-helpers';
|
import './iterator-helpers';
|
||||||
import './promise-with-resolvers';
|
import './promise-with-resolvers';
|
||||||
import './set-union';
|
import './request-idle-callback';
|
||||||
|
import './resize-observer';
|
||||||
import { polyfillEventLoop } from './request-idle-callback';
|
|
||||||
import { polyfillResizeObserver } from './resize-observer';
|
|
||||||
|
|
||||||
polyfillResizeObserver();
|
|
||||||
polyfillEventLoop();
|
|
||||||
|
|||||||
@@ -1,3 +1 @@
|
|||||||
import { polyfillResizeObserver } from './resize-observer';
|
import './resize-observer';
|
||||||
|
|
||||||
polyfillResizeObserver();
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export function polyfillEventLoop() {
|
(function polyfillEventLoop() {
|
||||||
globalThis.requestIdleCallback =
|
globalThis.requestIdleCallback =
|
||||||
globalThis.requestIdleCallback ||
|
globalThis.requestIdleCallback ||
|
||||||
function (cb) {
|
function (cb) {
|
||||||
@@ -18,4 +18,4 @@ export function polyfillEventLoop() {
|
|||||||
function (id) {
|
function (id) {
|
||||||
clearTimeout(id);
|
clearTimeout(id);
|
||||||
};
|
};
|
||||||
}
|
})();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ResizeObserver } from '@juggle/resize-observer';
|
import { ResizeObserver } from '@juggle/resize-observer';
|
||||||
|
|
||||||
export function polyfillResizeObserver() {
|
(function polyfillResizeObserver() {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
window.ResizeObserver = ResizeObserver;
|
window.ResizeObserver = ResizeObserver;
|
||||||
}
|
}
|
||||||
}
|
})();
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
import 'core-js/es/set/union.js';
|
|
||||||
@@ -1 +1,2 @@
|
|||||||
|
import 'core-js/es/set/union.js';
|
||||||
import 'core-js/es/set/difference.js';
|
import 'core-js/es/set/difference.js';
|
||||||
Reference in New Issue
Block a user