Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

[codegen] Detach codegen from gatsby lifecycle #76

Open
d4rekanguok opened this issue Mar 24, 2020 · 2 comments
Open

[codegen] Detach codegen from gatsby lifecycle #76

d4rekanguok opened this issue Mar 24, 2020 · 2 comments
Labels
enhancement New feature or request feedback wanted

Comments

@d4rekanguok
Copy link
Owner

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 of src
  • 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! :)

@ChrisSargent
Copy link

Hey - is there any movement on this. I would like to generate types without running a build or dev. Is it possible?

@DevanB
Copy link

DevanB commented Dec 14, 2021

My team, too, is trying to figure out how to do this too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request feedback wanted
Projects
None yet
Development

No branches or pull requests

3 participants