-
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
Rollback tsconfig.base.json
's target to es5
for transformer libraries
#52826
Comments
p.s) If hard to rollback the build option, is it possible support the transform plugin by TypeScript itself? |
The change in the output has nothing to do with the target being changed from ES5 to ES2018; the code you have above only works because TypeScript used to be authored using namespaces, which produced a series of: var ts;
(function (ts) {
ts.something = ...
})(ts)
var ts;
(function (ts) {
ts.somethingElse = ...
})(ts) But now we're modules, which simply do not produce that code, and additionally do not allow the API to be overwritten at runtime. I don't see us reverting that change. Any package which patches typescript is already fragile because any aspect of our output could change. This change is just one potential way that this could have broken. Those who have to patch typescript will need to:
Or, of course, give a proposal about what to change in TS to allow these sorts of things, though I believe all of the major reasons to patch typescript already have corresponding issues. |
@jakebailey Thanks for fast replying. I just hope This question is by just my curiosity. Is there some reason that TypeScript is not supporting transform plugin by itself? |
@samchon Jake is correct. This issue can be closed.
|
Suggestion
π Search Terms
β Viability Checklist
My suggestion meets these guidelines:
β Suggestion
Hope to keep
es5
taget build for transformer libraries.Until v4.9, TypeScript had been built as
es5
. However, after v5 update, it has been changed fromes5
to `es2018.TypeScript/src/tsconfig-base.json
Line 5 in ccf3d3c
TypeScript/src/tsconfig-base.json
Line 8 in ddfec78
I understand the reason why updating the build target, however, it may be a critically damage on transformer libraries.
Looking at source code of transformer libraries like ttypescript and ts-patch, they are supporting transform plugin through hacking TypeScript source code like below. They're utilizing and strongly dependent on characteristics of
es5
target build.π» Use Cases
Threfore, I hope you TypeScript language developers to keep the
es5
target build.As you know, so many TypeScript lovers are enjoying transformeer libraries like typescript-transform-paths. I am also developing transformer based libraries like typia and nestia for many years. I do not want to lose transformer API, and do not want to give up maintaining my open source libraries, either.
Please keep the target build option as
es5
.The text was updated successfully, but these errors were encountered: