-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Update Typescript to 2.0 #419
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
Conversation
95b591b
to
c5172c3
Compare
Thanks for doing this! I'll check it out sometime soon. |
Will this in any way affect people who are using Apollo Client with Typescript 1.x? |
No, not until the types definition file is modified. With this PR, it’s just the compilation-step analysis that is enhanced, but the .js and .d.ts builds are the same. |
That's odd, since there is a |
Hum, after some investigations, I think this is an instance of microsoft/TypeScript#7719. |
Updating graphql-tag was also required because its incorect types definition was raising errors with TS 2.0, see apollographql/graphql-tag#1. I haven’t opt-in for the `strictNullChecks` option yet, for that’s certainly something to do to get the full benefit of this new TS release.
c5172c3
to
696dd55
Compare
696dd55
to
70e2276
Compare
Looks good to go for me, gonna merge once the tests pass. |
The soon-to-be-released v2.0 of TypeScript will bring a lot of new cool features. Cherry-picking the releases notes, I believe the apollo-client will especially benefit from the discriminated union types (microsoft/TypeScript#9163), the smarter flow analysis, and the explicit
null
andundefined
checks.This PR updates the Typescript compiler to use the v2.0-beta. There is one logic error detected by the new flow analysis:
I haven’t opt-in the
strictNullChecks
option as I’m not that comfortable with the code base, but it sure would be great if someone else could do it.