ui: monaco: upgrade to 0.57, drop monaco-editor-webpack-plugin

- Migrate entry points to the 0.57 exports scheme (monaco-editor/editor,
  languages/features/typescript/register)
- Wire workers via the official MonacoEnvironment.getWorker +
  new Worker(new URL(...)) integration; webpack emits them as shared-chunk
  classic workers (chrome 70 compatible), total assets -21%
- Keep css/html/json language features (register.all) and route their
  worker labels; json is used by the cmeditor textareas
- Replace removed esm/vs/nls.messages with an inline implementation in the
  nls shim
- Drop MinChunkSizePlugin: it merged worker chunks into the main chunk and
  broke the runtime id module (webpack#15416)
- Remove monaco-editor-webpack-plugin dependency
- loadMonaco() now returns the loaded feature module exports, e.g.
  loadMonaco(['typescript']).typescript.javascriptDefaults
This commit is contained in:
undefined committed 2026-10-09 16:26:44 +00:00
1 parent 80638bf9ab
commit 489b2dbeec
11 files changed
+103 -42

No files matched your search

@@ -1,4 +1,4 @@
import type * as monaco from 'monaco-editor';
import type * as monaco from 'monaco-editor/editor';
import React from 'react';
import { connect } from 'react-redux';
import { load } from 'vj/components/monaco/loader';
@@ -3,7 +3,7 @@ import SettingsIcon from '@vscode/codicons/src/icons/settings-gear.svg?react';
import { Allotment } from 'allotment';
import $ from 'jquery';
import _ from 'lodash';
import type * as monaco from 'monaco-editor';
import type * as monaco from 'monaco-editor/editor';
import React from 'react';
import { useDispatch, useSelector, useStore } from 'react-redux';
import Dom from 'vj/components/react/DomComponent';
@@ -38,9 +38,9 @@ class ScratchpadService extends Service {
load: Promise<void>;
loadCallback: () => void;
editor: monaco.editor.IStandaloneCodeEditor;
monaco: typeof import('monaco-editor');
monaco: typeof import('monaco-editor/editor');
init(editor: monaco.editor.IStandaloneCodeEditor, monaco: typeof import('monaco-editor')) {
init(editor: monaco.editor.IStandaloneCodeEditor, monaco: typeof import('monaco-editor/editor')) {
this.editor = editor;
this.monaco = monaco;
this.loadCallback();