mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
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-to-spliced';
|
||||
import './array';
|
||||
import './set';
|
||||
import './dispose';
|
||||
import './iterator-helpers';
|
||||
import './promise-with-resolvers';
|
||||
import './set-union';
|
||||
|
||||
import { polyfillEventLoop } from './request-idle-callback';
|
||||
import { polyfillResizeObserver } from './resize-observer';
|
||||
|
||||
polyfillResizeObserver();
|
||||
polyfillEventLoop();
|
||||
import './request-idle-callback';
|
||||
import './resize-observer';
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
import { polyfillResizeObserver } from './resize-observer';
|
||||
|
||||
polyfillResizeObserver();
|
||||
import './resize-observer';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export function polyfillEventLoop() {
|
||||
(function polyfillEventLoop() {
|
||||
globalThis.requestIdleCallback =
|
||||
globalThis.requestIdleCallback ||
|
||||
function (cb) {
|
||||
@@ -18,4 +18,4 @@ export function polyfillEventLoop() {
|
||||
function (id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ResizeObserver } from '@juggle/resize-observer';
|
||||
|
||||
export function polyfillResizeObserver() {
|
||||
(function polyfillResizeObserver() {
|
||||
if (typeof window !== 'undefined') {
|
||||
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';
|
||||
Reference in New Issue
Block a user