Skip to content

Modify synthetic default generation code for dual-mode module resolution#46156

Merged
weswigham merged 1 commit into
microsoft:mainfrom
weswigham:module-node-default-import-detection
Oct 1, 2021
Merged

Modify synthetic default generation code for dual-mode module resolution#46156
weswigham merged 1 commit into
microsoft:mainfrom
weswigham:module-node-default-import-detection

Conversation

@weswigham

Copy link
Copy Markdown
Member

module: node12 was relying on our existing esModuleInterop logic for determining if modules should have a synthetic default member equivalent to the module shape - this is correct for a cjs format import of another cjs file, however should be wholly disabled for esm/esm imports, and is overcomplicated for esm/cjs imports (which simply always have a synthetic default, no heuristics needed). In this PR, I add the missing logic to our synthetic default selection code to handle these new modal imports.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 1, 2021
@weswigham weswigham merged commit ccc1909 into microsoft:main Oct 1, 2021
@DanielRosenwasser

Copy link
Copy Markdown
Member

I'm going to skip the sync.

@typescript-bot cherry-pick this to release-4.5 and LKG

@typescript-bot

typescript-bot commented Oct 1, 2021

Copy link
Copy Markdown
Contributor

Heya @DanielRosenwasser, I've started to run the task to cherry-pick this into release-4.5 on this PR at 7e3a80a. You can monitor the build here.

@DanielRosenwasser

DanielRosenwasser commented Oct 1, 2021

Copy link
Copy Markdown
Member

Ah I just saw #46159. Maybe we'll do a full sync. 😭

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey @DanielRosenwasser, I've opened #46162 for you.

typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Oct 1, 2021
Component commits:
7e3a80a Modify synthetic default generation code for dual-mode module resolution
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants