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

Expose core as an export #21563

Closed
wants to merge 1 commit into from
Closed

Expose core as an export #21563

wants to merge 1 commit into from

Conversation

thdxr
Copy link
Contributor

@thdxr thdxr commented Aug 11, 2022

Currently if you use anything from aws-cdk-lib it causes node to travese this entire package and evaluate every single file which is noticibly slow.

Exposing core will alleviate this for situations where you're just importing things like App or Duration

Currently if you use anything from `aws-cdk-lib` it causes node to travese this entire package and evaluate every single file which is notiicbly slow.

Exposing core will alleviate this for situations where you're just importing things like `App` or `Duration`
@gitpod-io
Copy link

gitpod-io bot commented Aug 11, 2022

@aws-cdk-automation aws-cdk-automation requested a review from a team August 11, 2022 20:34
@github-actions github-actions bot added the p2 label Aug 11, 2022
@TheRealAmazonKendra
Copy link
Contributor

Can you clarify what you mean by "use anything from aws-cdk-lib?"

@thdxr
Copy link
Contributor Author

thdxr commented Aug 11, 2022

If I do import { Duration } from "aws-cdk-lib" that will hit the index file which essentially links to every other file provided by aws-cdk whether you're using it or not.

This causes two issues:

  1. Slow to load - I'm seeing 2+ seconds before node can even run user code. This fixes cuts that to 25-30% (more fixes to be done)

  2. If you bundle code that includes this the bundle is much larger than it needs to be

Doing import { Duration } from "aws-cdk-lib/core" makes this less of an issue

@mrgrain
Copy link
Contributor

mrgrain commented Aug 11, 2022

Duplicate of #17986

@mrgrain mrgrain marked this as a duplicate of #17986 Aug 11, 2022
@thdxr
Copy link
Contributor Author

thdxr commented Aug 11, 2022

Duplicate of #17986

Thanks for pointing that out - I should have searched first

@mrgrain
Copy link
Contributor

mrgrain commented Aug 11, 2022

Duplicate of #17986

Thanks for pointing that out - I should have searched first

No worries. 😃 It's easy if you know that this has popped up before. There might be more than just this one tbh.

Either way, the issue is important to this discussion. I don't see has having moved away from that position.

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: ea3e2ea
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@TheRealAmazonKendra
Copy link
Contributor

Given that we won't be accepting this change at this time, I'm going to go ahead and close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants