gatsby-typescript
gatsby-typescript copied to clipboard
[codegen] Detach codegen from gatsby lifecycle
Not sure if this should be the way to move forward. This will allow us to provide a smoother experience for 100% typescrip codebase, i.e generating typings for queries in both gatsby-node and src/**/*.ts{x}.
Current problems:
- Gatsby don't watch
gatsby-node, or files outside ofsrc - Typegen doesn't happen until
onPostBootstrap. If user changes their query in gatsby-node and the new type is not yet generated, error will be thrown & prevent a new build.
We don't have to go heavy on this, i.e creating a separate process. Perhaps a webpack plugin? Not sure yet ... need some more thinking...
Also, I wish we knew a bit more about Gatsby's plan on supporting TS in v3! :)
Hey - is there any movement on this. I would like to generate types without running a build or dev. Is it possible?
My team, too, is trying to figure out how to do this too.