rspack
rspack copied to clipboard
perf(rspack_core): replace `HASH_PLACEHOLDER_REGEX` with simple string parsing
Summary
Related to https://github.com/rolldown/rolldown/pull/1496 and https://github.com/oxc-project/oxc/issues/5586
I'm not sure if the hash pattern appears only once. If there are cases where the pattern appears multiple times, such as [hash]-[hash:6].js, I need to optimize further.
Checklist
- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).
Deploy Preview for rspack canceled.
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | a06f078ee77c66f45eeb4a6ac35ee7b57e94eca8 |
| Latest deploy log | https://app.netlify.com/sites/rspack/deploys/670640b86100ef0008c9cd22 |
@shulaoda can you resolve the conflicts? ❤️
Wasn't the issue in the description had been resolved? I think this is necessary.
I'm not sure if the hash pattern appears only once. If there are cases where the pattern appears multiple times, such as [hash]-[hash:6].js, I need to optimize further.
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()));
Wasn't the issue in the description had been resolved? I think this is necessary.
Sorry. This is a PR from a long time ago, and I fixed the issues in the description later. I have revised the description.