monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

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

Open arnoudkooi opened this issue 2 years ago • 3 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [X] 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

arnoudkooi avatar Sep 22 '23 23:09 arnoudkooi

I'm not sure if this is easy to fix - I guess the typescript compiler ships various libraries (like ES3/ES6).

hediet avatar Oct 05 '23 10:10 hediet

I think, first analyzing and removing duplicate lines can be done. Then we can look at the condition, if it solves, then good, otherwise need to look down into deep for solution.

manjeetsharma0796 avatar Oct 15 '23 04:10 manjeetsharma0796

The issue is not yet fixed in 0.48.0

cyfung1031 avatar Apr 30 '24 17:04 cyfung1031