Skip to content

Conversation

@mrgrain
Copy link
Contributor

@mrgrain mrgrain commented Dec 5, 2025

Consolidates multiple selective imports from the same module source into a single import statement, reducing redundancy in generated TypeScript code.

The TypeScript renderer now:

  • Groups selective imports by source module
  • Merges all imported names from the same source
  • Sorts imports alphabetically by name
  • Preserves aliased imports correctly
  • Keeps aliased module imports (import * as) separate from selective imports

This improves code generation quality by eliminating duplicate import statements when multiple parts of the code import different symbols from the same module.

@aws-cdk-automation aws-cdk-automation merged commit 3269e29 into mrgrain/feat/typewriter/aliased-selective-imports Dec 5, 2025
6 checks passed
@aws-cdk-automation aws-cdk-automation deleted the mrgrain/feat/typewriter-deduplicate-imports branch December 5, 2025 01:02
@mrgrain mrgrain restored the mrgrain/feat/typewriter-deduplicate-imports branch December 5, 2025 01:03
@mrgrain mrgrain changed the title feat(typewriter): deduplicate imports feat(typewriter): deduplicate selective imports from same source Dec 5, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

@aws-cdk/aws-service-spec: No model change detected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants