This repository has been archived by the owner on Jun 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
[FSSS-214] Chore: ignoreOrder warnings from MiniCssExtractPlugin #390
Closed
Conversation
This file contains 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
✅ Deploy Preview for basestore ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Preview is readyThis pull request generated a Preview👀 Preview: https://preview-390--base.preview.vtex.app |
Gatsby Cloud Build Reportbasestore 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 6m PerformanceLighthouse report
|
filipewl
approved these changes
Mar 16, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me based on what we had discussed!
ArthurTriis1
approved these changes
Mar 16, 2022
lariciamota
approved these changes
Mar 23, 2022
Co-authored-by: Larícia Mota <[email protected]>
igorbrasileiro
approved these changes
Mar 25, 2022
Close due to #434 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What's the purpose of this pull request?
Solve some warnings on localhost from the
mini-css-extract-plugin
.How does it work?
As explained previously on #244
yarn develop
), theCSS
s from all pages and components on localhost are being extracted into a single CSS file (commons.css) and imported using<link>
in the<head>
.Thus, as a result of having all CSS together, we are getting some warnings on localhost from the
mini-css-extract-plugin
.yarn build
), as we enabled the CSS code-splitting, we have only the CSS that is being used in the pages/components. Thus optimizing performance and avoiding class collision and CSS order warnings.In addition, the CSS from the page being used is minified, inside a
<style>
tag in the<head>
. Thus, the browser avoids one more request to fetch a CSS file.So, we just have this problem locally then, and, while investigating how to deal with it, we started to test the use of CSS modules to analyze gains regarding the CSS order warnings and performance. But the result was almost the same as before.
Finally, reading some issues and threads (#1, #2, #3, #4, #5) we decide to ignore the order from the
mini-css-extract-plugin
once we have our CSS scoped already and it looks like this is the recommended way to avoid this problem so far.How to test it?
Check the console tab on Devtools after running
yarn develop
and double-check that we don't have warnings regarding the CSS order as we had previously.You can also check if the warnings were gone on the same console that you run the
yarn develop
command.References
https://vtex-dev.atlassian.net/browse/FSSS-214
https://vtex-dev.atlassian.net/browse/FSSS-127
Checklist