aws-beam / aws-codegen

Code generator for AWS clients in Erlang and Elixir.
Other
53 stars 49 forks source link

Generate types and type specs for all generated functions in aws-elixir and aws-erlang #108

Closed onno-vos-dev closed 6 months ago

onno-vos-dev commented 6 months ago

Triggering the build and for now this should be considered a DRAFT and a Request For Feedback. The code is a mess and needs some cleaning up and combing over but opening it up in order to get feedback from others.

Generated aws-elixir code as an example: comparison Generated aws-erlang code as an example: comparison

aronisstav commented 6 months ago

Solicited opinion: the output comparison of an erlang module looks good enough to me.

I think that it will likely be unreasonably hard to code anything that can "prettify" the "flat", "expanded" generated types, and the point should be more "easier doc generation" than the code itself being small... I didn't check, and I am still not using aws-erlang but perhaps one can offer a minified version of the library without types in that case.

Good job! 😄

onno-vos-dev commented 6 months ago

Solicited opinion: the output comparison of an erlang module looks good enough to me.

I think that it will likely be unreasonably hard to code anything that can "prettify" the "flat", "expanded" generated types, and the point should be more "easier doc generation" than the code itself being small... I didn't check, and I am still not using aws-erlang but perhaps one can offer a minified version of the library without types in that case.

Good job! 😄

I tried to generate the edocs (using rebar3 ex_doc) for the generated types but apparently edoc explodes trying to parse the binaries <<"BinaryThingy">> as if it's an XML-tag so I gotta figure out how to deal with that 👍 But then yes, the idea would be to have good docs on the types and hence aid developers in having more information on what's expected as input into the APIs 👍

Thank you for the comment 🙇‍♂️

onno-vos-dev commented 6 months ago

Updated generated code examples that are in the description.

Main changes pushed are:

Reception from colleagues, @LostKobrakai and @philss have been good 👍 I haven't seen anyone yelling "NOOOOO!" on Elixir/Erlang Slack so I'll polish this up over the coming days so we can get this into a mergeable shape 👍 I'm quite happy with how the output looks, just need to polish up some of the cr*ppy code I wrote in this branch 😄

Screenshot 2024-03-13 at 20 58 20

onno-vos-dev commented 6 months ago
onno-vos-dev commented 6 months ago

Declined in favor of #109 due to wrong branch naming.