question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Extension size doubled after update of TypeScript's major

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: N/A
  • Vetur version: 0.27.3
  • VS Code version: N/A

Problem

I noticed that the extension size went from 147MiB in 0.26.1 to 349MiB in 0.27.3. It appears that the extra space came from the appearance of multiple redundant TypeScript packages in the Vue language server dependencies. The packages in question are:

  • @typescript-eslint/typescript-estree - Has its own node_modules/typescript (v4.0.2). The package depends on typescript * as a devDependency.
  • prettier-eslint - Has its own node_modules/typescript (v3.9.7). The package depends on typescript ^3.9.3. See prettier/prettier-eslint#402
  • suf-cli - Has its own node_modules/typescript (v3.9.7). The package depends on typescript ^3.6.3. See TheRealSyler/suf-cli#2
  • ts-doc-gen - Has its own node_modules/typescript (v3.9.7). The package depends on typescript ^3.6.3. This package, according to its readme, has been superseded by suf-cli.

Each of these duplicate TypeScript packages contributes 51MB to the extension size. The VLS itself uses typescript@4.0.2 (server/node_modules/typescript).

I’m not sure why the problem with @typescript-eslint/typescript-estree happened. package-lock.json on a machine of a Vetur maintainer, perhaps?

In the case of the latter three, it’s due to TypeScript refusing to adhere to semver (see microsoft/typescript#14116). I opened issues on the project pages of the affected projects.

Side note: why are suf-cli and ts-doc-gen bundled? They seem to be development dependencies. Also, one of them replaces the other.

Side note 2: this issue also affects prettier-tslint (azz/prettier-tslint#41), but since it uses TypeScript as a peer dependency npm only mentions it as an unmet peer dependency.

Reproducible Case

N/A

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
TheRealSylercommented, Sep 21, 2020

@octref not as a devDep, s.color @sorg/log, did you run yarn or yarn upgrade?, or do you mean that they still depend on an old typescript version as in devDep: {ts: 3.9.7} ?

1reaction
TheRealSylercommented, Sep 13, 2020

@opl- ill update my packages soon, i wasn’t aware that its important to add ts as a devDep.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support TypeScript v4.x #402 - prettier/prettier-eslint - GitHub
Unfortunately, TypeScript doesn't adhere to semver (see ... Extension size doubled after update of TypeScript's major vuejs/vetur#2273.
Read more >
November 2022 (version 1.74) - Visual Studio Code
This reduced the size of our main bundles by ~13% (-1.5 MB) and reduces code loading times by ~5%. GitHub & Microsoft Authentication...
Read more >
Array.prototype.length - JavaScript - MDN Web Docs
In the following example, the array numbers is iterated through by looking at the length property. The value in each element is then...
Read more >
Pros and Cons of TypeScript - AltexSoft
New syntax for type-only imports and exports. This update is supposed to give developers more control over how the compiler imports and elides...
Read more >
10 Must-have VS Code Extensions for JavaScript Developers
Snippet Extensions. When you first install VS Code, it comes with a several built-in snippets for JavaScript and Typescript. Snippets help you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found