-
Notifications
You must be signed in to change notification settings - Fork 13
[Breaking] Drop Flow type support in favor of TypeScript #355
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
0fce080
to
524daec
Compare
`; | ||
})()} | ||
|
||
let response = await ${callResource(resourceConfig, resourcePath)}(resourceArgs); | ||
// Any-type so this is re-assignable to the 'nestedPath' without TS complaining |
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.
in theory this could use a supression instead
but then we don't necessarily know what linter or whatever we'll use in the future that might complain, which might have a different suppression syntax (e.g. maybe one day we switch to biome)
so i guess this is still good
2e8bc64
to
0c1d744
Compare
Test using node 22
@magicmark added compile-time tests for expect-type. I wasn't entirely sure how to structure all of this (ended up being convenient using the swapi example to do the type tests) so open to any feedback how to reorganize those tests. In the process I think I uncovered a bug - we aren't supplying batch keys as a |
// Check that the param type of isBatchKeyASet: true matches | ||
expectTypeOf<Parameters<LoadersType['getFilms']['load']>>().branded.toEqualTypeOf<[args: { film_id: number }]>(); |
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.
++++ nice
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.
Awesome!
This also appears to be working as expected when linked into our internal services.
++
Feel free to merge and follow https://github.com/Yelp/dataloader-codegen/blob/master/PUBLISH.md for a major change (let's go to 1.0.0, I think it's time :P)
This PR drops Flow support in favor of TypeScript. Although dataloader-codegen is set up in a way to support multiple languages, given Flow's trajectory as a type system IMO the additional burden of maintaining two type systems simultaneously doesn't make sense.
Other changes of note:
swapi.dev
atswapi.info
now and it works the same as beforeVerification
Running the
swapi
example works as expected. This also appears to be working as expected when linked into our internal services.