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

Add client codegen guide to docs #1586

Merged

Conversation

milesziemer
Copy link
Contributor

A section under 'Guides' was added to the docs, 'Generating code'. It covers updating the model from the Quick start guide to enable codegen, adding the client codegen plugin, and using the generated client. The example uses the TypeScript code generator.

A hyperlink target was also added to the implementations doc for the 'Client code generators' section to make it easier to refer to in the new guide.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@milesziemer milesziemer requested a review from a team as a code owner January 23, 2023 14:15
@mtdowling
Copy link
Member

I just started a guide on creating a code generator. Given it'll also be a new section, and I called my section "codegen", I'm wondering if this section could be something like, "using-codegen"?

mavenCentral()
}
dependencies {
classpath("software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.12.0")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to template the smithy-aws-typescript-codegen version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea this is a minor rough edge. We can absolutely template it, same way we template the smithy version, which has value in and of itself just for reducing duplication. Some time down the road we will have to figure out how we can keep the version in sync with the actual most recent version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Additionally, if we have a directory containing the complete examples, we will want the templated version to be the same in that directory as well. I think we could use Gradle in some way to do that.

@milesziemer
Copy link
Contributor Author

milesziemer commented Jan 26, 2023

I just started a guide on creating a code generator. Given it'll also be a new section, and I called my section "codegen", I'm wondering if this section could be something like, "using-codegen"?

@mtdowling This should only matter for clarity when developing the docs, and in the URLs right? Its a little verbose, but I feel like "creating-a-code-generator" would be a more descriptive name for a guide on creating a code generator. For me, "using-codegen" vs "generating-code" isn't a big semantic difference so I can change it if you are intent on keeping your's as just "codegen"

@milesziemer milesziemer force-pushed the add-client-codegen-example branch 2 times, most recently from 919dba0 to 29ad843 Compare January 26, 2023 14:52
@milesziemer milesziemer force-pushed the add-client-codegen-example branch from 29ad843 to b429893 Compare January 26, 2023 17:40
Comment on lines 494 to 495
5. Follow the :ref:`Code Generation Guide <generating-code>` to generate
code for the ``Weather`` service.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
5. Follow the :ref:`Code Generation Guide <generating-code>` to generate
code for the ``Weather`` service.
5. Follow the :ref:`Code Generation Guide <generating-code>` to generate
client code for the ``Weather`` service.

@mtdowling
Copy link
Member

This should only matter for clarity when developing the docs, and in the URLs right? Its a little verbose, but I feel like "creating-a-code-generator" would be a more descriptive name for a guide on creating a code generator. For me, "using-codegen" vs "generating-code" isn't a big semantic difference so I can change it if you are intent on keeping your's as just "codegen"

I'll change the location of the docs I'm adding to something more specific. I think generating-code could be ambiguously interpreted as teaching someone how to write a generator rather than how to use a generator. I don't feel strongly about it though.

@milesziemer
Copy link
Contributor Author

This should only matter for clarity when developing the docs, and in the URLs right? Its a little verbose, but I feel like "creating-a-code-generator" would be a more descriptive name for a guide on creating a code generator. For me, "using-codegen" vs "generating-code" isn't a big semantic difference so I can change it if you are intent on keeping your's as just "codegen"

I'll change the location of the docs I'm adding to something more specific. I think generating-code could be ambiguously interpreted as teaching someone how to write a generator rather than how to use a generator. I don't feel strongly about it though.

Ah I see what you mean, I agree using-codegen resolves that ambiguity.

A section under 'Guides' was added to the docs, 'Generating code'.
It covers updating the model from the Quick start guide to
enable codegen, adding the client codegen plugin, and using
the generated client. The example uses the TypeScript code
generator.

A hyperlink target was also added to the implementations doc
for the 'Client code generators' section to make it easier
to refer to in the new guide.
@milesziemer milesziemer force-pushed the add-client-codegen-example branch from b429893 to 6227848 Compare February 6, 2023 19:55
@milesziemer milesziemer merged commit 56263d6 into smithy-lang:main Feb 6, 2023
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