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

use aggregated client runtime generator #736

Merged
merged 5 commits into from Apr 19, 2023

Conversation

kuhe
Copy link
Contributor

@kuhe kuhe commented Apr 17, 2023

Requires aws/aws-sdk-js-v3#4639

Switch to using an aggregated client runtime generator instead of codegen.

before

import { ACommand } from ...
import { BCommand } from ...

export class Aggregated {
  public a() {}
  public b() {} // per command class
}

after

import { ACommand } from ...
import { BCommand } from ...

const commands = {
  ACommand,
  BCommand,
}

export interface Aggregated {
  a()
  b()
}

export class Aggregated implements Aggregated {
  constructor() {
    createAggregatedClient(commands, this);
  }
}

Overall change appears to be around -2% to -3% dist-cjs.

@kuhe kuhe marked this pull request as ready for review April 17, 2023 21:02
@kuhe kuhe requested review from a team as code owners April 17, 2023 21:02

writer.write("");

writer.addImport(aggregateClientName + "ClientConfig", null, "./src/" + aggregateClientName + "Client");
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way to avoid duplicating the logic for creating the client config and barebones client type names? Maybe String barebonesClientName = serviceSymbol.getName();. And I think serviceSymbol.getNamespace() might give you the "./src/" + aggregateClientName + "Client" part.


writer.write("");

writer.addImport(barebonesClientName + "Config", null, serviceSymbol.getNamespace());
Copy link
Contributor

Choose a reason for hiding this comment

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

@kuhe kuhe merged commit ffaf2fc into smithy-lang:main Apr 19, 2023
6 checks passed
@kuhe kuhe deleted the feat/aggregated-client branch April 19, 2023 14:35
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

3 participants