Skip to content

Commit

Permalink
fix: pattern with wildcard and globstar can't match correctly when us…
Browse files Browse the repository at this point in the history
…ing `glob_match` (#6668)
  • Loading branch information
shulaoda authored Jul 16, 2024
1 parent fa0e344 commit 271f63b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/rspack_plugin_javascript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ anymap = { workspace = true }
async-trait = { workspace = true }
bitflags = { workspace = true }
dashmap = { workspace = true }
glob-match = "0.2.1"
fast-glob = "0.3.2"
indexmap = { workspace = true }
indoc = { workspace = true }
itertools = { workspace = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn glob_match_with_normalized_pattern(pattern: &str, string: &str) -> bool {
} else {
String::from("**/") + trim_start
};
glob_match::glob_match(&normalized_glob, string.trim_start_matches("./"))
fast_glob::glob_match_with_brace(&normalized_glob, string.trim_start_matches("./"))
}

pub struct SideEffectsFlagPluginVisitor<'a> {
Expand Down Expand Up @@ -936,5 +936,9 @@ mod test_side_effects {
vec!["./src/**/*.js", "./dirty.js"],
"./clean.js"
));
assert!(get_side_effects_from_package_json_helper(
vec!["./src/**/*/z.js"],
"./src/x/y/z.js"
));
}
}

2 comments on commit 271f63b

@rspack-bot
Copy link

Choose a reason for hiding this comment

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

📝 Benchmark detail: Open

Name Base (2024-07-16 8645c8d) Current Change
10000_development-mode + exec 2.25 s ± 17 ms 2.26 s ± 31 ms +0.68 %
10000_development-mode_hmr + exec 698 ms ± 4.7 ms 700 ms ± 7.7 ms +0.30 %
10000_production-mode + exec 2.8 s ± 34 ms 2.88 s ± 31 ms +2.88 %
arco-pro_development-mode + exec 1.88 s ± 72 ms 1.87 s ± 85 ms -0.63 %
arco-pro_development-mode_hmr + exec 434 ms ± 3.2 ms 435 ms ± 2.6 ms +0.17 %
arco-pro_production-mode + exec 3.44 s ± 90 ms 3.45 s ± 60 ms +0.23 %
threejs_development-mode_10x + exec 1.75 s ± 14 ms 1.77 s ± 34 ms +1.03 %
threejs_development-mode_10x_hmr + exec 860 ms ± 12 ms 880 ms ± 12 ms +2.29 %
threejs_production-mode_10x + exec 5.72 s ± 28 ms 5.76 s ± 38 ms +0.68 %

@rspack-bot
Copy link

Choose a reason for hiding this comment

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

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
_selftest ✅ success
nx ✅ success
rspress ✅ success
rsbuild ❌ failure
examples ✅ success

Please sign in to comment.