Skip to content

Fix CI#33639

Merged
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:allow-hyphens
Jul 23, 2026
Merged

Fix CI#33639
alan-agius4 merged 2 commits into
angular:mainfrom
alan-agius4:allow-hyphens

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

No description provided.

Updates the regular expressions in server-routes-preload-links.ts to allow hyphens in the generated file hashes (changing [a-zA-Z0-9_]{8} to [a-zA-Z0-9_-]{8}).

This ensures that the test correctly identifies modulepreload links when the hash contains a hyphen, preventing failures due to overly strict matching.
@alan-agius4
alan-agius4 requested a review from clydin July 23, 2026 08:26
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Jul 23, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the regular expression used to strip hashes from chunk names in chunk-optimizer.ts from /-[a-zA-Z0-9]{8}$/ to /-[\w-]{8}$/, along with updating the corresponding E2E tests. However, the feedback correctly points out that using [\w-] is highly prone to false positives because it matches hyphens and underscores. This could result in stripping descriptive parts of chunk names (e.g., changing home-lazy-mod to home), leading to potential naming collisions or loss of descriptive names in production. It is recommended to revert to the more restrictive alphanumeric pattern.

Comment thread packages/angular/build/src/builders/application/chunk-optimizer.ts Outdated
Comment thread packages/angular/build/src/builders/application/chunk-optimizer.ts Outdated
@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 Jul 23, 2026
@alan-agius4
alan-agius4 removed the request for review from clydin July 23, 2026 08:33
…hunk hash in chunk optimizer

Updates the regular expression in chunkFileNames from /-[a-zA-Z0-9]{8}$/ to /-[a-zA-Z0-9_-]{8}$/ to properly strip esbuild intermediate chunk hashes containing hyphens or underscores before applying Rolldown/Rollup chunk hashes.
@alan-agius4
alan-agius4 merged commit 0e3ca3d into angular:main Jul 23, 2026
15 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

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

@alan-agius4
alan-agius4 deleted the allow-hyphens branch July 23, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants