Skip to content

Merge ssdk into main #315

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

Merged
merged 93 commits into from
Apr 29, 2021
Merged

Conversation

JordonPhillips
Copy link
Contributor

This takes the contents of the ssdk branch and updates it with main so that we can merge all the ssdk changes into main.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

JordonPhillips and others added 30 commits February 24, 2021 14:47
This adds the ability to disable generating clients. This is useful if
the customer only wants to generate types for shapes, and will enable
generating a server only.
This adds methods to the ProtocolGenerator interface to enable
generating serializers for responses and deserializers for requests.
Making these separate methods allows the CodegenVisitor to
make sure everything that needs to get called gets called.
This adds support for error serialization. A new interface was needed
to write error headers specifically. This also fixes an issue where
the response serializers were looking at the wrong http bindings.
HttpRequest implements Endpoint, it does not contain one as a member.
I don't think response serialization will need to know about the endpoint, but
I'm keeping the serializer context around in case it is useful in the future.
These might not actually work as-is, this will need to be verified. In
the meantime it at leasts unblocks generation.
The serde functions were not being exported, and their names were aggressively
protocol-specific. This re-exports the protocol-specific serde module under
its own name, so that the functions themselves do not have to have the protocol
name.
This adds an empty enpoint to response serialization. It should never
be used, hopefully. It may be better to replace this with as assertions
later on.
adamthom-amzn and others added 11 commits April 6, 2021 09:06
* Make the order for framework errors stable

* Generate convenience types for operation errors

It's distinctly unpleasant to throw a constructed object that has to include
matching values of name, $fault, etc to an interface. This generates
convenience classes for services that allow errors to be thrown in a more
user-friendly fashion.
This lets service developers choose between a single lambda function per
operation, or one lambda function that handles all operations, depending on
their preferences.
This adds the typescript libraries needed to support the SSDK as well
as the library that provides apigateway support.
This updates the node dependencies for the ssdk libs to node 14, which
is the most recent version supported by Lambda.
Copy link
Contributor

@adamthom-amzn adamthom-amzn left a comment

Choose a reason for hiding this comment

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

You gonna squash some/all of these?

@JordonPhillips
Copy link
Contributor Author

Was not planning to squash, but I suppose we could. I'm 0 on it so vote here with reactions

This makes it much friendlier with IDEs, both in terms of finding jest symbols
and running tests from within the IDE. tsconfig.cjs.json is not what a
TypeScript language service looks for by default, and we aren't bailed out by
its presence in a parent workspace since these are standalone libraries.
Copy link
Contributor

@AllanZhengYP AllanZhengYP left a comment

Choose a reason for hiding this comment

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

TypeScript part looks good to me, just have a view feedbacks/questions

Comment on lines +184 to +186
if (settings.generateClient()) {
// For now these are only generated for clients.
// TODO: generate ssdk config
Copy link
Contributor

Choose a reason for hiding this comment

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

Since client and server SDK's plugins are divergent, why not adding a flag like isServerSdkIntegration into the TypeScriptIntegration interface or extend to a new interface like TypeScriptServerIntegration? Then 2 different codegen plugins can be applied separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Something like that would be a great idea. I've got a PR that splits client/server up further where we could add something like that: #314

@JordonPhillips JordonPhillips merged commit a9fd0ef into smithy-lang:main Apr 29, 2021
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.

4 participants