Skip to content

Build: Update calypso-build to v4 - #13503

Merged
simison merged 6 commits into
masterfrom
update/calypso-build-v4
Oct 2, 2019
Merged

simison merged 6 commits into
masterfrom
update/calypso-build-v4

Conversation

@sirreal

@sirreal sirreal commented Sep 20, 2019 •

Copy link
Copy Markdown
Member

Update @automattic/calypso-build to v4. Required for #13490

Closes #13594 (the automated dependency upgrade PR).

This updates the calypso-build dependency to version 4.

@matticbot

Copy link
Copy Markdown
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello sirreal! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer, review, and approve D32973-code before merging this PR. Thank you!

@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

@Automattic Automattic deleted a comment from jetpackbot Sep 23, 2019
@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

@sirreal
sirreal force-pushed the update/calypso-build-v4 branch from f125979 to 82975d2 Compare September 23, 2019 13:22
@jetpackbot

jetpackbot commented Sep 23, 2019 •

Copy link
Copy Markdown
Collaborator
Warnings
⚠️ "Testing instructions" are missing for this PR. Please add some
⚠️ "Proposed changelog entry" is missing for this PR. Please include any meaningful changes

This is an automated check which relies on PULL_REQUEST_TEMPLATE. We encourage you to follow that template as it helps Jetpack maintainers do their job. If you think 'Testing instructions' or 'Proposed changelog entry' are not needed for your PR - please explain why you think so. Thanks for cooperation 🤖

Generated by 🚫 dangerJS against 93fd21c

module.exports = babelJest.createTransformer( {
presets: [
require.resolve( '@automattic/calypso-build/babel/default' ),
require.resolve( '@automattic/calypso-build/babel/wordpress-element' ),

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The @automattic/calypso-build preset provides this transform without this line.

That is something the preset should provide, but I'm not sure of the best way to go about it.

This aligns with the way we pass --env.WP to webpack, but Jest doesn't seem to have any concept of arbitrary arguments we pass through the CLI. In fact, jest fails if it doesn't understand the arguments passed to the CLI.

This is sufficient for now, but it's something that should be considered for future calypso-build work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, yep 👍

@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

1 similar comment
@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

Comment thread webpack.config.extensions.js Resolved
@sirreal
sirreal marked this pull request as ready for review September 23, 2019 13:51
@sirreal
sirreal requested a review from a team September 23, 2019 13:51
@sirreal sirreal added [Status] Needs Review This PR is ready for review. Unit Tests and removed [Status] In Progress labels Sep 23, 2019
@sirreal
sirreal requested a review from a team September 23, 2019 13:52
@sirreal sirreal added this to the 7.9 milestone Sep 23, 2019

@ockham ockham left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great and seems to build and work well (both dashboard and Gutenblocks); thanks a ton for working on this!

One note, I see a weird visual change in a Gridicon (in the Upgrade Nudge) 😖

image

(Note that the Nudge isn't enabled yet -- I'm enabling it in my dev env through add_filter( 'jetpack_block_editor_enable_upgrade_nudge', '__return_true' );. Probably fine to fix in a follow-up, as long as nothing else is broken -- I couldn't spot anything 😅 )

ockham
ockham previously approved these changes Sep 23, 2019
@simison

simison commented Sep 24, 2019

Copy link
Copy Markdown
Member

One note, I see a weird visual change in a Gridicon (in the Upgrade Nudge) 😖

Could this be related to color-studio changes in Calypso build pipeline?

Comment thread yarn.lock
resolved "https://registry.yarnpkg.com/@automattic/calypso-color-schemes/-/calypso-color-schemes-1.0.0.tgz#17a14e3257bd90b40e960d624cca4353d4d20c34"
integrity sha512-W7r4pgcBauLx65oTLbHKV84ScnfEKmW7T/sXkPfByHhuIE7+OpubmiiBsizWatk1I/puUTmj+SDqEOJMOyRdzA==

"@automattic/calypso-color-schemes@^2.0.2":

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ockham This may be related to the visual change you're seeing…
#13503 (review)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah… I think this line:

Would need to become --studio-white.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@porada 👋 where there any other colors than white that now need --studio prefix?

Bummer with CSS variables (as opposite to scss variables) is that they fail silently. :-/

Checked if these would be listed on changelog but no dice:
https://github.com/Automattic/color-studio/blob/4b3262ac652a39c434c818e9e9c357fc23c8c0cc/CHANGELOG.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We replaced white with 3 semantic properties:

  • --color-surface (default white background),
  • --color-text-inverted (white text, which is also the correct substitute for the case mentioned above),
  • --color-border-inverted (white border).

Generally, we should avoid --studio-* values in favor of the theme properties (that’s a full listing).


Bummer with CSS variables (as opposite to scss variables) is that they fail silently

Yes, that is a disadvantage of using CSS properties. I hope we can make Stylelint throw errors when using an undefined property.

Checked if these would be listed on changelog but no dice

Color Studio’s changelog focuses only on color value changes. calypso-color-schemes would be a better place to look this up.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, thanks for a thorough overview @porada !

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened an issue to separate colors from calypso-build: Automattic/wp-calypso#36466

brbrr
brbrr previously approved these changes Sep 25, 2019

@brbrr brbrr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done some functional testing, and all looks good. LGTM :shipit:

@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

@zinigor

zinigor commented Sep 25, 2019

Copy link
Copy Markdown
Contributor

Cherry-picking yarn.lock didn't really fix the conflict, this needs a rebase. Can one of the authors please rebase when you're happy with the reviews, so that the history doesn't get lost?

@sirreal
sirreal force-pushed the update/calypso-build-v4 branch from efce591 to 42778df Compare September 26, 2019 20:50
@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

@sirreal

sirreal commented Sep 26, 2019

Copy link
Copy Markdown
Member Author

Rebased and yarn.lock regenerated

kraftbj
kraftbj previously approved these changes Oct 1, 2019

@kraftbj kraftbj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with a completely clean yarn build and via JN. No errors in CLI, console, and everything seemed functional.

@kraftbj kraftbj added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review This PR is ready for review. labels Oct 1, 2019
@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

- Switch Muriel `--color-white` to Gutenberg white
- Switch two specific Muriel colors in Mailchimp to Muriel success+error colors like elsewhere in `/extensions/*`
@matticbot

Copy link
Copy Markdown
Contributor

sirreal, Your synced wpcom patch D32973-code has been updated.

@simison

simison commented Oct 2, 2019 •

Copy link
Copy Markdown
Member

Aight! I tested several places where CSS variables (--color-white etc) are used in extensions and fixed what was broken in 93fd21c.

Instead of switching it to --color-surface I switched to Gutenberg $white color variable which is:

  • Easy to understand since we don't have Calypso color templates yet in the block editor
  • We're in Gutenberg context, after all, let's use Gutenberg core colors
  • It's already used all across, so this is more consistent. I'd expect all SASS variables to eventually be migrated to CSS variables but it has to be a more controlled process.
  • It won't silently break in future updates like changes in CSS color variables do; I'd expect colors to be separated from the build tool so that future updates like this wouldn't be so scary: Stop including calypso-color-scheme in calypso-build automatically wp-calypso#36466

There are still Muriel color variables around these files (such as --color-error) but those are harder to replace as it would require changing the color entirely. I confirmed that they are still present in the version of calypso-color-scheme that the calypso-build uses (See node_modules/@automattic/calypso-color-schemes/src/shared/_color-schemes.scss)

Most notably, this star and several other "whites" aren't broken anymore (as noted in #13503 (review)):

Screenshot 2019-10-02 at 10 57 06

Good for another test from Crew.

@jeherve jeherve left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to work well for me. 👍

@simison
simison merged commit 0097146 into master Oct 2, 2019
@simison
simison deleted the update/calypso-build-v4 branch October 2, 2019 08:37
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Oct 2, 2019
@simison

simison commented Oct 2, 2019 •

Copy link
Copy Markdown
Member

Deployed in r197337-wpcom

@ockham @sirreal In that changeset it shows that every .deps.json file now gets wp-polyfill as a dependency. Is that expected? I mean, it's good. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants