Vetur: Extension size doubled after update of TypeScript's major

Created on 13 Sep 2020  路  7Comments  路  Source: vuejs/vetur

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] 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 [email protected] (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

bug

All 7 comments

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

i updated my packages and ran yarn upgrade on my local fork, and checked the yarn.lock, my packages are no longer dependent on typescript.

ref #2232 , #2233

It seems that @typescript-eslint/typescript-eslint uses a resolutions package.json property (only supported by default by Yarn) to force a certain TypeScript version to be used:

https://github.com/typescript-eslint/typescript-eslint/commit/e6be62128b3a98541fe590512892c4b501914e46#diff-b9cfc7f2cdf78a7f4b91a753d10865a2

I've never used it before myself so I'm not sure how exactly it behaves, but it seems like it might be useful here?

@TheRealSyler @sorg/log -> s.color still depends on TS 3.9.7.

@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} ?

@TheRealSyler You are correct, I didnt' realize. I saw it in yarn why typescript, but the yarn --prod in my release script won't include it.

Was this page helpful?
0 / 5 - 0 ratings