Skip to content

feat: Evaluate Monaco worker initialization using the new editor.worker.start API #497

Description

@fantonangeli

Description

Try the new Monaco worker initialization documented by @volar/monaco following the resolution of volarjs/volar.js#321, which has now been closed.

The upstream commit replaces the previous editor.worker / initialize() approach with editor.worker.start / start(), and documents the required TypeScript module declarations.

Our Text Editor currently uses initialize() from monaco-editor/editor/editor.worker.js, introduced in #460.

Motivation

Evaluate whether the new upstream-documented initialization approach is compatible with our Monaco/Language Service integration and whether we should adopt it.

The change should also be validated in the Vanilla Example.

Proposed Implementation

  • Experiment with the editor.worker.start / start() initialization pattern documented by Volar, including the worker message handling.
  • Update the local TypeScript module declaration accordingly.
  • Verify that Language Service features, including completions, diagnostics and CodeLens, continue working.
  • Test the integration in the Text Editor Storybook and in examples/vanilla-web-component, using either:
    • the Text Editor PoC from #380 / PR #488, or
    • the final Dual Editor integration from #369, if already available.
  • Document the results and determine whether to adopt the new initialization approach.

Note: the worker console errors tracked in #493 is a separate issue.

Definition of Done

  • Implementation: Fully implemented according to the Open Workflow spec.
  • Unit Tests: Comprehensive unit tests are included and passing.
  • Integration Tests: Verified within the monorepo and target environments (Web/VS Code).
  • Documentation: Updated README.md, ADRs, or official docs.
  • Performance: No significant regression in editor responsiveness.
  • Accessibility: UI changes comply with accessibility standards.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions