-
Notifications
You must be signed in to change notification settings - Fork 4k
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
chore: update TS and JS init templates to consistently use ES6 imports #7356
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This actually broke the JS init templates since Node still doesn't actually support ES6 imports. I experimented with using the So I'm going to revert most of this PR. Unfortunately, these changes made it into a release. |
@jerry-aws - yes I can confirm we have a regression with JS templates. What's the Jest issue? I'm able to init and run my templates fine in TS |
@shivlaks Looks like the Jest issue doesn't affect TS as I thought; the tests are Still, no loss to revert the whole PR. |
This was a result of switching the templates to use ES6 style imports in #7356, which Node does not support yet and not with our minimum of `10.12.0`.
This was a result of switching the templates to use ES6 style imports in #7356, which Node does not support yet and not with our minimum of `10.12.0`.
Commit Message
chore: update TS and JS init templates to consistently use ES6 imports
End Commit Message
I've recently updated the TypeScript code snippets in the AWS CDK Developer Guide to use ES6-style imports so they can be auto-translated to JavaScript using Babel. (Babel won't translate the older style require() imports.)
Since the Guide snippets are (at least in theory) what users would see when working in a project they created using 'cdk init' and a template, let's update the templates to use ES6 imports.
There are a fair number of old-style imports in the various READMEs as well; I'll update those in a separate PR.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license