Skip to content

chore: name the two kinds of kept base in _processBaseInterfaces - #3403

Open
momo-bee wants to merge 1 commit into
aws:preview/v7.1from
momo-bee:simplify-collect-heritage
Open

momo-bee wants to merge 1 commit into
aws:preview/v7.1from
momo-bee:simplify-collect-heritage

Conversation

@momo-bee

@momo-bee momo-bee commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

The process walk in _processBaseInterfaces had a cyclomatic complexity of 25. For each base type it worked out inline whether the base was a jsii type, a named type that is not a jsii type, or something to erase.

The first two questions are now methods: _jsiiBaseFqn (a type of this assembly, or one of a dependency, checked as a peer) and _foreignBaseFqn (a named type, or JSII3005). A small addInterface replaces the two copies of the 'add once' code. The walk itself, and the erasing, stay as they were. Its complexity is now 18.

  • Full jest passes on Node 26 with coverage (functions 96.77%).
  • jsii-calc and aws-cdk-lib (plain, --add-deprecation-warnings, --strip-deprecated) are byte-identical.
  • aws-cdk-lib, 4 paired runs: median 52.41s -> 51.72s (gaps +0.96, -1.89, -0.74, -0.61s), the same within noise.

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.

1 participant