aws / jsii

jsii allows code in any language to naturally interact with JavaScript classes. It is the technology that enables the AWS Cloud Development Kit to deliver polyglot libraries from a single codebase!
https://aws.github.io/jsii
Apache License 2.0
2.65k stars 245 forks source link

(aws-quicksight): quicksight generated Python is really huge could it be smaller? #4066

Open jeffb4 opened 1 year ago

jeffb4 commented 1 year ago

Describe the feature

This isn't a bug, but the size of the quicksight Python code is very large and breaks in vscode's default python server

[Error - 10:24:44 PM] (36155) File length of "/home/vscode/.local/lib/python3.8/site-packages/aws_cdk/aws_quicksight/__init__.py" is 72024295 which exceeds the maximum supported file size of 52428800

I confirmed that yeah, that's a beefy boi

-rw-rw-r-- 1 vscode vscode 69M Apr 20 23:08 /home/vscode/.local/lib/python3.8/site-packages/aws_cdk/aws_quicksight/__init__.py

Use Case

I don't think the python language server would be able to by default show typing hints etc for that module, which would be great.

Proposed Solution

I understand the Python is generated with jsii from typescript sources - I don't know if the typescript source file is huge and could be shrunk down, or if the conversion is particularly inefficient.

Other Information

No response

Acknowledgements

CDK version used

aws-cdk-lib 2.73.0

Environment details (OS name and version, etc.)

Linux docker-desktop 5.15.49-linuxkit aws/aws-cdk#1 SMP Tue Sep 13 07:51:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

peterwoodworth commented 1 year ago

Thanks for reporting this @jeffb4,

This is going to be related to jsii, I'm going to transfer this issue to that repository, let's see what they say 🙂

mrgrain commented 1 year ago

This service has a very large TypeScript definition and we wouldn't really be able to reduce its size without removing functionality. Saying that, the jsii package is aggravating this issue to a much larger problem than it is in TS.

rix0rrr commented 1 year ago

I see it already. This file is ginormous because of the automatically generated code examples. The example for CfnAnalysis spans 30k lines (!).

rix0rrr commented 1 year ago

https://github.com/cdklabs/cdk-generate-synthetic-examples/pull/272

rix0rrr commented 1 year ago

Not sure this is going to help enough. The file is 900k lines, and the big examples are only 30k lines.