Skip to content

refactor(common): trim undefined from locale data.#63520

Closed
JeanMeche wants to merge 1 commit intoangular:mainfrom
JeanMeche:cldr-trim-undef
Closed

refactor(common): trim undefined from locale data.#63520
JeanMeche wants to merge 1 commit intoangular:mainfrom
JeanMeche:cldr-trim-undef

Conversation

@JeanMeche
Copy link
Copy Markdown
Member

@JeanMeche JeanMeche commented Sep 1, 2025

This is an optimization to shave off unecessary data.

fixes #42315

@angular-robot angular-robot bot added the area: common Issues related to APIs in the @angular/common package label Sep 1, 2025
@JeanMeche JeanMeche requested a review from devversion September 1, 2025 01:59
@ngbot ngbot bot added this to the Backlog milestone Sep 1, 2025
@JeanMeche
Copy link
Copy Markdown
Member Author

@devversion I found this issue of your and went with it.
I'm just wondering if the out of bound access might have a negative impact on performance.

@JeanMeche JeanMeche force-pushed the cldr-trim-undef branch 3 times, most recently from 6a79916 to a445cfe Compare September 1, 2025 11:13
@JeanMeche JeanMeche marked this pull request as ready for review September 14, 2025 22:09
@pullapprove pullapprove bot removed the request for review from devversion September 14, 2025 22:09
Copy link
Copy Markdown
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you verify that functions relying on this data are "good"? do we have tests?

* e.g.: [x, y, undefined, z, undefined, undefined] will be [x, y, u, z, u, u]
*
* In some cases, we also trim the trailing `undefined` values in the array, as they
* don't add any information. We don't always want to do it as sometimes returned array is destructued.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* don't add any information. We don't always want to do it as sometimes returned array is destructued.
* don't add any information. We don't always want to do it as sometimes returned array is destructured.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some visual checks by diffing the files and also we have some tests in packages/common/test/i18n that load the locale data (and test the localized outputs)

This is an optimization to shave of unecessary data.

fixes angular#42315
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Sep 17, 2025
thePunderWoman pushed a commit that referenced this pull request Sep 17, 2025
This is an optimization to shave of unecessary data.

fixes #42315

PR Close #63520
@thePunderWoman
Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

wildcardalice pushed a commit to wildcardalice/angular that referenced this pull request Sep 18, 2025
This is an optimization to shave of unecessary data.

fixes angular#42315

PR Close angular#63520
@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Oct 18, 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: common Issues related to APIs in the @angular/common package target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explore potential CLDR locale data byte savings by omitting trailing undefined values

3 participants