Skip to content

Conversation

clydin
Copy link
Member

@clydin clydin commented Jan 14, 2025

If both the isolatedModules and emitDecoratorMetadata Typescript options are enabled within a project, a warning will now be issued explaining that not all metadata may be emitting for each decorator. Isolated modules may not have access to non-local type information that would otherwise be needed for complete metadata emit.

The emitDecoratorMetadata option is not required by Angular and can cause runtime errors due to its underlying implementation when used with ES2015+ output. The option is only compatible with the experimental decorators and cannot be used with standard decorators. New Angular projects also do not enable this option. Removing the emitDecoratorMetadata option will remove the warning. The majority of projects do not require the option and it may cease to function as standard decorators become more common.

Closes #28155

…DecoratorMetadata`

If both the `isolatedModules` and `emitDecoratorMetadata` Typescript
options are enabled within a project, a warning will now be issued
explaining that not all metadata may be emitting for each decorator.
Isolated modules may not have access to non-local type information
that would otherwise be needed for complete metadata emit.

The `emitDecoratorMetadata` option is not required by Angular and can cause
runtime errors due to its underlying implementation when used with
ES2015+ output. The option is only compatible with the experimental
decorators and cannot be used with standard decorators. New Angular
projects also do not enable this option.
@clydin clydin added the target: rc This PR is targeted for the next release-candidate label Jan 14, 2025
@clydin clydin requested a review from alan-agius4 January 14, 2025 01:15
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jan 14, 2025
@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 Jan 14, 2025
@clydin clydin merged commit 61e8185 into angular:main Jan 14, 2025
34 checks passed
@clydin
Copy link
Member Author

clydin commented Jan 14, 2025

The changes were merged into the following branches: main, 19.1.x

@clydin clydin deleted the application/isolated-decorator-metadata branch January 14, 2025 15:38
@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 Feb 14, 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: @angular/build target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decorator metadata missing in production build

2 participants