Comments (10)
Thanks, we will add more e2e cases for CSS Modules.
from rspack.
v0.6.4
from rspack.
Same error when set module generator:
![截屏2024-05-08 15 26 38](https://private-user-images.githubusercontent.com/127166080/328795381-b3c5bd74-e44a-41eb-ad1f-ec4369cbcf6b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwMjI1NTMsIm5iZiI6MTcxOTAyMjI1MywicGF0aCI6Ii8xMjcxNjYwODAvMzI4Nzk1MzgxLWIzYzViZDc0LWU0NGEtNDFlYi1hZDFmLWVjNDM2OWNiY2Y2Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMlQwMjEwNTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMzNhODQwNWFkZDdiNDEzYjhlMWRjZTY1ZjQyMGI5ZDMzYTQ5MDg2OWM3MTAwMGYyZTVhMGRkNzkwMDg3OTQxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.FMJp81Jk0yVrTbDYUA5Be3EzBq5K-VqvCFBsMBehF_o)
![截屏2024-05-08 15 27 36](https://private-user-images.githubusercontent.com/127166080/328795390-dc2ec15a-d493-404c-8635-4ebcb0243e47.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwMjI1NTMsIm5iZiI6MTcxOTAyMjI1MywicGF0aCI6Ii8xMjcxNjYwODAvMzI4Nzk1MzkwLWRjMmVjMTVhLWQ0OTMtNDA0Yy04NjM1LTRlYmNiMDI0M2U0Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyMlQwMjEwNTNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mZWM2ODdjZmY3Mjc5OGQwY2ZkYTE0M2M2MmViZmY5NThmY2JhZGZjZGQ0ZGNiMWEwNDg3MmE2ZWZiNDZmM2Q2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.DIwIRFOtZe4GAiPTq5lOiooh4DoPkIoPyJSgB8OOUSQ)
So where is [path]
?
from rspack.
Seem cause by https://github.com/web-infra-dev/rspack/pull/6444/files.
The testing ignore the deep dir cases.
from rspack.
Thanks for report, we will release the fix in today
from rspack.
Hi @ahabhgk, quick question on this hotfix.
I'm the reporter of the hashing issue in #6435 Which fixed my issue of css module hashes not matching Webpack/MD4 hashes generated elsewhere which was released in 0.6.4.
I did wonder about the missing deep path info so this addition is welcome, however it seems to have reintroduced the issue I reported above, where the hashes don't seem to match.
Using the https://github.com/rspack-contrib/rspack-examples/tree/main/rspack/css-parser-generator-options example an MD4 hash for a deep path of ./legacy/index.css
should be 2c15d43fe622e87bbf5d
(length limited to 20), but the class name generated using [hash]
in the example (with v0.6.5) results in d7377dc02a1f125c4876
Is this a regression on the previous fix, or am i missing something?
Thanks
from rspack.
Webpack experiments css should have the same issue about the deep path info, so the hash result of rspack is actually correct, we will submit a fix to webpack soon
from rspack.
Correct @ahabhgk, Webpack also has the same issue with deep path which needs to be addressed, however my issue is unless there's something else going on in the hashing logic, the hash isn't a straightforward MD4/Hex hash of the deep path value, as the path in the example of ./legacy/index.css
generates a different hash (with the default output.hashFunction
and output.hashDigest
values) than you get either using an MD4 generator (such as https://en.toolpage.org/tool/md4) or something like Webpack's loader-utils getHashDigest("./legacy/index.css", "md4", "hex", 20)
![Screenshot 2024-05-09 at 17 02 08](https://private-user-images.githubusercontent.com/28926760/329308091-1f4afb0b-69af-4f2e-91ae-33b693fd7eff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwMjI1NTMsIm5iZiI6MTcxOTAyMjI1MywicGF0aCI6Ii8yODkyNjc2MC8zMjkzMDgwOTEtMWY0YWZiMGItNjlhZi00ZjJlLTkxYWUtMzNiNjkzZmQ3ZWZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIyVDAyMTA1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTIzZjNjMTg5NzQ1NThiM2U3YjU0ZGYwZTQ4N2MyMjkyNWNkZDRhNTZiNzdmMjk5NDVlMjczOWJjZDI4Zjk1ZDUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Azdprk88k4WCuhGwPlIVaEFVwOl6STmIfpg2k_n1pbU)
from rspack.
We will take a look, but just curious, what's your use case which needs to have the same hash result of the className
from rspack.
Thanks @ahabhgk, our use case as mentioned in #6435 is the need to generate mapping json files of the classes which in our existing Webpack solution uses postcss
& postcss-modules
to generate these files, but moving to Rspack the hashes don't match (although they briefly did with the changes made for 0.6.4, but then broke again in 0.6.5).
If there's an alternative method you can think of to output these mappings then i'd be happy to hear it.
from rspack.
Related Issues (20)
- [Bug]: cheap-[module]-source-map not work with react compiler HOT 6
- [Bug]: Custom SWC loader crashes on ^0.7.3 HOT 6
- [Bug]: The result of bundling with rspack build produces nothing. HOT 4
- [Bug]: 在使用 sass-loader 和 mode为production 打包 Vue 文件时,图片资源未打包 HOT 1
- [Feature]: Use 1 HMR websocket connection for mutilple micro-frontend apps in same page HOT 1
- [Bug]: Segmentation fault and bus error on production builds HOT 2
- [Bug]: DefinePlugin in webpack will throw a warning for the same key, and rspack will choose to override it. HOT 2
- [Bug]: Build stuck for no reason HOT 2
- [Bug]: `copy-webpack-plugin` stuck in `compilation.fileSystemInfo.createSnapshot` HOT 3
- [Feature]: localVars hook to support RetryChunkPlugin HOT 2
- [Bug]: Kernel panic on HMR compilation seal
- [Bug]: Uncaught ReferenceError: exports is not defined HOT 13
- [Feature]: Support htmlWebpackPlugin.files as template parameters HOT 1
- [Bug]: panic during build phase HOT 2
- [Bug]: live reload of styles lazy components is broken when using hashes in names
- [Bug]: Failed to resolve tsconfig paths when using extends(version:0.7.1)
- [Bug]: Cannot get final name for export '__esModule' HOT 12
- [Bug] Invalid fallback `"javascript/auto"` rule.type passed to getRawGeneratorOptions HOT 1
- [Bug]: Evaluating context request with conditional expression
- [Bug]: Debugging in browser with rspack serve shows multiple copies of a source file.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspack.