-
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
How to overwrite __extends emitter? #2487
Comments
Yeah, dupe. If I recall correctly the referenced PR ended up not being a sufficient fix and the full fix was more complex. |
Well, this is kinda important. This code is emitted in every file. An average web app has some 1,000 files: 300 bytes x 1,000 files = 300Kb for every page view. |
Maybe you could consider a hot fix, like something below:
|
If you compile with
If you really believe this is a huge problem, please spend the 10 minutes to write a step in your build pipeline to run a simple regex against the generated .js. If you're really serving 1,000 JS files on every request, you need to re-examine your caching policies. If you're serving them over separate HTTP calls then you're spending way more than that amount of bandwidth in HTTP headers anyway and it you should be serving it as a single bundled file. Since 1,000 files worth of JS is going to be several megabytes, you're going to want to gzip it anyway, which means that repeated text is going to be highly compressed. This can't conceivably be the blocker you make it out to be. |
Currently TypeScripts emits in every file something like this:
Which is only some 300 bytes, but it is in every file. If my web app has hundreds of files, this adds up.
Instead what is the easiest modification to do to make it emit the following in every file:
Can I do something like this?
And leave it up to me to make sure
Object.create
actually exists.The text was updated successfully, but these errors were encountered: