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

Handle dynamic import type references in TS types transformer #9573

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

devongovett
Copy link
Member

Fixes #8908

Sometimes TSC generates code like import('types').Foo to reference a type from another module inline, without hoisting an import statement. The TS types transformer didn't handle these at all, resulting in invalid output. Now we register these imports and replace them with a temporary identifier during the initial collect phase so they work just like regular import statements.

@mischnic mischnic merged commit aeaba41 into v2 Mar 11, 2024
14 of 16 checks passed
@mischnic mischnic deleted the fix-ts-import branch March 11, 2024 19:02
@bvaughn
Copy link

bvaughn commented Mar 11, 2024

👏🏼

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.

Generated TypeScript definitions file has broken import("")
3 participants