Skip to content

Commit

Permalink
fix: mf parse range not compat with safari (#8749)
Browse files Browse the repository at this point in the history
Co-authored-by: nkxrb <[email protected]>
  • Loading branch information
ahabhgk and nkxrb authored Dec 17, 2024
1 parent dfb1734 commit 75f0d20
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions crates/rspack_plugin_mf/src/sharing/consumesCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,17 @@ var parseRange = function(str) {
// hyphen ::= partial ( ' ' ) * ' - ' ( ' ' ) * partial
const items = str.split(/\s+-\s+/);
if (items.length === 1) {
const items = str
.trim()
.split(/(?<=[-0-9A-Za-z])\s+/g)
.map(parseSimple);
str = str.trim();
const items = [];
const r = /[-0-9A-Za-z]\s+/g;
var start = 0;
var match;
while ((match = r.exec(str))) {
const end = match.index + 1;
items.push(parseSimple(str.slice(start, end).trim()));
start = end;
}
items.push(parseSimple(str.slice(start).trim()));
return combine(items, 2);
}
const a = parsePartial(items[0]);
Expand Down

2 comments on commit 75f0d20

@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 ❌ failure
_selftest ✅ success
rsdoctor ❌ failure
rspress ✅ success
rslib ✅ success
rsbuild ❌ failure
examples ❌ failure
devserver ✅ success
nuxt ✅ success

@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-12-17 fb2869d) Current Change
10000_big_production-mode_disable-minimize + exec 37.9 s ± 622 ms 37.8 s ± 573 ms -0.31 %
10000_development-mode + exec 1.87 s ± 24 ms 1.84 s ± 46 ms -1.95 %
10000_development-mode_hmr + exec 687 ms ± 28 ms 673 ms ± 9.4 ms -2.13 %
10000_production-mode + exec 2.47 s ± 48 ms 2.42 s ± 99 ms -2.20 %
arco-pro_development-mode + exec 1.77 s ± 90 ms 1.81 s ± 38 ms +2.36 %
arco-pro_development-mode_hmr + exec 379 ms ± 1.6 ms 378 ms ± 2.3 ms -0.30 %
arco-pro_production-mode + exec 3.31 s ± 75 ms 3.26 s ± 109 ms -1.70 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 3.37 s ± 152 ms 3.33 s ± 92 ms -1.20 %
arco-pro_production-mode_traverse-chunk-modules + exec 3.34 s ± 124 ms 3.28 s ± 69 ms -1.97 %
threejs_development-mode_10x + exec 1.61 s ± 20 ms 1.64 s ± 14 ms +1.73 %
threejs_development-mode_10x_hmr + exec 794 ms ± 28 ms 812 ms ± 27 ms +2.25 %
threejs_production-mode_10x + exec 5.42 s ± 141 ms 5.39 s ± 118 ms -0.57 %
10000_big_production-mode_disable-minimize + rss memory 9482 MiB ± 276 MiB 9559 MiB ± 271 MiB +0.81 %
10000_development-mode + rss memory 633 MiB ± 14.8 MiB 720 MiB ± 39 MiB +13.67 %
10000_development-mode_hmr + rss memory 1396 MiB ± 296 MiB 1536 MiB ± 369 MiB +10.03 %
10000_production-mode + rss memory 601 MiB ± 31.9 MiB 710 MiB ± 48.1 MiB +18.25 %
arco-pro_development-mode + rss memory 587 MiB ± 40.3 MiB 611 MiB ± 36.8 MiB +3.99 %
arco-pro_development-mode_hmr + rss memory 639 MiB ± 102 MiB 646 MiB ± 48.9 MiB +1.13 %
arco-pro_production-mode + rss memory 742 MiB ± 50.5 MiB 775 MiB ± 74.5 MiB +4.51 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 737 MiB ± 45.5 MiB 805 MiB ± 54.9 MiB +9.26 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 720 MiB ± 58.3 MiB 780 MiB ± 54.4 MiB +8.30 %
threejs_development-mode_10x + rss memory 638 MiB ± 22.2 MiB 703 MiB ± 25.2 MiB +10.24 %
threejs_development-mode_10x_hmr + rss memory 1194 MiB ± 248 MiB 1240 MiB ± 158 MiB +3.84 %
threejs_production-mode_10x + rss memory 948 MiB ± 55 MiB 992 MiB ± 93.1 MiB +4.60 %

Please sign in to comment.