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

fix(@angular-devkit/build-angular): set public class fields as properties #24849

Merged
merged 2 commits into from Mar 14, 2023

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Mar 13, 2023

Configure Babel to use setPublicClassFields: true. As when shipping Angular packages without "useDefineForClassFields": false will increase the bundle size of an ng-new app by ~2Kb when useDefineForClassFields is not false. due to the additional _defineProperty, which will be added on every class property.

See: https://babeljs.io/docs/babel-plugin-proposal-class-properties

@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Mar 13, 2023
…ties

Configure Babel to use `setPublicClassFields: true`. As when shipping Angular packages without `"useDefineForClassFields": false` will increase the bundle size of an ng-new app
by ~2Kb when `useDefineForClassFields`  is not false. due to the additional `_defineProperty`, which will be added on every class property.

See: https://babeljs.io/docs/babel-plugin-proposal-class-properties
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 13, 2023
@alan-agius4 alan-agius4 requested a review from clydin March 13, 2023 16:43
@alan-agius4 alan-agius4 marked this pull request as ready for review March 13, 2023 16:43
… properties

Co-authored-by: Charles <19598772+clydin@users.noreply.github.com>
@alan-agius4 alan-agius4 requested a review from clydin March 13, 2023 19:58
@alan-agius4 alan-agius4 added area: docs Related to the documentation merge: squash commits When the PR is merged, a squash and merge should be performed labels Mar 13, 2023
@clydin clydin removed the area: docs Related to the documentation label Mar 13, 2023
@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 13, 2023
@angular-robot angular-robot bot merged commit 04274af into angular:main Mar 14, 2023
8 checks passed
@alan-agius4 alan-agius4 deleted the babel-public-fields branch March 14, 2023 07: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 Apr 14, 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 merge: squash commits When the PR is merged, a squash and merge should be performed target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants