Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to React 17 and latest WordPress packages #54793

Merged
merged 13 commits into from
Sep 16, 2021
Merged

Conversation

scinos
Copy link
Contributor

@scinos scinos commented Jul 22, 2021

Changes proposed in this Pull Request

All updates required for React 17 and the latest WP monorepo packages.

Testing instructions:

  • 1. Ensure that Calypso runs locally
  • 2. CI should pass
  • 3. Smoke test all portions of calypso
  • 4. Smoke test ETK
  • 5. Smoke test wpcom block editor
  • 6. Smoke test o2-blocks
  • 7. Test that the removal of custom base-styles works properly.
  • 8. Double-check bundle sizes and m

ake sure those are ok.

Preparation:

These tasks can be done in trunk in before merging React 17, as they will reduce the surface area of the React update. CI will fail in this PR until all prep tasks are merged and this PR is rebased.

Assorted fixes:

3rd party dependency updates:

1st party dependency updates:

Changes in this PR

Dependency updates:

Assorted changes:

  • Use @wojtekmaj/enzyme-adapter-react-17 for React 17, since the main enzyme adapter has not been updated.
  • Update snapshot tests.
  • Update all peer dependency requirements in .yarnrc.yml.
  • Remove type hacks for @wordpress/compose now that it includes types.
  • Add global.CSS mock for tests.
  • Fix type changes.
  • Include jest-canvas-mock in a test suite which should have required it already.
  • Resolve @types/react to v17 for all dependencies to fix tsc compilation errors.
  • Make sure that jest-resolve has a dependency on the correct version of jest-haste-map
  • Remove resolutions which downgraded the wp base styles packages for compatibility.

Ignored dependencies:

The following dependencies have peer deps on react 16, but have not received react 17 updates. They do not break anything, so we are ignoring the warning messages from them. Most are transitive dependencies from 3rd parties, such as storybook.

  • react-autosize-textarea
  • airbnb-prop-types
  • react-dates
  • react-with-direction
  • react-simple-code-editor
  • create-react-context
  • @reach/router

@matticbot
Copy link
Contributor

matticbot commented Jul 22, 2021

@matticbot
Copy link
Contributor

This PR modifies the release build for notifications

To test your changes on WordPress.com, run install-plugin.sh notifications update/react-17 on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-elI-p2

@noahtallen
Copy link
Member

noahtallen commented Aug 10, 2021

There are a large number of sass deprecation warnings in the build log. Unfortunately, they won't be a quick fix. Since @wordpress/scripts updated their sass dependency, our yarn.lock is also updating it to a newer minor version, which I'm guessing includes the deprecation warnings.

Moving this into a separate PR: #55304. That PR will need to be merged before this PR works.

(Update: this should now be resolved)

@matticbot
Copy link
Contributor

matticbot commented Aug 10, 2021

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~40573 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-gutenboarding       +46978 B  (+2.5%)   +39491 B  (+7.6%)
entry-domains-landing      +5196 B  (+0.9%)    +2776 B  (+1.7%)
entry-main                 +4871 B  (+0.4%)    +4158 B  (+1.2%)
entry-browsehappy          -2718 B  (-2.9%)     -603 B  (-2.1%)
entry-login                +2208 B  (+0.2%)    +2424 B  (+0.9%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~22350 bytes added 📈 [gzipped])

name                          parsed_size           gzip_size
marketplace                      -51482 B  (-8.3%)   -12761 B  (-7.1%)
purchases                        -48616 B  (-3.2%)    -9946 B  (-2.5%)
site-purchases                   -46918 B  (-3.6%)    -8954 B  (-2.6%)
plans                            -38844 B  (-5.1%)    -9623 B  (-4.5%)
media                            +38422 B  (+2.1%)   +15505 B  (+3.3%)
gutenberg-editor                 -29337 B  (-7.0%)    -4762 B  (-3.7%)
marketing                        -22292 B  (-3.5%)    -6970 B  (-4.0%)
checkout                         -21911 B  (-1.6%)    -4035 B  (-1.1%)
email                            -21644 B  (-4.3%)    -6735 B  (-4.7%)
signup                           +19255 B  (+7.6%)     -595 B  (-1.1%)
domains                          -15798 B  (-1.1%)     +527 B  (+0.1%)
plugins                          -12098 B  (-2.2%)     -884 B  (-0.6%)
reader                           +11975 B  (+2.1%)    +7680 B  (+4.9%)
jetpack-connect                  -11898 B  (-1.8%)     -588 B  (-0.3%)
backup                           +10543 B  (+1.8%)    +8363 B  (+5.4%)
settings                         -10339 B  (-1.7%)     -511 B  (-0.3%)
hosting                          +10290 B  (+3.4%)    +7279 B  (+8.3%)
home                              -7599 B  (-1.5%)     -934 B  (-0.7%)
account                           -7505 B  (-1.4%)     +852 B  (+0.6%)
themes                            -5085 B  (-1.2%)     -378 B  (-0.3%)
pages                             -4870 B  (-1.5%)     -302 B  (-0.3%)
theme                             -4796 B  (-1.6%)     -217 B  (-0.2%)
activity                          -4723 B  (-0.9%)      +79 B  (+0.1%)
stats                             -4644 B  (-0.8%)     -773 B  (-0.5%)
scan                              -4611 B  (-1.2%)     -866 B  (-0.8%)
security                          +4393 B  (+0.8%)    +2695 B  (+1.9%)
google-my-business                -4296 B  (-1.4%)     -736 B  (-0.8%)
happychat                         +4197 B  (+1.2%)    +2069 B  (+2.0%)
privacy                           +4170 B  (+1.2%)    +1876 B  (+2.0%)
me                                +4170 B  (+1.3%)    +1880 B  (+2.0%)
notification-settings             +4162 B  (+1.0%)    +2098 B  (+1.9%)
account-close                     +4116 B  (+1.1%)    +1820 B  (+1.8%)
jetpack-search                    -4061 B  (-2.4%)    -1069 B  (-2.1%)
jetpack-cloud-settings            -4006 B  (-1.9%)    -1078 B  (-1.7%)
migrate                           -3948 B  (-2.2%)    -1082 B  (-2.1%)
export                            -3903 B  (-2.2%)    -1038 B  (-1.9%)
site-blocks                       +3864 B  (+1.0%)    +2140 B  (+2.0%)
concierge                         -3817 B  (-1.2%)     -871 B  (-1.0%)
comments                          -3777 B  (-0.6%)     +755 B  (+0.5%)
settings-jetpack                  -3732 B  (-1.8%)     -752 B  (-1.2%)
import                            -3662 B  (-1.4%)     -732 B  (-0.9%)
beta-testing                      -3513 B  (-2.2%)     -712 B  (-1.4%)
people                            -3390 B  (-0.9%)     -542 B  (-0.5%)
customize                         -3386 B  (-2.2%)    -1276 B  (-2.5%)
woocommerce                       -3358 B  (-2.0%)     -789 B  (-1.5%)
preview                           -3240 B  (-2.3%)     -809 B  (-1.8%)
jetpack-cloud                     -3209 B  (-2.8%)     -965 B  (-2.6%)
jetpack-cloud-partner-portal      -3178 B  (-1.5%)     -756 B  (-1.2%)
sites                             -3159 B  (-2.9%)     -915 B  (-2.6%)
help                              +3140 B  (+0.6%)    +1742 B  (+1.2%)
woocommerce-installation          -3054 B  (-2.0%)     -750 B  (-1.5%)
settings-discussion               +1968 B  (+0.7%)    +1329 B  (+1.6%)
earn                              +1471 B  (+0.4%)    +1226 B  (+1.1%)
settings-security                 +1308 B  (+0.4%)    +1357 B  (+1.4%)
settings-performance              +1267 B  (+0.3%)    +1283 B  (+1.2%)
jetpack-cloud-pricing             +1234 B  (+0.4%)    +1254 B  (+1.2%)
devdocs                           +1105 B  (+0.7%)     -815 B  (-1.8%)
accept-invite                      -875 B  (-0.7%)     -649 B  (-1.8%)
purchase-product                   -759 B  (-0.7%)      -25 B  (-0.1%)
posts                              +752 B  (+0.2%)    +2501 B  (+1.8%)
settings-writing                   +698 B  (+0.1%)    +1004 B  (+0.6%)
posts-custom                       +465 B  (+0.1%)    +2265 B  (+1.6%)
domain-connect-authorize            -65 B  (-0.5%)       -4 B  (-0.1%)
lib-analytics-signup                -39 B  (-0.4%)       -1 B  (-0.0%)
incoming-redirect                   -39 B  (-0.7%)       -1 B  (-0.0%)
jetpack-cloud-auth                  -13 B  (-0.5%)       -1 B  (-0.1%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~297381 bytes removed 📉 [gzipped])

name                                                                           parsed_size            gzip_size
async-load-block-editor                                                          -745718 B  (-27.7%)  -234758 B  (-29.9%)
async-load-calypso-post-editor-editor-media-modal                                 +44683 B   (+2.6%)   +17577 B   (+4.1%)
async-load-design-wordpress-components-gallery                                    -42353 B   (-5.5%)    -2359 B   (-1.2%)
async-load-design-blocks                                                          +37979 B   (+1.6%)   +18869 B   (+3.3%)
async-load-design-playground                                                      +36917 B   (+2.1%)   +18351 B   (+4.5%)
async-load-calypso-post-editor-media-modal                                        +35844 B   (+2.2%)   +14501 B   (+3.7%)
async-load-design                                                                 +35489 B   (+1.9%)   +18314 B   (+4.3%)
async-load-calypso-reader-search-stream                                           -25081 B  (-19.6%)    -8919 B  (-23.1%)
async-load-calypso-reader-following-manage                                        -25068 B  (-15.3%)    -8920 B  (-17.9%)
async-load-calypso-reader-site-stream                                             -24886 B  (-35.6%)    -8814 B  (-37.6%)
async-load-calypso-reader-feed-stream                                             -24886 B  (-35.6%)    -8815 B  (-37.7%)
async-load-signup-steps-p2-details                                                +14763 B  (+20.8%)    +8886 B  (+47.6%)
async-load-signup-steps-test-step                                                 +14580 B  (+21.0%)    +8500 B  (+46.8%)
async-load-signup-steps-rewind-were-backing                                       +14580 B  (+20.9%)    +8503 B  (+46.1%)
async-load-signup-steps-creds-complete                                            +14580 B  (+20.9%)    +8504 B  (+46.1%)
async-load-signup-steps-clone-start                                               +14580 B  (+19.4%)    +8492 B  (+42.6%)
async-load-signup-steps-clone-cloning                                             +14580 B  (+19.5%)    +8496 B  (+42.9%)
async-load-signup-steps-design-picker                                             +14567 B  (+19.7%)    +8492 B  (+42.9%)
async-load-signup-steps-site-type                                                 +14554 B  (+20.2%)    +8513 B  (+45.0%)
async-load-signup-steps-site-title                                                +14554 B  (+20.5%)    +8494 B  (+45.6%)
async-load-signup-steps-clone-jetpack                                             +14554 B  (+20.3%)    +8504 B  (+45.5%)
async-load-signup-steps-site-style                                                +14541 B  (+16.0%)    +8470 B  (+33.0%)
async-load-signup-steps-rebrand-cities-welcome                                    +14528 B  (+20.0%)    +8512 B  (+44.3%)
async-load-signup-steps-reader-landing                                            +14528 B  (+19.9%)    +8501 B  (+44.7%)
async-load-signup-steps-clone-destination                                         +14528 B  (+18.3%)    +8502 B  (+40.9%)
async-load-signup-steps-site-or-domain                                            +14502 B  (+17.8%)    +8493 B  (+39.1%)
async-load-signup-steps-passwordless                                              +14502 B  (+19.0%)    +8505 B  (+43.4%)
async-load-signup-steps-clone-ready                                               +14476 B  (+15.4%)    +8489 B  (+33.5%)
async-load-signup-steps-rewind-migrate                                            +14463 B  (+15.9%)    +8504 B  (+34.8%)
async-load-signup-steps-emails                                                    +14437 B  (+17.1%)    +8511 B  (+37.7%)
async-load-signup-steps-creds-permission                                          +14396 B  (+15.6%)    +8519 B  (+33.5%)
async-load-signup-steps-creds-confirm                                             +14396 B  (+15.6%)    +8520 B  (+33.6%)
async-load-signup-steps-survey                                                    +14345 B  (+18.7%)    +8148 B  (+40.0%)
async-load-signup-steps-p2-site                                                   +14254 B  (+15.5%)    +8773 B  (+35.6%)
async-load-signup-steps-import-url                                                +14251 B  (+15.3%)    +8137 B  (+29.9%)
async-load-signup-steps-theme-selection                                           +14234 B  (+10.7%)    +8169 B  (+22.8%)
async-load-signup-steps-rewind-form-creds                                         +14227 B  (+13.5%)    +8528 B  (+30.0%)
async-load-signup-steps-site-topic                                                +14190 B  (+16.5%)    +8213 B  (+35.1%)
async-load-signup-steps-import-preview                                            +14189 B  (+15.4%)    +8076 B  (+32.0%)
async-load-signup-steps-clone-point                                               +14131 B   (+6.4%)    +8499 B  (+16.0%)
async-load-signup-steps-clone-credentials                                         +14097 B  (+11.4%)    +8515 B  (+25.9%)
async-load-signup-steps-about                                                     +14072 B  (+11.9%)    +8437 B  (+26.1%)
async-load-signup-steps-import-url-onboarding                                     +14069 B  (+12.5%)    +8143 B  (+24.8%)
async-load-signup-steps-site                                                      +14045 B  (+15.8%)    +8190 B  (+34.5%)
async-load-signup-steps-site-picker                                               +13798 B  (+10.3%)    +8437 B  (+21.9%)
async-load-signup-steps-user                                                      +13753 B   (+8.2%)    +8645 B  (+18.8%)
async-load-calypso-blocks-editor-checkout-modal                                   -13488 B   (-1.3%)     -885 B   (-0.3%)
async-load-signup-steps-plans-atomic-store                                        +13053 B   (+6.3%)    +8109 B  (+15.3%)
async-load-signup-steps-plans                                                     -10474 B   (-3.7%)     -471 B   (-0.6%)
async-load-calypso-components-web-preview-component                               +10420 B   (+1.9%)    +8076 B   (+5.2%)
async-load-signup-steps-domains                                                    -8389 B   (-2.3%)       +2 B   (+0.0%)
async-load-automattic-search                                                       -7187 B   (-6.6%)     +164 B   (+0.5%)
async-load-calypso-blocks-inline-help-dialog                                       +5230 B  (+18.8%)    +1730 B  (+21.3%)
async-load-quick-language-switcher                                                 -4934 B   (-3.3%)    +1030 B   (+2.2%)
async-load-calypso-blocks-jitm-templates-modal                                     +2855 B   (+3.6%)    +3677 B  (+16.0%)
async-load-calypso-blocks-inline-help-popover                                      -2714 B   (-0.6%)      -77 B   (-0.1%)
async-load-calypso-layout-community-translator-launcher                            -2245 B   (-9.4%)     -766 B   (-9.9%)
async-load-calypso-my-sites-sidebar                                                -2041 B   (-1.0%)     +800 B   (+1.3%)
async-load-calypso-blocks-support-article-dialog-dialog                            -1068 B   (-0.9%)      +47 B   (+0.1%)
async-load-store-app-store-stats                                                    -842 B   (-0.6%)       -1 B   (-0.0%)
async-load-calypso-layout-masterbar-drafts-popover                                  -784 B   (-1.6%)     -573 B   (-3.5%)
async-load-calypso-my-sites-sidebar-unified                                         -718 B   (-0.8%)       +0 B
async-load-calypso-my-sites-resume-editing                                          -665 B   (-1.0%)      +28 B   (+0.1%)
async-load-publish                                                                  -654 B   (-1.4%)       -7 B   (-0.0%)
async-load-design-illustrations                                                     -624 B   (-3.8%)      +11 B   (+0.5%)
async-load-calypso-components-sites-popover                                         -596 B   (-0.9%)      +12 B   (+0.1%)
async-load-calypso-reader-sidebar                                                   -555 B   (-0.7%)      -33 B   (-0.2%)
async-load-calypso-my-sites-current-site-notice                                     -534 B   (-1.1%)       +0 B
async-load-calypso-components-jetpack-sidebar                                       -500 B   (-1.0%)      -13 B   (-0.1%)
async-load-store-app-store-stats-referrers                                          -410 B   (-0.5%)      -14 B   (-0.1%)
async-load-calypso-blocks-calendar-popover                                          +395 B   (+0.2%)    +1683 B   (+3.5%)
async-load-calypso-components-jetpack-portal-nav                                    -386 B   (-1.4%)       -6 B   (-0.1%)
async-load-calypso-layout-guided-tours-component                                    -384 B   (-0.5%)      -21 B   (-0.1%)
async-load-calypso-blocks-product-purchase-features-list                            -364 B   (-1.2%)       -8 B   (-0.1%)
async-load-calypso-my-sites-current-site-stale-cart-items-notice                    -338 B   (-2.1%)       -7 B   (-0.2%)
async-load-calypso-layout-guided-tours                                              -260 B   (-3.0%)       +5 B   (+0.2%)
async-load-calypso-blocks-jitm-templates-sidebar-banner                             -195 B   (-0.7%)       +3 B   (+0.0%)
async-load-calypso-blocks-jitm-templates-notice                                     -195 B   (-0.7%)       +8 B   (+0.1%)
async-load-calypso-blocks-jitm-templates-default                                    -195 B   (-0.7%)      +14 B   (+0.2%)
async-load-store-app-store-stats-listview                                           -176 B   (-0.4%)       +4 B   (+0.0%)
async-load-calypso-my-sites-current-site-domain-warnings                            -170 B   (-0.3%)       +4 B   (+0.0%)
async-load-calypso-components-happychat                                             -169 B   (-0.6%)      +45 B   (+0.5%)
async-load-calypso-my-sites-site-settings-seo-settings-form                         -147 B   (-0.1%)       -2 B   (-0.0%)
async-load-calypso-notifications                                                    -131 B   (-0.1%)      +80 B   (+0.2%)
async-load-calypso-my-sites-marketplace-pages-marketplace-plugin-setup-status       -130 B   (-0.4%)       -5 B   (-0.0%)
async-load-calypso-blocks-inline-help                                               -128 B   (-0.5%)      +39 B   (+0.5%)
async-load-calypso-post-editor-editor-revisions-dialog                              -117 B   (-0.5%)       +1 B   (+0.0%)
async-load-calypso-components-community-translator                                  -104 B   (-0.7%)       -2 B   (-0.0%)
async-load-calypso-blocks-jitm                                                      -102 B   (-1.0%)       -1 B   (-0.0%)
async-load-calypso-lib-preferences-helper                                           -101 B   (-1.1%)       +6 B   (+0.2%)
async-load-calypso-my-sites-guided-transfer                                          -78 B   (-0.4%)       -3 B   (-0.1%)
async-load-calypso-blocks-reader-full-post                                           -78 B   (-0.2%)       -1 B   (-0.0%)
async-load-calypso-blocks-product-plan-overlap-notices                               -78 B   (-1.5%)       -3 B   (-0.2%)
async-load-calypso-blocks-app-promo                                                  -78 B   (-0.9%)       +0 B
async-load-calypso-reader-tag-stream-main                                            -65 B   (-0.4%)       -2 B   (-0.0%)
async-load-calypso-components-happychat-button                                       -52 B   (-1.5%)       -1 B   (-0.1%)
async-load-calypso-blocks-login-two-factor-authentication-two-factor-content         -52 B   (-0.2%)       -1 B   (-0.0%)
async-load-calypso-blocks-legal-updates-banner                                       -52 B   (-1.3%)       +0 B
async-load-calypso-blocks-app-banner                                                 -52 B   (-0.7%)       -1 B   (-0.0%)
async-load-calypso-reader-list-stream                                                -39 B   (-0.3%)       -1 B   (-0.0%)
async-load-calypso-layout-masterbar-checkout-tsx                                     -39 B   (-1.0%)       -1 B   (-0.1%)
async-load-calypso-components-global-notices                                         -39 B   (-0.9%)       -1 B   (-0.1%)
async-load-calypso-blocks-login-social-connect-prompt                                -39 B   (-0.9%)       -3 B   (-0.2%)
async-load-calypso-lib-network-connection                                            -26 B   (-0.6%)       +1 B   (+0.1%)
async-load-docs-selectors                                                            -13 B   (-0.2%)       +1 B   (+0.1%)
async-load-calypso-reader-list-manage                                                -13 B   (-0.0%)       -1 B   (-0.0%)
async-load-calypso-reader-conversations-stream                                       -13 B   (-0.3%)       -4 B   (-0.2%)
async-load-calypso-lib-auth-helper                                                   -13 B   (-0.9%)       +0 B
async-load-calypso-components-webpack-build-monitor                                  -13 B   (-0.6%)       -1 B   (-0.1%)
async-load-calypso-blocks-support-article-dialog                                     -13 B   (-0.8%)       -1 B   (-0.1%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

Moment.js Locales (~166 bytes removed 📉 [gzipped])

name                    parsed_size           gzip_size
moment-locale-gom-latn        -77 B  (-3.4%)      -38 B  (-3.4%)
moment-locale-gom-deva        -77 B  (-2.1%)      -39 B  (-2.9%)
moment-locale-fr-ch           -42 B  (-2.8%)      -12 B  (-1.5%)
moment-locale-fr-ca           -42 B  (-2.8%)      -14 B  (-1.8%)
moment-locale-fr              -34 B  (-1.6%)      -13 B  (-1.3%)
moment-locale-it-ch           -25 B  (-1.7%)      -12 B  (-1.5%)
moment-locale-it              -25 B  (-1.4%)      -17 B  (-2.1%)
moment-locale-el              -25 B  (-0.9%)      -21 B  (-1.6%)

Locale data for moment.js. Unless you are upgrading the moment.js library, changes in these chunks are suspicious.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot
Copy link
Contributor

This PR modifies the release build for editing-toolkit

To test your changes on WordPress.com, run install-plugin.sh editing-toolkit update/react-17 on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-mMA-p2

@matticbot
Copy link
Contributor

This PR modifies the release build for wpcom-block-editor

To test your changes on WordPress.com, run install-plugin.sh wpcom-block-editor update/react-17 on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-l4k-p2

@matticbot
Copy link
Contributor

This PR modifies the release build for o2-blocks

To test your changes on WordPress.com, run install-plugin.sh o2-blocks update/react-17 on your sandbox.

To deploy your changes after merging, see the documentation: PCYsg-r7r-p2

@noahtallen noahtallen self-assigned this Aug 24, 2021
@noahtallen noahtallen force-pushed the update/react-17 branch 3 times, most recently from 9baa14e to c8e5799 Compare August 25, 2021 22:45
@noahtallen noahtallen requested a review from a team August 25, 2021 23:46
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Aug 25, 2021
@noahtallen noahtallen changed the title update/react-17 (WIP) update/react-17 Aug 25, 2021
@noahtallen
Copy link
Member

noahtallen commented Aug 26, 2021

The final issue blocking this PR is related to Storybook, Emotion 11, and WordPress components. The specific problem is that the search storybook build fails trying to resolve @emotion/styled/base from wordpress components.

  • @emotion/styled/base is a new construct in Emotion 11; it was previously @emotion/styled-base.
  • Storybook forcibly resolves Emotion 10 internally.
  • We run storybook 10 throughout the rest of Calypso.
  • The WordPress monorepo has updated to emotion 11.

I've found a workaround, which includes updating emotion to v11 for Calypso, and then having the webpack config for storybook resolve v11. Part of this was implemented in e669c1c, but it turns out we also need the emotion update for calypso for that to work.

I'm splitting the emotion update into #55736, in hopes that we can do it standalone.

@ciampo
Copy link
Contributor

ciampo commented Aug 26, 2021

In case it can help, this is the Gutenberg PR for the migration to Emotion 11, which also contains a workaround for Storybook: WordPress/gutenberg#32930

@noahtallen
Copy link
Member

noahtallen commented Aug 27, 2021

Edit: dependency issues have now been listed in the PR description.

@scinos
Copy link
Contributor Author

scinos commented Sep 15, 2021

I only get the warnings about newspack. We could hide them until the newspack update is gone, as long as we are confident it won't actually break with React 17

➤ YN0060: │ @automattic/wpcom-editing-toolkit@workspace:apps/editing-toolkit provides react (pa4cd8) with version 17.0.2, which doesn't satisfy what @automattic/newspack-blocks and some of its descendants request
➤ YN0060: │ @automattic/wpcom-editing-toolkit@workspace:apps/editing-toolkit provides react-dom (pe0d22) with version 17.0.2, which doesn't satisfy what @automattic/newspack-blocks and some of its descendants request
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code

Other than that, looks good to me (GitHub won't let me approve because I was the original author)

@noahtallen
Copy link
Member

I'll do some more testing of that, but the peer dependency warnings are all about react 17. I assume these are being replaced by the latest Gutenberg plugin code once the block lands on wpcom, so I'll verify that assumption before merging.

@noahtallen
Copy link
Member

noahtallen commented Sep 15, 2021

I'm noticing several deprecated components warnings. We should resolve these as a follow-up task. I think some have been around for a while.

  • wp.data.select( 'core/editor' ).getBlocks is deprecated since version 5.3. Please use wp.data.select( 'core/block-editor' ).getBlocks instead`
  • wp.nux is deprecated since version 5.4. Note: wp.components.Guide can be used to show a user guide
  • Using Toolbar without label prop is deprecated since version 5.6. Please use ToolbarGroup component instead
  • Using custom components as toolbar controls is deprecated since version 5.6. Please use ToolbarItem, ToolbarButton or ToolbarDropdownMenu components instead
  • wp.data.select( 'core/editor' ).getSelectedBlock is deprecated since version 5.3. Please use wp.data.select( 'core/block-editor' ).getSelectedBlock
  • wp.editor.RichTextToolbarButton is deprecated since version 5.3. Please use wp.blockEditor.RichTextToolbarButton instead
  • Button isDefault prop is deprecated since version 5.4. Please use variant="secondary" instead

@noahtallen
Copy link
Member

Current yarn output is:

➜  wp-calypso git:(update/react-17) ✗ yarn
➤ YN0000: ┌ Resolution step
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 467ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ 3604 packages were already cached
➤ YN0000: └ Completed in 1s 783ms
➤ YN0000: ┌ Link step
➤ YN0000: └ Completed in 2s 425ms
➤ YN0000: Done with warnings in 4s 890ms

I think this is good, as we will be reminded to resolve and update the peer requirement messages we are discarding

renovate-bot and others added 12 commits September 16, 2021 12:42
Squashed commit of the following:

commit 95ca82b
Author: Sergio Cinos <[email protected]>
Date:   Thu Jul 22 11:27:51 2021 +0200

    Add global CSS

commit 1e0c99d
Author: Sergio Cinos <[email protected]>
Date:   Thu Jul 22 09:36:36 2021 +0200

    Do not import types-patch

commit dee6bd6
Author: Sergio Cinos <[email protected]>
Date:   Thu Jul 22 09:29:26 2021 +0200

    Delete unused types patch

commit 2465d15
Author: Sergio Cinos <[email protected]>
Date:   Thu Jul 22 09:18:20 2021 +0200

    Fix types
Use @wojtekmaj/enzyme-adapter-react-17
- @types/react had to be pinned to v17 to prevent TSC compilation
  errors. This is because TSC would sometimes resolve types for
  react 16, which isn't used by us, but gets included by some
  dependencies.
- jest-haste-map had to be pinned to v27 because a different part
  of jest was importing from jest-haste-map without having had
  jest-haste-map in its package.json. As a result, it would resolve
  an older version of jest-haste-map, which had incorrect types.
@noahtallen noahtallen merged commit b94d8ec into trunk Sep 16, 2021
@noahtallen noahtallen deleted the update/react-17 branch September 16, 2021 20:07
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants