Skip to content

refactor: RuntimeType creation and member resolution #2066

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 10 commits into from
Dec 9, 2022

Conversation

Velfi
Copy link
Contributor

@Velfi Velfi commented Dec 6, 2022

Apologies for the large PR

Motivation and Context

Maintainability and ease of use

Description

The short version:

  • refactor: RuntimeType creation and member resolution
  • refactor: RuntimeType companion functions
  • add: AwsCargoDependency package
  • refactor: move aws runtime crate funs into AwsRuntimeType
  • update: all code affected by the above changes

The long version:
This PR implements the another part of #1933.

  • runtimeCrate has been renamed to smithyRuntimeCrate and now requires users to pass the "smithy-" prefix as part of the crate name:
    before: val smithyHttp = runtimeCrate("http").asType()
    after: val smithyHttp = smithyRuntimeCrate("smithy-http").asType()
  • awsRuntimeDependency has been renamed to awsRuntimeCrate in order to match smithyRuntimeCrate.
  • Functions returning RuntimeTypes have all been consolidated into static methods and fields in the RuntimeType companion object . AWS-specific RuntimeType functions have been centralized in software.amazon.smithy.rustsdk.AwsRuntimeType.
  • If you want to access a Cargo dependency, use one of the companion methods/fields on CargoDependency and AwsCargoDependency. The awsRuntimeCrate/smithyRuntimeCrate functions still exist but you should avoid using them.

Testing

Ran existing tests


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

Zelda Hessler added 2 commits December 6, 2022 15:47
refactor: RuntimeType companion functions
add: AwsCargoDependency object
refactor: move aws runtime crate fns into AwsRuntimeType
update: all code affected by the above changes
rename: runtimeCrate to smithyRuntimeCrate
remove: smithy prefix from RuntimeType
@Velfi Velfi requested review from a team as code owners December 6, 2022 22:19
update: RuntimeType import
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

github-actions bot commented Dec 7, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link
Contributor

@ysaito1001 ysaito1001 left a comment

Choose a reason for hiding this comment

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

Thanks for making extensive changes. I like how the new codebase is more consistent & readable.

fix: outdated doc comment
@github-actions
Copy link

github-actions bot commented Dec 8, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link
Contributor

@crisidev crisidev left a comment

Choose a reason for hiding this comment

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

LGTM.

@github-actions
Copy link

github-actions bot commented Dec 9, 2022

A new generated diff is ready to view.

A new doc preview is ready to view.

@Velfi Velfi enabled auto-merge (squash) December 9, 2022 17:16
@Velfi Velfi merged commit a15ce73 into main Dec 9, 2022
@Velfi Velfi deleted the refactor/RuntimeType-and-AwsRuntimeType branch December 9, 2022 17:33
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