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

feat(type-safe-api): websocket apis for typescript #731

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

cogwirrel
Copy link
Member

@cogwirrel cogwirrel commented Mar 21, 2024

Add a new TypeSafeWebSocketApiProject which can be used to build WebSocket APIs in a similar manner to REST APIs.

This includes:

  • Modelling an API in Smithy or OpenAPI
  • Generated CDK infrastructure (WebSocket API and Lambda functions)
  • Generated runtimes containing lambda handler wrappers, and server SDK to send messages to clients
  • Generated handler stubs with the @handler trait
  • Generated client and react hooks libraries for use client side
  • Integration with infrastructure and website projects
  • WebSocket API explorer
  • WebSocket API CDK construct with validation schemas as custom resource to scale for larger apis

Only TypeScript is supported currently, but refactoring work has been done to make Python and Java support more straightforward.

Note the new Java project in internal/smithy-async-transformer - this allows us to perform a transform on users' Smithy models to augment operations with additional traits required for OpenAPI generation.

Note that this upgrades the version of CDK we depend on so that we can use the WebSocketApi construct - this has had a few minor knock on effects on the pipeline package.

Remaining items for follow up PRs:

  • Documentation generation from model
  • Python support
  • Java support

@cogwirrel cogwirrel force-pushed the feat/ts-websocket-api branch 7 times, most recently from 75c0943 to 4170ab5 Compare March 24, 2024 04:54
Copy link
Contributor

@agdimech agdimech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What an achievement!

This is an epic new feature and love how clean and concise the constructs and docs are. Well done!

Add a new `TypeSafeWebSocketApiProject` which can be used to build WebSocket APIs in a similar
manner to REST APIs.

This includes:

* Modelling an API in Smithy or OpenAPI
* Generated CDK infrastructure (WebSocket API and Lambda functions)
* Generated runtimes containing lambda handler wrappers, and server SDK to send messages to clients
* Generated handler stubs with the `@handler` trait
* Generated client and react hooks libraries for use client side
* Integration with infrastructure and website projects
* WebSocket API explorer
* WebSocket API CDK construct with validation schemas as custom resource to scale for larger apis

Only TypeScript is supported currently, but refactoring work has been done to make Python and Java
support more straightforward.

Note the new Java project in `internal/smithy-async-transformer` - this allows us to perform a
transform on users' Smithy models to augment operations with additional traits required for OpenAPI
generation.
@cogwirrel cogwirrel force-pushed the feat/ts-websocket-api branch from 78e34d1 to 0ff7491 Compare March 27, 2024 11:00
@agdimech agdimech merged commit 9f34193 into mainline Mar 27, 2024
3 checks passed
@agdimech agdimech deleted the feat/ts-websocket-api branch March 27, 2024 23:26
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.

2 participants