this means ts type definitions are now exposed - so ts-based redwood projects should get type safety and autocompletion when they use redwoodjs-stripe
ts type definitions are generated from graphql queries and schema definitions, and used internally by redwoodjs-stripe/{api,web} for typechecking
Lower level context
the build scripts were changed such that they'll include the necessary codegen steps and type definitions building steps
we still generate runtime code the same way, and only use tsc for generating the type definitions
there are a bunch of changes and additions needed to the sdls to get the data to be compatible with what the stripe sdk is expecting
we do a bunch of null/undefined parsing when receiving data from the graphql api client side and providing it to the stripe sdk to fix types
for objects, if the value is null or undefined, we omit the corresponding property
for arrays, we filter out nulls
ideally what we need, is to generate the sdl types from stripe's own api types that they provide - this will probably mean we'll be able to avoid both further handwritten sdl maintenance, and this ^ parsing layer.
before investing time into that, probably first worth waiting out what happens with redwood's move to react server components (e.g. in case graphql is phased out of redwood)
Highlights
api
andweb
are now fully typescriptLower level context
tsc
for generating the type definitions