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#402suf-cli - Has its own node_modules/typescript (v3.9.7). The package depends on typescript ^3.6.3. See TheRealSyler/suf-cli#2ts-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.
N/A
@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.
@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.