mirror of https://github.com/microsoft/vscode.git
esm - worker cleanup (#226064)
This commit is contained in:
parent
9e560ad042
commit
34a756ae2e
|
@ -325,7 +325,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
|||
version += '-' + quality;
|
||||
}
|
||||
|
||||
if (isESM() && quality !== 'exploration') {
|
||||
if (isESM() && typeof quality === 'string' && quality !== 'exploration') {
|
||||
// TODO@esm remove this safeguard
|
||||
throw new Error('Refuse to build ESM on quality other than exploration');
|
||||
}
|
||||
|
|
|
@ -204,7 +204,6 @@ function optimizeESMTask(opts, cjsOpts) {
|
|||
if (cjsOpts) {
|
||||
cjsOpts.entryPoints.forEach(entryPoint => entryPoints.push({ name: path.parse(entryPoint).name }));
|
||||
}
|
||||
entryPoints.push({ name: 'vs/base/worker/workerMain' }); // TODO@esm remove hardcoded entry point when workers are cleaned up
|
||||
const allMentionedModules = new Set();
|
||||
for (const entryPoint of entryPoints) {
|
||||
allMentionedModules.add(entryPoint.name);
|
||||
|
|
|
@ -282,8 +282,6 @@ function optimizeESMTask(opts: IOptimizeAMDTaskOpts, cjsOpts?: IOptimizeCommonJS
|
|||
cjsOpts.entryPoints.forEach(entryPoint => entryPoints.push({ name: path.parse(entryPoint).name }));
|
||||
}
|
||||
|
||||
entryPoints.push({ name: 'vs/base/worker/workerMain' }); // TODO@esm remove hardcoded entry point when workers are cleaned up
|
||||
|
||||
const allMentionedModules = new Set<string>();
|
||||
for (const entryPoint of entryPoints) {
|
||||
allMentionedModules.add(entryPoint.name);
|
||||
|
|
|
@ -38,6 +38,7 @@ function createEditorWorkerModuleDescription(name) {
|
|||
return [amdVariant, esmVariant];
|
||||
}
|
||||
|
||||
// TODO@esm take the editor simple worker top level and rename away from "base"
|
||||
exports.base = [
|
||||
{
|
||||
name: 'vs/editor/common/services/editorSimpleWorker',
|
||||
|
@ -57,6 +58,7 @@ exports.base = [
|
|||
{
|
||||
name: 'vs/base/common/worker/simpleWorker',
|
||||
exclude: [],
|
||||
target: 'amd'
|
||||
}
|
||||
];
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class ProfileAnalysisWorkerService implements IProfileAnalysisWorkerService {
|
|||
|
||||
const worker = createWebWorker<IProfileAnalysisWorker>(
|
||||
'vs/platform/profiling/electron-sandbox/profileAnalysisWorker',
|
||||
'CpuProfileAnalysis'
|
||||
'CpuProfileAnalysisWorker'
|
||||
);
|
||||
|
||||
try {
|
||||
|
|
|
@ -19,7 +19,7 @@ export class WorkbenchEditorWorkerService extends EditorWorkerService {
|
|||
@ILanguageConfigurationService languageConfigurationService: ILanguageConfigurationService,
|
||||
@ILanguageFeaturesService languageFeaturesService: ILanguageFeaturesService,
|
||||
) {
|
||||
const workerDescriptor = new WorkerDescriptor('vs/editor/common/services/editorSimpleWorker', 'editorWorkerService');
|
||||
const workerDescriptor = new WorkerDescriptor('vs/editor/common/services/editorSimpleWorker', 'TextEditorWorker');
|
||||
super(workerDescriptor, modelService, configurationService, logService, languageConfigurationService, languageFeaturesService);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ class NotebookWorkerClient extends Disposable {
|
|||
try {
|
||||
this._worker = this._register(createWebWorker<NotebookEditorSimpleWorker>(
|
||||
'vs/workbench/contrib/notebook/common/services/notebookSimpleWorker',
|
||||
'notebookEditorWorkerService'
|
||||
'NotebookEditorWorker'
|
||||
));
|
||||
} catch (err) {
|
||||
// logOnceWebWorkerWarning(err);
|
||||
|
|
|
@ -99,7 +99,7 @@ class OutputLinkWorkerClient extends Disposable {
|
|||
super();
|
||||
this._workerClient = this._register(createWebWorker<OutputLinkComputer>(
|
||||
'vs/workbench/contrib/output/common/outputLinkComputer',
|
||||
'outputLinkComputer'
|
||||
'OutputLinkDetectionWorker'
|
||||
));
|
||||
this._workerTextModelSyncClient = WorkerTextModelSyncClient.create(this._workerClient, modelService);
|
||||
this._initializeBarrier = this._ensureWorkspaceFolders();
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<meta http-equiv="Content-Security-Policy" content="
|
||||
default-src 'none';
|
||||
child-src 'self' data: blob:;
|
||||
script-src 'self' 'unsafe-eval' 'sha256-71qdcK7UdCeEJQ2OjmcxpjE5NA6Yjy2wId7mDXLJIec=' https: http://localhost:* blob:;
|
||||
script-src 'self' 'unsafe-eval' 'sha256-nTbHS01it8PRpUdEAvdT4xFRv0mYDEM6NaiybD5rU3M=' https: http://localhost:* blob:;
|
||||
connect-src 'self' https: wss: http://localhost:* http://127.0.0.1:* ws://localhost:* ws://127.0.0.1:*;"/>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -12,7 +12,7 @@
|
|||
(function () {
|
||||
const searchParams = new URL(document.location.href).searchParams;
|
||||
const vscodeWebWorkerExtHostId = searchParams.get('vscodeWebWorkerExtHostId') || '';
|
||||
const name = searchParams.get('debugged') ? 'DebugWorkerExtensionHost' : 'WorkerExtensionHost';
|
||||
const name = searchParams.get('debugged') ? 'DebugExtensionHostWorker' : 'ExtensionHostWorker';
|
||||
const parentOrigin = searchParams.get('parentOrigin') || window.origin;
|
||||
const salt = searchParams.get('salt');
|
||||
|
||||
|
|
|
@ -202,7 +202,7 @@ export class LanguageDetectionWorkerClient extends Disposable {
|
|||
if (!this.worker) {
|
||||
const workerClient = this._register(createWebWorker<ILanguageDetectionWorker>(
|
||||
'vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker',
|
||||
'languageDetectionWorkerService'
|
||||
'LanguageDetectionWorker'
|
||||
));
|
||||
LanguageDetectionWorkerHost.setChannel(workerClient, {
|
||||
$getIndexJsUri: async () => this.getIndexJsUri(),
|
||||
|
|
|
@ -185,7 +185,7 @@ export class LocalFileSearchWorkerClient extends Disposable implements ISearchRe
|
|||
try {
|
||||
this._worker = this._register(createWebWorker<ILocalFileSearchSimpleWorker>(
|
||||
'vs/workbench/services/search/worker/localFileSearch',
|
||||
'localFileSearchWorker'
|
||||
'LocalFileSearchWorker'
|
||||
));
|
||||
LocalFileSearchSimpleWorkerHost.setChannel(this._worker, {
|
||||
$sendTextSearchMatch: (match, queryId) => {
|
||||
|
|
|
@ -139,7 +139,7 @@ export class ThreadedBackgroundTokenizerFactory implements IDisposable {
|
|||
};
|
||||
const worker = this._worker = createWebWorker<TextMateTokenizationWorker>(
|
||||
'vs/workbench/services/textMate/browser/backgroundTokenization/worker/textMateTokenizationWorker.worker',
|
||||
'textMateWorker'
|
||||
'TextMateWorker'
|
||||
);
|
||||
TextMateWorkerHost.setChannel(worker, {
|
||||
$readFile: async (_resource: UriComponents): Promise<string> => {
|
||||
|
|
Loading…
Reference in New Issue