jsii icon indicating copy to clipboard operation
jsii copied to clipboard

Support for Typescript 4.x

Open lschierer opened this issue 3 years ago • 7 comments

Describe the feature

I am told that the reason that AWS CDK depends on Typescript 3.9 is beacuse of jsii in #18743, I am now stuck in a situation where cdk cannot use typescript above 3.9 and tsc cannot use typescript below 4.2 (due to @types issue 60310). While that might get reverted eventually, it points to the long term unsustainable nature of requiring a version of a key library that is both an entire major version behind and 7 overall releases behind.

Use Case

Compatibility: I cannot run cdk after running npm up at all because @types/prettier automatically upgrades unless manually pinned (which I did not know to do), nor can I initialize a new cdk workspace with typescript because the install grabs the latest version of @types/prettier which won't work with the required version of typescript.

Proposed Solution

Upgrade the supported version of typescript.

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [X] This feature might incur a breaking change

CDK version used

2.28.1 (build d035432)

Environment details (OS name and version, etc.)

Ubuntu 20 LTS with node 16 from https://nodesource.com/, but also tested and verified on OSX 12.2 with node from homebrew

lschierer avatar Jun 16 '22 16:06 lschierer

There was an attempt with https://github.com/aws/jsii/pull/1940 but it never was merged due to potential breaking changes.

I really hope it would be done anyway at some time as this is making things tricky very often, and the situation won't improve

webratz avatar Jul 13 '22 14:07 webratz

There's a proposal out with https://github.com/aws/aws-cdk-rfcs/pull/373 to fix this, but I'm not sure what it's present status is.

RichiCoder1 avatar Jul 13 '22 15:07 RichiCoder1

@RichiCoder1 you're correct, this is the current plan. I've investigated doing a "bring your own typescript" with adapters but it turns out to be nearly impossible to do without creating a maintenance nightmare.

The RFC still stands as the best plan I have so far, and I would like to implement that sooner rather than later (but so far received very little traction/interest).

RomainMuller avatar Aug 02 '22 10:08 RomainMuller