-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeScript has doubled in size since v2.0.0 - now 35 MB #23339
Comments
I agree - installs should be definitely be fast! But also keep in mind that 2 years is a long time, so we've done a lot outside of what was in 2.0 (e.g. infrastructure for our emit pipeline). But you're right, on an individual basis, Just to note, otherwise, the TypeScript package's
|
@DanielRosenwasser Thanks for the quick and detailed response! The installs are pretty fast which is why it caught me off guard. I noticed typescript is about the same size as webpack-cli but installs much faster, likely due to the fact that there are zero dependencies (I didn't measure install times and I'm not sure if npm caches results anyway).
By modules, you mean ES6 Modules? Something that node.js doesn't support yet? I know that @jdalton wrote esm which might be worth including a few additional kB from the I'm not sure how much collaboration there is between the TypeScript team and the Web Apps team or even if this is achievable. |
I tried installing some packages and checking the resulting size of
It doesn't seem like investing time to reduce our install to be even more smaller than other comparable JS tools is a good use of resources. If there's low-hanging fruit we can trim without cost, we should do that, but this isn't worth worrying about right now. |
@RyanCavanaugh Those are not the numbers I got when I ran the same tests 😕 See my results below:
|
Oops, totally invalid results. Didn't realize NPM changed behavior and started saving to package.json by default! |
I have been doing some comparisons of popular tools in similar categories and I happen to really like TypeScript so I thought I would make note of it. You can see some of the comparisons I've done here: https://github.com/styfle/packagephobia#demo That being said, what is the quote "If we used modules, we'd be able to share each file and avoid this duplication" mean? Is this achievable in a TS 3.0.0 or some future release? |
We have a change to reorganize the library in #15780. this should allow us to remove all duplication in the lib files. that said, I expect the lib file to increase in the next release as we are working on updating it and adding comments, so that might end up being a wash. We should be able to remove some 6 MBs by combining the two targets tsserverlibarary.js and typescriptservices.js. this a breaking change, so we will have to phase it on two releases or so (i.e. combine the contents of the two files in one, but keep both copies in one release, then remove one copy in the next release.). We can always minify our output. we have not had a reason to do this in the past.
it is something we want to do, but no plans for the short term. that is where the majority of savings would come from. if we use modules, we should be able to cut the non-library part to 7 MBs or so. |
For context, today we don't use modules; each file in the Typescript compiler uses namespaces in the global scope, and is concatenated at the end. That means that
For a Node project, I don't think this is worth it unless it'd just be about stripping out whitespace. |
Thanks for all the information, I appreciate the dialog 👍 I would like to point out that the latest [email protected] has just doubled again The spike was introduced in [email protected] Is this worrisome? At what point is TypeScript too big? 😕 |
No, that is definitely a bug.. we changed the publishing script, and now we are picking up way too many files that should not be there..
other files that should not be there in the first place
@weswigham can you please take a look, we need to fix this for the next release.. thanks @styfle for reporting this. |
@mhegazy is the case of those files wrong in our npmignore? All we did was start to publish on 'nix. |
the .d.ts files indicate a change in the build process, we should not be building |
|
the |
looks like we are explictlly setting |
nevermind, we set it to run the tests, and not for the publishing.. |
looks like the rouge files were added in #23844 |
|
Also, I created #24282 to display this info in the README so it's more visible. |
@mhegazy This happened again in [email protected]
Update: I would have expected #24712 to catch this at build time before the new version was published. Would you like a new issue for this or should we continue discussion here? |
Also happened again in [email protected]
Surely this must be a bug, right? |
@weswigham can u take a look. |
Search Terms: install size mb
Expected behavior:
I expected typescript to be relatively small since it has zero dependencies so there is no additional bloat from
package.json
orREADME.md
files included with dependencies.[email protected]
is about 17 MB, not too bad.Actual behavior:
[email protected]
is about 35 MB - double the size in about 2 yearsI realize that there are no stated goals of install size, however it is worth considering because...how is TypeScript getting so big so fast? 😕
This might inhibit new users from coming on board when their code base might be a few kB with plain JS and adding TS would make it 35 MB.
Steps to reproduce
The text was updated successfully, but these errors were encountered: