-
Notifications
You must be signed in to change notification settings - Fork 2k
Remove 'devAssert' checks that duplicate TS types #3642
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
✅ Deploy Preview for compassionate-pike-271cb3 ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Hi @IvanGoncharov, I'm @github-actions bot happy to help you with this PR 👋 Supported commandsPlease post this commands in separate comments and only one per comment:
|
Not that I am against — but I believe the reason devAssertions have been retained is to help out those coding in JS without access to IDE help from TS. I don’t believe we ”forgot“ to remove them. We have chosen until now to keep supporting JS at this level. I do agree, however, that in terms of our cost/benefit analysis, we should remove them — in favor of more generic help to JavaScript developers via the exported types. I hope our JavaScript users agree! |
Yes, you're right it wasn't "forgotten" moreover I maintained them and migrated from generic |
`graphql` provides TS types since `14.5.0` (released 3 years ago) and we fully switched to TS in `15.0.0` so I think it's time to drop runtime typechecks. Motivations: This type checks were added long time ago since we shifted towards TS we just maintained them without adding new ones. In general, this check increase bundle size add runtime cost and we can't realistically check all arguments to all functions. Instead we should focus on adding more asserts on stuff that can't be checked by TS.
84eb7c7
to
9318a8d
Compare
Context: Continuation of graphql#3642
Context: Continuation of graphql#3642
graphql
provides TS types since14.5.0
(released 3 years ago)and we fully switched to TS in
15.0.0
so I think it's time to dropruntime typechecks.
Motivations: This type checks were added long time ago since we shifted
towards TS we just maintained them without adding new ones.
In general, this check increase bundle size add runtime cost and we
can't realistically check all arguments to all functions.
Instead we should focus on adding more asserts on stuff that can't be
checked by TS.