Packages: Mark build-styles as side-effectful#19535
Merged
Conversation
ab79a68 to
d5c5f89
Compare
1 task
Contributor
|
Here's some concrete testing steps:
diff --git a/webpack.config.js b/webpack.config.js
index e4e2ba6505..144b093349 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -150,7 +150,7 @@ const webpackConfig = {
'entry-login': [ path.join( __dirname, 'client', 'landing', 'login' ) ],
'entry-gutenboarding': [ path.join( __dirname, 'client', 'landing', 'gutenboarding' ) ],
},
- mode: isDevelopment ? 'development' : 'production',
+ mode: 'production',
devtool: process.env.SOURCEMAP || ( isDevelopment ? '#eval' : false ),
output: {
path: path.join( __dirname, 'public', extraPath ),
|
ockham
approved these changes
Jan 10, 2020
Contributor
ockham
left a comment
There was a problem hiding this comment.
Confirming that this fixes the issue we saw by following these instructions: #19535 (comment)
Member
|
Only those 2 packages are affected? |
Member
Author
I compiled the packages ( |
sirreal
added a commit
to Automattic/wp-calypso
that referenced
this pull request
Jan 13, 2020
Workaround for regression in package. See: WordPress/gutenberg#19535
gziolo
pushed a commit
that referenced
this pull request
Jan 13, 2020
* Declare sideEffects for build-style * fixup! Declare sideEffects for build-style * Add CHANGELOG entries
This was referenced Jan 23, 2020
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
In Automattic/wp-calypso#38554 we observed some styling regressions when importing component styles from
@wordpress/components/build-styles. This appears to be a regression introduced in #18911. Styles are side-effectful, and should be declared as such. Packages that includebuild-stylesintended for use from the published package must be marked as such. The webpack docs on tree shaking mention this:source
This PR marks
build-style/**as having side-effects for packages that were observed to produce abuild-styledirectory and were markedsideEffects: false. An alternative would be to add*.cssand*.scssto the list, however.How has this been tested?
When manually applying the change in this PR to the installed package where the regression was observed, the issue is fixed.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Fixes a regression published in
@wordpress/components@8.5.0that would prevent some build tools from including styles provided in the packagesbuild-stylesdirectory.Fixes a regression published in
@wordpress/block-library@2.9.2that would prevent some build tools from including styles provided in the packagesbuild-stylesdirectory.Checklist: