Skip to content
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

Add a way to write and reference generated types #960

Merged
merged 34 commits into from
Aug 31, 2020
Merged

Conversation

peterp
Copy link
Contributor

@peterp peterp commented Aug 12, 2020

We're trying to make the magic we introduce via Babel less magical to TypeScript. This PR gives us the ability to generates types in node_modules/@types/@redwoodjs which are automatically imported by TypeScript.

  • Generate types for import-dir.
  • Generate types for Routers routes.<routeName>()
  • Generate types for Pages

@peterp peterp marked this pull request as draft August 19, 2020 08:41
@peterp
Copy link
Contributor Author

peterp commented Aug 20, 2020

Here's an example of the generated routes:

image

image

@peterp
Copy link
Contributor Author

peterp commented Aug 20, 2020

Here's an example of the generated directory imports

image

@peterp
Copy link
Contributor Author

peterp commented Aug 20, 2020

Here's an example of a type definition for an auto-page import
image

@peterp peterp marked this pull request as ready for review August 28, 2020 16:58
@peterp peterp force-pushed the pp-write-generated-types branch 3 times, most recently from f882d15 to 3a44f12 Compare August 31, 2020 17:35
@peterp peterp added this to the v0.17.0 milestone Aug 31, 2020
@peterp peterp merged commit 00a31a3 into main Aug 31, 2020
@thedavidprice thedavidprice deleted the pp-write-generated-types branch September 2, 2020 04:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant