Skip to content

Upgrade frontend to monaco-languageclient v10 #4996

@aglinxinyuan

Description

@aglinxinyuan

Task Summary

Bring the frontend's Monaco / VS Code language-client stack up to monaco-languageclient v10 (was v8.8.3) and the matching @codingame/monaco-vscode-* v25.1.2 ecosystem. v10 reorganised the public API around three composable wrappers (MonacoVscodeApiWrapper + EditorApp + LanguageClientWrapper), so the editor component is rewritten against the new shape, and the build/test pipeline picks up the codingame v25 quirks the new packages introduce.

Why

  • v8.8.3 has been EOL'd by upstream; new feature work and security fixes target the v10 line.
  • The codingame v25 stack ships pre-built worker entries, native Worker(new URL(...)) syntax, Constructable Stylesheets-based CSS, and a whenReady() activation handshake — none of which the older builder workarounds anticipated.
  • Several adjacent dependencies (R UDF extension, redundant @codingame declarations, dead vscode resolution) become superfluous once the new API is in place.

Scope

  • API rewrite — swap the v8 single-wrapper config for the v10 MonacoVscodeApiWrapper + EditorApp + LanguageClientWrapper triplet, plus a whenReady()/forceTokenization handshake to fix a TextMate first-paint race.
  • Worker bundling — three thin trampoline files re-export the codingame worker entries; new Worker(new URL("./relative", import.meta.url)) is the only shape webpack 5 treats as a worker entry point AND that esbuild can resolve at spec pre-bundle time.
  • Build pipeline — patch license-webpack-plugin to tolerate the codingame submodules' empty descriptionFileRoot, add a oneOf CSS rule with exportType: 'css-style-sheet', alias the codingame asset packages back to the real css-loader / style-loader install.
  • Test pipeline — register a Node ESM loader hook (inline as a data: URL — no sidecar .mjs) that swallows transitive .css imports, plus stubs for Constructable Stylesheets / CSS.escape / matchMedia / requestIdleCallback / WebSocket.
  • Dependency cleanup — drop ~6 codingame side-deps that v10 either ships transitively or no longer needs (textmate-service-override, theme-defaults-default-extension, R default extension, the vscode package alias and resolution, webpack-bundle-analyzer). Retire R UDF editor support entirely (no upstream codingame R extension exists).

Verification plan

  • yarn install resolves the v10 + v25.1.2 graph cleanly
  • yarn build exits 0; worker chunks are bundled (~1.3 MB textmate / ~518 KB extension-host / ~220 KB editor)
  • yarn test stays at 63 / 269 spec parity
  • Smoke-test the Python UDF editor: language detected, syntax colours render on first paint, debugger breakpoints work, multi-user collaborative cursors still appear via the y-monaco binding

Task Type

  • Refactor / Cleanup

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No fields configured for Task.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions