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

Shapes aren't that fun to write. #87

Closed
sam-goodwin opened this issue Dec 30, 2019 · 2 comments · Fixed by #102
Closed

Shapes aren't that fun to write. #87

sam-goodwin opened this issue Dec 30, 2019 · 2 comments · Fixed by #102
Labels

Comments

@sam-goodwin
Copy link
Owner

Shapes enable the generic data structures and APIs of Punchcard, but their type signatures can be excessive spaghetti.

E.g.

const table: DynamoDB.Table<"id", undefined, {
  id: StringShape;
  count: IntegerShape;
  name: StringShape;
  array: ArrayShape<StringShape>;
  struct: StructShape<...>;
  any: DynamicShape<...>;
}>

Perhaps we should look into generating Shapes from another representation, e.g. Smithy (https://github.com/awslabs/smithy) or GraphQL (https://graphql.org/, #86)?

The generated code could generate boilerplate interfaces instead of computing types with RuntimeShape<S>, resulting in more helpful (well documented) hints from the compiler/IDE toolchain. Developer experience would be just as "nice", except there would now be a new file format.

@sam-goodwin
Copy link
Owner Author

Interesting code-first approach for GraphQL: https://github.com/MichalLytek/type-graphql

@sam-goodwin
Copy link
Owner Author

Discussion in #86 has a lot about shapes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant