Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Aug 28, 2024

Newly generated projects will now use the preserve value for the module option within the TypeScript configuration for the workspace (tsconfig.json). This value was added in TypeScript 5.4 and is intended to model the behavior of modern bundlers such as used in the default application builder. This option value also has the advantage of automatically enabling esModuleInterop and setting moduleResolution to bundler which are the currently generated values for new projects. This allows explicit use of these options to be removed from the generated file. The resolveJsonModule option is also enabled with preserve which removes the need for developers to manually add it if JSON files are imported. JSON file imports are fully support including unused property treeshaking with named imports in the application builder.
Additional details on the option can be found here:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-4.html#support-for-require-calls-in---moduleresolution-bundler-and---module-preserve

@clydin clydin added the target: major This PR is targeted for the next major release label Aug 28, 2024
@clydin
Copy link
Member Author

clydin commented Aug 28, 2024

There appears to be a TypeScript issue related to preserve and importHelpers.
This change is blocked pending a resolution.
Ref: microsoft/TypeScript#59789

@clydin clydin force-pushed the schematics/use-tsconfig-module-preserve branch from 722e30f to ff0771e Compare August 29, 2024 23:26
@clydin clydin force-pushed the schematics/use-tsconfig-module-preserve branch from ff0771e to 094b1e9 Compare September 10, 2024 16:22
@clydin clydin force-pushed the schematics/use-tsconfig-module-preserve branch from 094b1e9 to 3b0dd49 Compare September 17, 2024 17:44
@clydin clydin force-pushed the schematics/use-tsconfig-module-preserve branch from 3b0dd49 to a7f5b6f Compare November 5, 2024 16:41
@clydin clydin force-pushed the schematics/use-tsconfig-module-preserve branch from a7f5b6f to 759dc15 Compare March 5, 2025 20:32
…new projects

Newly generated projects will now use the `preserve` value for the `module` option
within the TypeScript configuration for the workspace (`tsconfig.json`). This value
was added in TypeScript 5.4 and is intended to model the behavior of modern bundlers
such as used in the default `application` builder.
This option value also has the advantage of automatically enabling `esModuleInterop`
and setting `moduleResolution` to `bundler` which are the currently generated values
for new projects. This allows explicit use of these options to be removed from the generated
file. The `resolveJsonModule` option is also enabled with `preserve` which removes
the need for developers to manually add it if JSON files are imported. JSON file imports
are fully support including unused property treeshaking with named imports in the
`application` builder.
Additional details on the option can be found here:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-4.html#support-for-require-calls-in---moduleresolution-bundler-and---module-preserve
@clydin clydin force-pushed the schematics/use-tsconfig-module-preserve branch from 759dc15 to b91279d Compare March 6, 2025 16:27
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 6, 2025
@clydin clydin requested a review from alan-agius4 March 6, 2025 16:52
@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 Mar 6, 2025
@alan-agius4 alan-agius4 merged commit 03180fe into angular:main Mar 6, 2025
31 checks passed
@clydin clydin deleted the schematics/use-tsconfig-module-preserve branch March 6, 2025 16:55
@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 Apr 6, 2025
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 area: @schematics/angular detected: feature PR contains a feature commit target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants