@codingame/monaco-vscode-standalone-html-language-features 31.0.0 → 32.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/workers.js +10 -2
- package/package.json +2 -2
package/common/workers.js
CHANGED
|
@@ -26,6 +26,13 @@ if (typeof self === "object" && self.constructor && self.constructor.name === "D
|
|
|
26
26
|
createScriptURL: (value) => value
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
+
function getWorkerBootstrapUrl(workerScriptUrl, workerOptions) {
|
|
30
|
+
const blob = new Blob([[
|
|
31
|
+
`${workerOptions.type === "module" ? "await import" : "importScripts"}(${JSON.stringify(workerScriptUrl)});`,
|
|
32
|
+
`globalThis.postMessage({ type: 'vscode-worker-ready' });`
|
|
33
|
+
].join("")], { type: "application/javascript" });
|
|
34
|
+
return URL.createObjectURL(blob);
|
|
35
|
+
}
|
|
29
36
|
function getWorker(descriptor) {
|
|
30
37
|
const label = descriptor.label;
|
|
31
38
|
const monacoEnvironment = globalThis.MonacoEnvironment;
|
|
@@ -35,9 +42,10 @@ function getWorker(descriptor) {
|
|
|
35
42
|
}
|
|
36
43
|
if (typeof monacoEnvironment.getWorkerUrl === "function") {
|
|
37
44
|
const workerUrl = monacoEnvironment.getWorkerUrl("workerMain.js", label);
|
|
45
|
+
const workerOptions = { name: label, type: "module", ...monacoEnvironment.getWorkerOptions?.("workerMain.js", label) };
|
|
38
46
|
return new Worker(
|
|
39
|
-
ttPolicy ? ttPolicy.createScriptURL(workerUrl) : workerUrl,
|
|
40
|
-
|
|
47
|
+
getWorkerBootstrapUrl(ttPolicy ? ttPolicy.createScriptURL(workerUrl) : workerUrl, workerOptions),
|
|
48
|
+
workerOptions
|
|
41
49
|
);
|
|
42
50
|
}
|
|
43
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-standalone-html-language-features",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "32.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"main": "./language/html/monaco.contribution.js",
|
|
26
26
|
"module": "./language/html/monaco.contribution.js",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@
|
|
28
|
+
"monaco-editor": "npm:@codingame/monaco-vscode-editor-api@32.0.0",
|
|
29
29
|
"vscode-html-languageservice": "5.2.0",
|
|
30
30
|
"vscode-languageserver-textdocument": "1.0.12",
|
|
31
31
|
"vscode-languageserver-types": "3.17.5"
|