mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
refactor: setup files (#8201)
This commit is contained in:
@@ -1,8 +1,4 @@
|
||||
import './polyfill/dispose';
|
||||
import './polyfill/intl-segmenter';
|
||||
import './polyfill/promise-with-resolvers';
|
||||
import './polyfill/request-idle-callback';
|
||||
import '@affine/core/bootstrap/preload';
|
||||
import './setup';
|
||||
|
||||
import { performanceLogger } from '@affine/core/shared';
|
||||
import {
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
import 'core-js/modules/esnext.symbol.async-dispose';
|
||||
import 'core-js/modules/esnext.symbol.dispose';
|
||||
@@ -1,11 +0,0 @@
|
||||
if (Intl.Segmenter === undefined) {
|
||||
await import('intl-segmenter-polyfill-rs').then(({ Segmenter }) => {
|
||||
Object.defineProperty(Intl, 'Segmenter', {
|
||||
value: Segmenter,
|
||||
configurable: true,
|
||||
writable: true,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export {};
|
||||
@@ -1 +0,0 @@
|
||||
import 'core-js/features/promise/with-resolvers';
|
||||
@@ -1,19 +0,0 @@
|
||||
window.requestIdleCallback =
|
||||
window.requestIdleCallback ||
|
||||
function (cb) {
|
||||
const start = Date.now();
|
||||
return setTimeout(function () {
|
||||
cb({
|
||||
didTimeout: false,
|
||||
timeRemaining: function () {
|
||||
return Math.max(0, 50 - (Date.now() - start));
|
||||
},
|
||||
});
|
||||
}, 1);
|
||||
};
|
||||
|
||||
window.cancelIdleCallback =
|
||||
window.cancelIdleCallback ||
|
||||
function (id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
4
packages/frontend/apps/mobile/src/setup.ts
Normal file
4
packages/frontend/apps/mobile/src/setup.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { setupBlocksuite, setupBrowser } from '@affine/core/bootstrap';
|
||||
|
||||
await setupBrowser();
|
||||
setupBlocksuite();
|
||||
Reference in New Issue
Block a user