refactor: setup files (#8201)

This commit is contained in:
forehalo
2024-09-13 07:27:07 +00:00
parent 3c7cf658c5
commit c76b4d70b0
47 changed files with 155 additions and 139 deletions

View File

@@ -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 {

View File

@@ -1,2 +0,0 @@
import 'core-js/modules/esnext.symbol.async-dispose';
import 'core-js/modules/esnext.symbol.dispose';

View File

@@ -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 {};

View File

@@ -1 +0,0 @@
import 'core-js/features/promise/with-resolvers';

View File

@@ -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);
};

View File

@@ -0,0 +1,4 @@
import { setupBlocksuite, setupBrowser } from '@affine/core/bootstrap';
await setupBrowser();
setupBlocksuite();