microsoft / microsoft/monaco-editor

[Bug] Many duplicates in minified tsWorker.js leading to large file

Open
#4,184 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

debt help wanted
Dominant language
JavaScript
Stars
46.8k
Forks
4.1k
Avg merge
17h 58m
Merged PRs (30d)
1

Description

Reproducible in vscode.dev or in VS Code Desktop?
  • Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
Reproduction Steps
  1. Open a compiled version of the file min/vs/language/typescript/tsWorker.min.js CDN Example
  2. Optionally copy the code in a VS Code window
  3. Search for interface CanvasDrawPath {
  4. Note that the definition is found twice
  5. This duplication issue is the case for a lot of code

Code20230923 - 0129

Actual (Problematic) Behavior

The minified version of tsWorker.js is around 4.6 MB I want to use the Monaco editor in a web extension, but this allows a maximum file size of 4 MB

If the code duplication is fixed, that would reduce the filesize enough to get below 4 MB

Expected Behavior

No duplicate code generated during the build

Additional Context

Related Add_ons Linter issue https://github.com/mozilla/addons-linter/issues/3915

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated min/vs/language/typescript/tsWorker.min.js file and the reported duplicate interface CanvasDrawPath definition, using the CDN example to reproduce the size and duplication. Trace the build inputs that produce tsWorker.js and verify that the duplicate code is removed without changing the worker output; done means the minified file is below the reported 4 MB limit and no longer contains the duplicated definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.