fix(css): remove ?direct in id for postcss process#10514
Merged
Conversation
bluwy
commented
Oct 18, 2022
Comment on lines
-49
to
-54
| describe('css path resolutions', () => { | ||
| const mockedProjectPath = path.join(process.cwd(), '/foo/bar/project') | ||
| const mockedBarCssRelativePath = '/css/bar.module.css' | ||
| const mockedFooCssRelativePath = '/css/foo.module.css' | ||
|
|
||
| test('cssmodule compose/from path resolutions', async () => { |
Member
Author
There was a problem hiding this comment.
reviewer note: There's a lot of change in this test file. The gist of what I did is that I extracted the CSS plugin transform setup for this old test so that I can reuse it for the newly added test.
1 task
Member
Author
|
Whadaya know we indeed have test to prevent the breaking change 😄 |
Member
Author
|
Wait I was the one who approve #7827 too 🙈 Was thinking of just removing the |
Member
|
Yeah, I think we could remove |
?direct in id for postcss process
sapphi-red
previously approved these changes
Oct 20, 2022
patak-dev
reviewed
Oct 20, 2022
Co-authored-by: patak <[email protected]>
patak-dev
approved these changes
Oct 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fix #5097
If a CSS module is loaded via client and server, the
idmay differ in?directdue to import/fetch limitations.A custom
generateScopedNamemay be used that derives from the file name, but because of?direct, it generates a different hash even if the content is the same.This PR cleans the id before passing to postcss.
Additional context
I'm not sure if there are postcss plugins out there that rely on the query params to do something special, but that sounds hacky in the first place 🤔 And if so, this PR would break those usecase.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).