Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: align source name conflict handling #6993

Merged
merged 10 commits into from
Jul 2, 2024

Conversation

CPunisher
Copy link
Contributor

Summary

fix #6878

The processing flow of webpack is as follows:

  1. Webpack treats each element in sourcemap.sources as a module. (Code)
  2. It calculates the module -> sourceName mapping and stores it in moduleToSourceNameMapping. (Code)
  3. It checks and resolves conflicts in the values of moduleToSourceNameMapping. (Code)
  4. sourceMap.sources = modules.map(m => moduleToSourceNameMapping.get(m)); (Code)

The issue with rspack is that it directly handles conflicts between sourcemap.sources. Even if the same source points to the same module, it will execute the fallback logic and append a query ?xxxx to the original result.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Jul 1, 2024
Copy link

netlify bot commented Jul 1, 2024

Deploy Preview for rspack canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit a90e996
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6683915902ab3200085091a9

@LingyuCoder LingyuCoder requested a review from SyMind July 1, 2024 03:55
@CPunisher CPunisher changed the title fix: source name conflict handling fix: align source name conflict handling Jul 1, 2024
@SyMind
Copy link
Member

SyMind commented Jul 2, 2024

!bench

@rspack-bot
Copy link

rspack-bot commented Jul 2, 2024

📝 Benchmark detail: Open

Name Base (2024-07-02 a22f039) Current Change
10000_development-mode + exec 2.16 s ± 22 ms 2.16 s ± 30 ms -0.23 %
10000_development-mode_hmr + exec 685 ms ± 7.3 ms 688 ms ± 4.9 ms +0.37 %
10000_production-mode + exec 2.82 s ± 23 ms 2.79 s ± 24 ms -1.32 %
arco-pro_development-mode + exec 1.9 s ± 47 ms 1.91 s ± 55 ms +0.54 %
arco-pro_development-mode_hmr + exec 433 ms ± 1.5 ms 433 ms ± 1.4 ms -0.09 %
arco-pro_production-mode + exec 3.46 s ± 67 ms 3.46 s ± 54 ms -0.02 %
threejs_development-mode_10x + exec 1.57 s ± 16 ms 1.57 s ± 15 ms -0.17 %
threejs_development-mode_10x_hmr + exec 797 ms ± 13 ms 798 ms ± 5.9 ms +0.13 %
threejs_production-mode_10x + exec 5.57 s ± 50 ms 5.61 s ± 24 ms +0.61 %

@SyMind SyMind merged commit 061cd78 into web-infra-dev:main Jul 2, 2024
29 checks passed
@SyMind
Copy link
Member

SyMind commented Jul 2, 2024

@CPunisher Thank you for your excellent work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release: bug fix release: bug related release(mr only)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Debugging in browser with rspack serve shows multiple copies of a source file.
3 participants