fix(core): remove ses lockdown (#5350)

This commit is contained in:
LongYinan
2023-12-20 04:11:34 +00:00
parent e3882f9648
commit 800ea0abf1
7 changed files with 17 additions and 70 deletions

View File

@@ -1,4 +1,3 @@
import '../polyfill/ses-lockdown';
import '../polyfill/intl-segmenter';
import { assertExists } from '@blocksuite/global/utils';
@@ -19,7 +18,7 @@ async function main() {
const { setup } = await import('../bootstrap/setup');
const rootStore = getCurrentStore();
setup();
const { _pluginNestedImportsMap } = createSetup(rootStore);
createSetup(rootStore);
const pluginRegisterPromise = bootstrapPluginSystem(rootStore);
const root = document.getElementById('app');
assertExists(root);
@@ -27,11 +26,6 @@ async function main() {
const App = () => {
use(pluginRegisterPromise);
const plugins = useAtomValue(loadedPluginNameAtom);
_pluginNestedImportsMap.forEach(value => {
const exports = value.get('index.js');
assertExists(exports);
assertExists(exports?.get('entry'));
});
return (
<div>
<div data-plugins-load-status="success">

View File

@@ -1,4 +1,4 @@
import './polyfill/ses-lockdown';
import 'ses';
import './polyfill/intl-segmenter';
import './polyfill/request-idle-callback';

View File

@@ -1,19 +0,0 @@
import 'ses';
if (!process.env.COVERAGE) {
lockdown({
evalTaming: 'unsafeEval',
overrideTaming: 'severe',
consoleTaming: 'unsafe',
errorTaming: 'unsafe',
errorTrapping: 'platform',
unhandledRejectionTrapping: 'report',
});
console.log('SES lockdown complete');
} else {
Object.defineProperty(globalThis, 'harden', {
value: (x: any) => Object.freeze(x),
writable: false,
});
}