You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR by @evilebottnawi changed the content being passed to interpolateName (in loader-utils) from including a plus + to including \x00.
The PR doesn't give an explanation for why this part of the change was made, but as a result upgrading to css-loader v4 or higher breaks my integration with babel-plugin-react-css-modules which is still using + (through the generic-names package).
If this is not a bug I can try to get things changed in generic-names, but it would be good to at least get an understanding of why the change from + to \x00.
My expected behavior was that the class name hashes would be identical, for the same localIdentName ([folder]___[name]__[local]___[md4:contenthash:base64:5]).
Actual Behavior
The hashes are not the same because the passed in content is different.
For css-loader the content is: app/javascript/components/QuickAction/styles.module.scss\u0000mobile-only
For babel-plugin-react-css-modules the content is: app/javascript/components/QuickAction/styles.module.scss+mobile-only
css-loader is generating the classes for the CSS code whereas babel-plugin-react-css-modules is generating the classes to be used in the React markup. The actual result is that nothing on the page is styled. 😄
Code
n/a
How Do We Reproduce?
There's quite a bit of setup needed to reproduce the error, but hopefully by pinpointing the change above, this isn't necessary.
The text was updated successfully, but these errors were encountered:
Sorry, it is not bug, we change our logic, please open an issue in babel-plugin-react-css-modules
If this is not a bug I can try to get things changed in generic-names, but it would be good to at least get an understanding of why the change from + to \x00.
Because you can use + character in filename, so you can have same hash for different classes in some cases, but you can't use \x00 in filenames
Expected Behavior
This PR by @evilebottnawi changed the
content
being passed tointerpolateName
(inloader-utils
) from including a plus+
to including\x00
.The PR doesn't give an explanation for why this part of the change was made, but as a result upgrading to
css-loader
v4 or higher breaks my integration withbabel-plugin-react-css-modules
which is still using+
(through thegeneric-names
package).If this is not a bug I can try to get things changed in
generic-names
, but it would be good to at least get an understanding of why the change from+
to\x00
.My expected behavior was that the class name hashes would be identical, for the same
localIdentName
([folder]___[name]__[local]___[md4:contenthash:base64:5]
).Actual Behavior
The hashes are not the same because the passed in content is different.
css-loader
the content is:app/javascript/components/QuickAction/styles.module.scss\u0000mobile-only
babel-plugin-react-css-modules
the content is:app/javascript/components/QuickAction/styles.module.scss+mobile-only
css-loader
is generating the classes for the CSS code whereasbabel-plugin-react-css-modules
is generating the classes to be used in the React markup. The actual result is that nothing on the page is styled. 😄Code
n/a
How Do We Reproduce?
There's quite a bit of setup needed to reproduce the error, but hopefully by pinpointing the change above, this isn't necessary.
The text was updated successfully, but these errors were encountered: