-
Notifications
You must be signed in to change notification settings - Fork 103
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
shorten internal serde fn names #730
Conversation
5a7e581
to
cfb716a
Compare
d2bc575
to
3bfd63d
Compare
Update: no longer shortening the symbol/shape name to prevent thrashing on the function names. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this required and cannot be achieved by properly configuring bundling and minifying with esbuild/webpack?
This is not required, but it benefits users who use the generated clients as they are without minifying. One example is the AWS Lambda provided AWS SDK for JavaScript v3 that users do not bundle into their AWS Lambda applications. |
Can you update the description to show the current state of what this generates? I'd like these names to be stable cross model updates too, which I think you already added. Is it now |
Why does the AWS Lambda provided AWS SDK for JavaScript v3 cannot be minified? |
Yes, the PR currently is only a change to
The AWS Lambda provided AWS SDKs are supposedly for development/testing/convenience purposes, link and should retain readable stack traces without mangling and minification, but customers often prefer to continue to use them for production workloads. We can provide some benefit to those users without needing to change customer behavior. However, if you think the risk of this change is greater than the potential benefits, I'm fine with closing it. |
@@ -271,7 +292,8 @@ static String getSerdeFunctionSymbolComponent(Symbol symbol, Shape shape) { | |||
* @param operation the operation shape to retrieve errors for | |||
* @return map of error names to {@link ShapeId} | |||
*/ | |||
default Map<String, ShapeId> getOperationErrors(GenerationContext context, OperationShape operation) { | |||
default Map<String, ShapeId> getOperationErrors(GenerationContext context, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit - we wrap at 120
Can all the auto-formatting be undone on this? It's hard to read the actual changes and this will be an unnecessarily noisy commit. |
3bfd63d
to
9b9a01d
Compare
9b9a01d
to
ebbe397
Compare
be3972a
to
6a61a9e
Compare
Shorten generated serde function names. Source code contains a comment with the original long name, distribution uses shorter names.
The premise is that serde function names do not need to contain the protocol -- it's repetitive when the protocol file containing the functions is named after the protocol already.
JSv3 codegen paired PR aws/aws-sdk-js-v3#4611
Benefits:
reduced code size
Potential Downsides:
Example