-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Start using ES5 functionality in tsc #10125
Comments
Gotta make the title less scary-sounding. 😃 |
/cc @mihailik who we remember was doing something with TS on ES3 |
Thanks @RyanCavanaugh -- the reasons, costs and benefits suggest this should not be done as of yet. There are two parts to this issue: work to be done and resulting effect. **THE EFFECT** (just looking at the goals stated) seems to be at least superficial, or may be even negative. How so? Today operations like You would spend time and cognitive effort finding, explaining and checking the safe ES5 subset is used as an ongoing extra "tax". There are positives of course: tsc.js size would decrease, performance might improve, in certain parts syntax would be more familiar to the non-core contributors. A bit of marketing boost too, as always with getting new features. Again, looking at the goals stated, there is no killer feature in ES5 that would simplify or boost code:
**THE COST OF IMPLEMENTATION** depends on the strategy. Could be a risky big-bang with whole team's work disrupted during widespread changes Lots of upfront cost, tailing over the coming week or two. Or it could be the same cost spread across months while old and new approaches coexist. This migratory state is likely to mess up debugging experience and performance metrics quite a bit. |
@mihailik That's your evaluation of the upsides and downsides for us.... but would this change affect you? Would us moving to writing our compiler with ES5 functions break you? (It would mean that the compiler could no longer be run on ES3 runtimes) |
Yes, because I cannot polyfill getters on ES3. Everything else is a manageable. If it comes to that, I'll have to peg TS to a pre-ES5 version, and stick to it :-( |
We're doing this already with |
This affects some companies running ES3 native implementations. It may sound like ES3 is extremely old with ES7 on the horizon, but being able to compile TS to ES3 is a very big deal for some large companies. |
@nym we are not dropping support for |
@vladima thanks for the clarification. |
Note that this issue is not about dropping support for
--target es3
.This came up in a meeting today. Given that
tsc.exe
now uses ChakraCore to runtsc.js
, it's not clear how much value users are getting in being able to run TypeScript on ES3 runtimes.Reasons we'd do this include
map
,filter
,reduceLeft
,some
, andevery
.Object.create(null)
to avoidhasOwnProperty
calls for every lookup.JSON.stringify
.The text was updated successfully, but these errors were encountered: