perf(rspack_core): replace HASH_PLACEHOLDER_REGEX with simple string parsing#7907
Merged
h-a-n-a merged 7 commits intoweb-infra-dev:mainfrom Oct 14, 2024
Conversation
✅ Deploy Preview for rspack canceled.Built without sensitive environment variables
|
Member
|
@shulaoda can you resolve the conflicts? ❤️ |
f5a5e21 to
a429391
Compare
5bd31c7 to
a06f078
Compare
Contributor
|
Wasn't the issue in the description had been resolved? I think this is necessary.
let result = replace_all_hash_pattern("hello-[hash]-[hash:5].js", "[hash]", |n| {
&"abcdefgh"[..n.unwrap_or(8)]
});
assert_eq!(result, Some("hello-abcdefgh-abcde.js".to_string())); |
Contributor
Author
Sorry. This is a PR from a long time ago, and I fixed the issues in the description later. I have revised the description. |
h-a-n-a
approved these changes
Oct 14, 2024
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Related to rolldown/rolldown#1496
I plan to convert all the regular expressions into string lookup, because these regular expressions are very simple and do not require regex.
rspack/crates/rspack_core/src/options/filename.rs
Lines 19 to 38 in a06f078
Checklist