Skip to content

Commit 1304d5c

Browse files
ttys026Copilot
andcommitted
chore: update examples to monaco-editor 0.55.1 with worker option
Update all three examples (demo, vite-example, monaco-editor-webpack-plugin) to use monaco-editor 0.55.1 and the new `worker` option in configureMonacoYaml. The yaml worker case is removed from MonacoEnvironment.getWorker since it's now handled directly by the worker option. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 64eed3a commit 1304d5c

File tree

7 files changed

+9
-28
lines changed

7 files changed

+9
-28
lines changed

examples/demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"css-minimizer-webpack-plugin": "^7.0.0",
1515
"html-webpack-plugin": "^5.0.0",
1616
"mini-css-extract-plugin": "^2.0.0",
17-
"monaco-editor": "^0.52.0",
17+
"monaco-editor": "0.55.1",
1818
"monaco-yaml": "file:../..",
1919
"ts-loader": "^9.0.0",
2020
"webpack": "^5.0.0",

examples/demo/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ window.MonacoEnvironment = {
1818
switch (label) {
1919
case 'editorWorkerService':
2020
return new Worker(new URL('monaco-editor/esm/vs/editor/editor.worker', import.meta.url))
21-
case 'yaml':
22-
return new Worker(new URL('monaco-yaml/yaml.worker', import.meta.url))
2321
default:
2422
throw new Error(`Unknown label ${label}`)
2523
}
@@ -34,6 +32,7 @@ const defaultSchema: SchemasSettings = {
3432

3533
const monacoYaml = configureMonacoYaml(monaco, {
3634
enableSchemaRequest: true,
35+
worker: () => new Worker(new URL('monaco-yaml/yaml.worker', import.meta.url)),
3736
schemas: [defaultSchema]
3837
})
3938

examples/monaco-editor-webpack-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dependencies": {
1111
"css-loader": "^7.0.0",
1212
"html-webpack-plugin": "^5.0.0",
13-
"monaco-editor": "^0.52.0",
13+
"monaco-editor": "0.55.1",
1414
"monaco-editor-webpack-plugin": "^7.0.0",
1515
"monaco-yaml": "file:../..",
1616
"style-loader": "^4.0.0",

examples/monaco-editor-webpack-plugin/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { configureMonacoYaml } from 'monaco-yaml'
33

44
configureMonacoYaml(monaco, {
55
enableSchemaRequest: true,
6+
worker: () => new Worker(new URL('monaco-yaml/yaml.worker', import.meta.url)),
67
schemas: [
78
{
89
// If YAML file is opened matching this glob

examples/vite-example/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ window.MonacoEnvironment = {
88
switch (label) {
99
case 'editorWorkerService':
1010
return new EditorWorker()
11-
case 'yaml':
12-
return new YamlWorker()
1311
default:
1412
throw new Error(`Unknown label ${label}`)
1513
}
@@ -18,6 +16,7 @@ window.MonacoEnvironment = {
1816

1917
configureMonacoYaml(monaco, {
2018
enableSchemaRequest: true,
19+
worker: () => new YamlWorker(),
2120
schemas: [
2221
{
2322
// If YAML file is opened matching this glob

examples/vite-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "vite build"
99
},
1010
"dependencies": {
11-
"monaco-editor": "^0.52.0",
11+
"monaco-editor": "0.55.1",
1212
"monaco-yaml": "file:../..",
1313
"vite": "^7.0.0"
1414
}

package-lock.json

Lines changed: 3 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)