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

(aws-lambda-nodejs): support charset option #16668

Closed
1 of 2 tasks
intptr-t opened this issue Sep 27, 2021 · 1 comment · Fixed by #16726
Closed
1 of 2 tasks

(aws-lambda-nodejs): support charset option #16668

intptr-t opened this issue Sep 27, 2021 · 1 comment · Fixed by #16726
Assignees
Labels
@aws-cdk/aws-lambda-nodejs feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@intptr-t
Copy link

Use Case

If we deploy a Lambda function that currently contains multibyte characters, the escaped characters will be output.

I am currently facing the same problem that the official documentation is talking about when using CDK.
esbuild API document says

using escape sequences makes the generated output slightly bigger, and also makes it harder to read.

Example

Input Lambda code

exports.handler = async (event) => { console.log("Japanese:日本語"); }
Current output code
exports.handler = async (event) => {
  console.log("Japanese:\u65E5\u672C\u8A9E");
};
Expected output code
exports.handler = async (event) => {
  console.log("Japanese:日本語");
};

Proposed Solution

Add the charset option to the bundling.

new NodejsFunction(this, 'ExampleLambda', {
  bundling: {
    charset: 'utf-8',
  },
  ...
});

Other

Possible response methods

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@intptr-t intptr-t added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Sep 27, 2021
jogold added a commit to jogold/aws-cdk that referenced this issue Sep 30, 2021
@mergify mergify bot closed this as completed in #16726 Oct 29, 2021
mergify bot pushed a commit that referenced this issue Oct 29, 2021
Support `esbuild` charset option.

Closes #16668


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this issue Feb 21, 2022
Support `esbuild` charset option.

Closes aws#16668


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-lambda-nodejs feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants