Is there a point to this? Wouldn't you always want to strip those from your code before shipping to the browser, both for size and compatibility, making support irrelevant?
You are only considering decent sized web development in your considerations. There are many more JS users out there. People doing shell scripting (the ZX folks dor example), people doing some data science, or who have a js engine embedded in their other project for scripting. Or hobbyists or small site operators. Or library authors! None of these people have the same complex pipeline you are assuming. They might never have to transpile at all, with these changes, might not need any build tools. The simple cases get orders of magnitudes simpler, and that counts for a lot.
Making it so that the js runtime can handle modern code as it is authored- versus having to preprocess- would be a great relief to many.
It would also help library authors, who are today tasked with authoring code in one style, and writing tools & config to allow type-users or regular users. The regular users, and often accidentaly typescript users, get code which has lots of additional processing they may or may not want, depending on what module outputs & setup the library author picked when they ran typescript. Ideally most of these decisions should be deferred as much as possible to the end, to the consumer, and with this proposal that becomes possible. Library authors could just release tbeir code as is, unmolested. That sounds like such a huge breath of fresh air, that allows just in time decision making at the end, versus forcing projects individually to tackle these questions & somehow work cohesively.
Generally yeah, web projects will still want some processing, probably. There's probably a couple KB of code we could shave off, post-compression, and we (very arguably) should. But the overall toolchain complexity experienced by so so so many users, by library authors, by newcomers... it could be greatly greatly simplified, by not needing each library, each link in the chain, to have to face transpilation challenges. This vastly improves & simplifies the js universe.
Software developmemt is bigger than industrial scale web development. This greatly eases the burden in many many many areas of JS dev.
> Generally yeah, web projects will still want some processing, probably. There's probably a couple KB of code we could shave off, post-compression, and we (very arguably) should.
Even industrial scale web development still needs debug builds during development and the fastest debug build is "no build". Faster development builds lead to increased developer productivity if nothing else.
Also, don't underestimate the fact that type annotations generally compress extremely well. Type stripping certainly would shave a lot of kilos off uncompressed sizes, but it may be negligible to unimportant in gzip or Brotli real world conditions.
I actually am on the no-uglification bandwagon with you!
With compression, I think there's more harm & pain caused by obscuring the source-code to users than there is gain in the very small reduction in size.
But this stance gets quite a reaction, from what I've seen, and I wanted to give a lot more rope to the person I was replying to, rather than try to argue this (fairly nor popular) point too. Which is to say, I hugely agree with you, and good-riddance to industrial web practiced that hurt user-agency (somewhat remediable with source-maps but seemingly few sites have source maps on in prod, and still not as pleasant). It's a small user-base, the view-source folk, but embracing those who take the drive to make the world better (or even to just poke-around-and-learn) is what the world needs!
I worked on a project once and had to prove to several team members that their very slow minification tool in the build process might be reducing the uncompressed size by seemingly quite a bit, but was kind of inflating the compressed size and making the site slower for everyone in reality than the unminified files shipped directly to the user. Performance work is generally underappreciated anyway, but that was particularly underappreciated performance work. "Everyone says minification speeds up the sites! That's just best practices!" versus "Did you actually test this or look at this performance tools?"
Minification isn’t just about reducing size of the output, it also has the very important side effect of obfuscating the output to make it difficult if not practically impossible for reverse engineering and compromising of IP. That is a critical aspect that businesses will always opt for. And business use cases drive things like Typescript into existence.
Anyone who believes minification counts as "proper" obfuscation misunderstands both. Minification is not obfuscation. They have different goals. Most "good" obfuscators are the exact opposite of minification: to obscure business logic they expand the code into sub-parts more akin to assembly language than the original logic. "Good" obfuscation is much more than just using shorter variable names everywhere.
Minification is especially not sufficient for obfuscation in a world with pretty printers embedded into every Dev Tools in every browser.
Minification is just about reducing the size of the output. Any business that truly cares about the safety of their IP should look into "proper" obfuscators.
(Personally, I don't think obfuscators are generally worth the build time and their output worth the extra bandwidth either, but yes there I understand that security theater generally beats performance concerns.)
It offers no real protection against anyone who cares.
And it obstructs people who are going out of their way to improve their usage of your site. It's a pity we only see the risk in that, that the miserly antagonistic corporate dominion attitude rules, that is afraid, that quakes at users doing things not on the l blessed path.
This attitude you've very well spoken for bespeaks a great rot & sadness in the world, one that developers should actively try to work against as much as they can.
Making it so that the js runtime can handle modern code as it is authored- versus having to preprocess- would be a great relief to many.
It would also help library authors, who are today tasked with authoring code in one style, and writing tools & config to allow type-users or regular users. The regular users, and often accidentaly typescript users, get code which has lots of additional processing they may or may not want, depending on what module outputs & setup the library author picked when they ran typescript. Ideally most of these decisions should be deferred as much as possible to the end, to the consumer, and with this proposal that becomes possible. Library authors could just release tbeir code as is, unmolested. That sounds like such a huge breath of fresh air, that allows just in time decision making at the end, versus forcing projects individually to tackle these questions & somehow work cohesively.
Generally yeah, web projects will still want some processing, probably. There's probably a couple KB of code we could shave off, post-compression, and we (very arguably) should. But the overall toolchain complexity experienced by so so so many users, by library authors, by newcomers... it could be greatly greatly simplified, by not needing each library, each link in the chain, to have to face transpilation challenges. This vastly improves & simplifies the js universe.
Software developmemt is bigger than industrial scale web development. This greatly eases the burden in many many many areas of JS dev.