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

Fix capitalization of lambda.Runtime names #980

Closed
dstufft opened this issue Oct 22, 2018 · 3 comments · Fixed by #2815, #3023 or MechanicalRock/tech-radar#14 · May be fixed by MechanicalRock/cdk-constructs#5 or MechanicalRock/cdk-constructs#6
Closed
Labels
@aws-cdk/aws-lambda Related to AWS Lambda bug This issue is a bug.

Comments

@dstufft
Copy link
Contributor

dstufft commented Oct 22, 2018

It is expected that names are going to be mangled to idiomatic names when the CDK is generated for different target languages. However, not all of the names are currently accurate in their source naming.

The one I just ran into, is @aws-cdk/aws-lambda.Runtime.NodeJS*. Because it's written as NodeJS* instead of NodeJs*, it's conceptually 3 words, Node, J, S, which gets mangled to node_j_s* when targeting Python (which uses snake casing).

We should probably fix these existing names so that they are consistent.

This is likely not going to be the last time something like this happens, so we probably want to come up with a strategy for handling these cases that doesn't break end user code, but allows us to fix these names.

@rix0rrr
Copy link
Contributor

rix0rrr commented Oct 22, 2018

Seems useful to put a single name parser into jsii-pacmak so it can be shared by all codegens.

By the way, I'm not even sure I like node_js as a snake case. Should we just degenerate to naming hints?

@dstufft
Copy link
Contributor Author

dstufft commented Oct 26, 2018

Well CodeMaker has a name mangler built into it, and that's what I'm using here. We could add naming hints as an optional thing where if a name gets a naming hint set to it, it overrides the default mangling.

@eladb eladb added bug This issue is a bug. @aws-cdk/aws-lambda Related to AWS Lambda labels Dec 17, 2018
@eladb eladb changed the title Not all names are "well formed" Fix capitalization of Lambda's runtime static properties Mar 4, 2019
@eladb eladb changed the title Fix capitalization of Lambda's runtime static properties Fix capitalization of lambda.Runtime names Mar 4, 2019
@eladb eladb self-assigned this Apr 2, 2019
@eladb
Copy link
Contributor

eladb commented Apr 10, 2019

Blocked on the decision of #2222

@eladb eladb removed their assignment May 5, 2019
@shivlaks shivlaks self-assigned this May 31, 2019
shivlaks added a commit that referenced this issue Jun 12, 2019
…to Nodejs (#2815)

Addresses the consistency of casing for runtime for other target languages.
in Python, this was previously `NODE_J_S` and now it will be `NODEJS`

**Fixes #980**

BREAKING CHANGE:
* **lambda:** `lambda.Runtime.NodeJS*` are now `lambda.Runtime.Nodejs*`
ScOut3R pushed a commit to ScOut3R/aws-cdk that referenced this issue Jun 13, 2019
…to Nodejs (aws#2815)

Addresses the consistency of casing for runtime for other target languages.
in Python, this was previously `NODE_J_S` and now it will be `NODEJS`

**Fixes aws#980**

BREAKING CHANGE:
* **lambda:** `lambda.Runtime.NodeJS*` are now `lambda.Runtime.Nodejs*`
eladb pushed a commit that referenced this issue Jun 24, 2019
Similar to the enum naming convention, public static readonly properties
must be ALL_CAPS.

This is in accordance with the new construct library guidelines and with normal enums.

Fixes #3018
Fixes #980

BREAKING CHANGE: all public static readonly members (enum-like) have been renamed to use "ALL_CAPS" capitalization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment