chore(aws-cdk-lib): minify aws-cdk-lib sources#18091
Conversation
This PR takes one step toward improving the load times for `aws-cdk-lib`. Post-build, `esbuild` is used to minify the source and move source maps to external files. In local testing, this changed the average time for loading `aws-cdk-lib` from ~1110ms to ~830ms (25% reduction), and the size of the locally-packed JS-only source from 53MB to 45MB. related #18036
|
During the development of my CDK apps, I often look into the source code to see how constructs are built internally. This will affect the UX of this as the js files will be unreadable. Any idea how to "fix" this? |
The source maps -- which include the original .ts source -- are being included and referenced from the minified source. What's your typical workflow for looking at the js files? Are you just manually browsing to them, or using an IDE? Maybe there's a way the source maps can be utilized instead within the same (or similar) workflow. |
I am using VSCode and click on the class name which leads to the |
Gotcha. At this point, I think we'd prefer the trade-off of minimal distributed footprint and speedier load times, at the cost of this specific workflow. I believe there are some extensions for VS Code which let you load and view source maps, although I haven't tried any of them personally. |
|
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 PR takes one step toward improving the load times for `aws-cdk-lib`. Post-build, `esbuild` is used to minify the source and move source maps to external files. In local testing, this changed the average time for loading `aws-cdk-lib` from ~1110ms to ~830ms (25% reduction), and the size of the locally-packed JS-only source from 53MB to 45MB. Changes went through full v2 pipeline run, passing all tests. Any other suggestions for additional verification welcome. related aws#18036 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
This PR takes one step toward improving the load times for
aws-cdk-lib. Post-build,esbuildis used to minify the source and movesource maps to external files. In local testing, this changed the average time
for loading
aws-cdk-libfrom ~1110ms to ~830ms (25% reduction), and the sizeof the locally-packed JS-only source from 53MB to 45MB.
Changes went through full v2 pipeline run, passing all tests. Any other suggestions
for additional verification welcome.
related #18036
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license