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
[Finished] TypeScript conversion #1806
Conversation
Typing PRs:
|
c373202
to
90f3eaa
Compare
This looks amazing! I'd be lot more confident in changing the code now. Let me know if you need a ✋, I'm not a TS expert though! |
I am little biased, but I would strongly recommend taking this opportunity to also introduce Prettier into your toolchain, and never think about formatting ever again :) Let me know if you have any questions about it. P.S. <3 Rollup |
0183368
to
aa5a63e
Compare
Whoa! I didn't know about this, but I'm a big fan of TypeScript so definitely 💯 from me. |
src/ast/nodes/CallExpression.ts
Outdated
@@ -5,6 +5,7 @@ import ExecutionPathOptions from '../ExecutionPathOptions'; | |||
import SpreadElement from './SpreadElement'; | |||
import { PredicateFunction } from '../values'; | |||
import GlobalVariable from '../variables/GlobalVariable'; | |||
import { ObjectPath } from '../variables/VariableReassignmentTracker'; | |||
|
|||
// TODO: 3 typing failures because AwaitExpression has no forEachReturnExpressionWhenCalledAtPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this case resolved now? If so the comment here can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed this now.
I've just noticed that despite the "es5" target we've got in the TypeScript config, Rollup still assumes things like Map and iterator support. Node 4 will support this and the const stuff so I was wondering if it's worth just updating the build to ES6 at this point? We can still individually pick used features based on what we deem important? This came up in the process of trying to add downlevelIteration support for true ES5, and noticing that no Map shims were in place. |
This also reduces the TypeScript browser build when minified and gzipped by 5KB. |
697d677
to
ad8484b
Compare
Ok I've reverted this attempt for now. The Buble register made this seem like it could work, but it seems that es5 can only be dropped when dropping support for Node4 I guess. Iteration support through rollup/rollup-plugin-typescript#102 is no longer necessary though. |
Ok, this goes into master now... |
So, that's it. The next release will be a TypeScript release! |
How cool is that! 🎇 |
I just wanted to chime in and say you folks rock 🤘 . Thanks, |
Everything is typed now and this is ready to be merged!
Closes #1570.
This is based off @Rich-Harris original PR #1570. @guybedford and myself have been working the last days to add missing types and make everything as smooth as possible so that we can do the transformation as soon as possible.
Why TypeScript, why now?
Cons:
Pros:
Bundle.js
/Module.js
complex. The internal API surface of those is HUGE and only understood by few - if at all. TypeScript allows us to make members private and define interfaces to structure the API around