angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.72k stars 11.98k forks source link

application builder: angular adds every locale data in i18n builds #26338

Open zip-fa opened 9 months ago

zip-fa commented 9 months ago

Command

build

Is this a regression?

The previous version in which this bug was not present was

No response

Description

Hi. In each localized build (lets say pl), every locale from angular.json is included in polyfills.js. Attaching screenshot from esbuild-analyzer:

image

Minimal Reproduction

ng build

Exception or Error

No response

Your Environment

Angular CLI: 17.0.0
Node: 18.18.2
Package Manager: npm 9.8.1
OS: darwin arm64

Angular: 17.0.2
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic
... platform-server, router, service-worker

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1700.0
@angular-devkit/build-angular   17.0.0
@angular-devkit/core            17.0.0
@angular-devkit/schematics      17.0.0
@angular/cdk                    17.0.0
@angular/cli                    17.0.0
@angular/material               17.0.0
@angular/ssr                    17.0.0
@schematics/angular             17.0.0
rxjs                            7.8.1
typescript                      5.2.2
zone.js                         0.14.0

Anything else relevant?

No response

clydin commented 9 months ago

This is currently expected behavior. While not ideal, each locale's data has a minimal size and will feature some additional upcoming size reductions. Additionally it typically compresses well. Also, we are evaluating the use of the standard Intl API as a replacement for these files which would eliminate their inclusion in the application bundles.

angular-robot[bot] commented 9 months ago

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

You can find more details about the feature request process in our documentation.

angular-robot[bot] commented 8 months ago

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

angular-robot[bot] commented 7 months ago

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.