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

ECMAScript Decorators do not work with ng-packagr #2625

Closed
Juulsgaard opened this issue May 17, 2023 · 1 comment · Fixed by #2626
Closed

ECMAScript Decorators do not work with ng-packagr #2625

Juulsgaard opened this issue May 17, 2023 · 1 comment · Fixed by #2626

Comments

@Juulsgaard
Copy link

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

I am unable to disable experimentalDecorators, and thus am not able to use ECMAScript Decorators in my libraries.
When trying to use an ECMAScript decorator an error is thrown on build. This error does not occur when building with TSC.
It seems like the setting experimentalDecorators is being overwritten by ng-packagr, thus functionally prohibiting the use of ECMAScript decorators in Angular libraries.

How To Reproduce

Create a library in an Angular project.

Change the tsconfig.lib.json to disable experimentalDecorators

Utilise an ECMAScript only decorator in the library

Build library using ng build

This fails compilation with an error indicating that the decorator is an invalid format.

Expected Behaviour

ng-packagr should respect the experimentalDecorators setting in tsconfig and allow ECMAScript decorators.

Version Information

$ node_modules/.bin/ng-packagr --version
ng-packagr:            16.0.1
@angular/compiler:     16.0.1
rollup:                3.21.5
typescript:            5.0.4
@angular/*: 16.0.1
node: v16.18.0
yarn: 1.22.19
alan-agius4 added a commit to alan-agius4/ng-packagr that referenced this issue May 19, 2023
Remove hardcoded `experimentalDecorators` option.

Closes ng-packagr#2625
alan-agius4 added a commit that referenced this issue May 19, 2023
Remove hardcoded `experimentalDecorators` option.

Closes #2625
@github-actions
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.

This action has been performed automatically by a bot.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant