Skip to content

test: allow hyphens in hash for server routes preload links#33638

Closed
alan-agius4 wants to merge 2 commits into
angular:mainfrom
alan-agius4:test/allow-hyphens-in-preload-links-hash
Closed

test: allow hyphens in hash for server routes preload links#33638
alan-agius4 wants to merge 2 commits into
angular:mainfrom
alan-agius4:test/allow-hyphens-in-preload-links-hash

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Simplifies character class [a-zA-Z0-9_-] to [\w-] in server-routes-preload-links.ts and chunk-optimizer.ts for cleaner, more readable regular expressions.

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 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
@alan-agius4
alan-agius4 requested a review from clydin July 23, 2026 08:10

@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 expressions in the end-to-end tests to allow hyphens in the generated file hashes. The reviewer suggested simplifying the character class [a-zA-Z0-9_-] to [\w-] to make the regular expressions shorter and more readable.

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer 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.

1 participant