Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Oct 26, 2023

The esModuleInterop TypeScript option is a TypeScript recommended option that ensures that TypeScript emits compliant ESM code when transforming namespace and default imports. This is important for new projects because they now use the application builder which emits full ESM code. Not using this option with certain third-party packages can result in build warnings and the potential for runtime failure. For existing applications that are considering migrating, information pertaining to this situation will be available within the documentation.

Since the allowSyntheticDefaultImports is implied and automatically enabled when esModuleInterop is enabled, the previous option has been replaced with this one.

Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop

@clydin clydin force-pushed the esbuild/update-tsconfig-defaults branch from c398a7d to ec454d4 Compare October 26, 2023 16:25
@clydin clydin changed the title fix(@angular-devkit/build-angular): enable TypeScript esModuleInterop by default for ESM compliance fix(@schematics/angular): enable TypeScript esModuleInterop by default for ESM compliance Oct 26, 2023
@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Oct 26, 2023
@clydin clydin requested a review from alan-agius4 October 26, 2023 16:41
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 26, 2023
…ult for ESM compliance

The `esModuleInterop` TypeScript option is a TypeScript recommended option that ensures that TypeScript
emits compliant ESM code when transforming namespace and default imports. This is important for new projects
because they now use the `application` builder which emits full ESM code. Not using this option with certain
third-party packages (e.g., `moment`) can result in build warnings and the potential for runtime failure. For existing
applications that are considering migrating, information pertaining to this situation will be available within
the documentation.

Since the `allowSyntheticDefaultImports` is implied and automatically enabled when `esModuleInterop` is enabled,
the previous option has been replaced with this one.

Reference: https://www.typescriptlang.org/tsconfig#esModuleInterop
@clydin clydin force-pushed the esbuild/update-tsconfig-defaults branch from ec454d4 to 2c5503d Compare October 26, 2023 17:00
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 26, 2023
@dgp1130 dgp1130 merged commit 00872ea into angular:main Oct 27, 2023
@clydin clydin deleted the esbuild/update-tsconfig-defaults branch October 27, 2023 16:31
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants