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

Bump @wordpress/interface and other monorepo packages for Gutenberg 13.3.0 compat #64093

Merged
merged 9 commits into from
May 31, 2022

Conversation

mattwiebe
Copy link
Contributor

@mattwiebe mattwiebe commented May 26, 2022

Changes proposed in this Pull Request

  • Bump @wordpress/interface and other monorepo packages to the latest versions

Original discussion: p1653583842699789-slack-CBTN58FTJ

This one's tricky because @wordpress/interface isn't separately packaged in a way that lets us override a Core version. Instead, it's inlined by webpack rather than transformed into consuming a WP script by the dependency extraction plugin. Phew.

WordPress/gutenberg/pull/40923 introduced the new stuff, but Help Center is still packaging an older, outdated version, which then tramples the core/interface redux store namespace and lacks the new functions, which are called in the edit-site packages.

Testing instructions

On a sandboxed site with the gutenberg-edge sticker, build and run this version of ETK, and try to load the Site Editor.

Before you would see an error on a call to setDefaultComplementaryArea and a WSOD in the Site Editor.

Fixes #63944

@mattwiebe mattwiebe requested a review from a team May 26, 2022 21:52
@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 May 26, 2022
@github-actions
Copy link

github-actions bot commented May 26, 2022

@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 fix/edit-site-loading-in-gutenberg-13.3.0 on your sandbox.

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

@mattwiebe mattwiebe requested review from a team as code owners May 26, 2022 23:32
@fullofcaffeine fullofcaffeine changed the title Bump @wordpress/interface for Gutenberg 13.3.0 compat Bump @wordpress/interface and other monorepo pacakges for Gutenberg 13.3.0 compat May 26, 2022
@fullofcaffeine fullofcaffeine changed the title Bump @wordpress/interface and other monorepo pacakges for Gutenberg 13.3.0 compat Bump @wordpress/interface and other monorepo packages for Gutenberg 13.3.0 compat May 26, 2022
@fullofcaffeine fullofcaffeine added the caused-by-gutenberg-upgrade Labels an issue (or PR) as caused by or related to a Gutenberg upgrade on WPCOM. label May 26, 2022
@matticbot
Copy link
Contributor

matticbot commented May 27, 2022

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

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

name                 parsed_size           gzip_size
entry-gutenboarding     +16000 B  (+0.7%)    +5486 B  (+0.9%)
entry-stepper            +5275 B  (+0.2%)    +2726 B  (+0.3%)

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

Sections (~3849 bytes added 📈 [gzipped])

name                            parsed_size           gzip_size
gutenberg-editor                    +9143 B  (+1.7%)    +3749 B  (+2.3%)
site-purchases                      +9072 B  (+0.7%)    +3787 B  (+1.1%)
purchases                           +9072 B  (+0.6%)    +3787 B  (+0.9%)
checkout                            +8904 B  (+0.6%)    +3718 B  (+0.9%)
marketplace                         +8892 B  (+1.3%)    +3715 B  (+1.9%)
domains                             +8451 B  (+0.5%)    +3663 B  (+0.9%)
plugins                             +8295 B  (+1.1%)    +3594 B  (+1.7%)
woocommerce-installation            +8273 B  (+2.9%)    +3594 B  (+3.8%)
woocommerce                         +8273 B  (+3.2%)    +3594 B  (+4.3%)
themes                              +8273 B  (+1.3%)    +3594 B  (+2.0%)
theme                               +8273 B  (+1.8%)    +3594 B  (+2.6%)
stats                               +8273 B  (+1.2%)    +3594 B  (+1.9%)
sites                               +8273 B  (+3.8%)    +3594 B  (+5.0%)
settings-writing                    +8273 B  (+1.2%)    +3594 B  (+1.9%)
settings-security                   +8273 B  (+1.9%)    +3594 B  (+2.8%)
settings-performance                +8273 B  (+1.7%)    +3594 B  (+2.5%)
settings-jetpack                    +8273 B  (+2.5%)    +3594 B  (+3.5%)
settings-discussion                 +8273 B  (+2.5%)    +3594 B  (+3.5%)
settings                            +8273 B  (+1.3%)    +3594 B  (+1.9%)
scan                                +8273 B  (+1.2%)    +3594 B  (+1.9%)
reader                              +8273 B  (+1.5%)    +3594 B  (+2.2%)
preview                             +8273 B  (+3.2%)    +3594 B  (+4.3%)
posts-custom                        +8273 B  (+1.4%)    +3594 B  (+2.1%)
posts                               +8273 B  (+1.4%)    +3594 B  (+2.1%)
plans                               +8273 B  (+1.0%)    +3594 B  (+1.5%)
people                              +8273 B  (+1.6%)    +3594 B  (+2.4%)
pages                               +8273 B  (+1.9%)    +3594 B  (+2.7%)
migrate                             +8273 B  (+2.2%)    +3594 B  (+3.2%)
media                               +8273 B  (+0.4%)    +3594 B  (+0.7%)
marketing                           +8273 B  (+1.3%)    +3594 B  (+2.0%)
jetpack-social                      +8273 B  (+2.3%)    +3594 B  (+3.3%)
jetpack-search                      +8273 B  (+2.1%)    +3594 B  (+3.0%)
jetpack-connect                     +8273 B  (+0.8%)    +3594 B  (+1.5%)
jetpack-cloud-settings              +8273 B  (+2.0%)    +3594 B  (+2.9%)
jetpack-cloud-pricing               +8273 B  (+1.7%)    +3594 B  (+2.5%)
jetpack-cloud-agency-dashboard      +8273 B  (+2.5%)    +3594 B  (+3.6%)
jetpack-cloud                       +8273 B  (+3.5%)    +3594 B  (+4.7%)
import                              +8273 B  (+2.3%)    +3594 B  (+3.2%)
hosting                             +8273 B  (+1.8%)    +3594 B  (+2.6%)
home                                +8273 B  (+1.1%)    +3594 B  (+1.7%)
help                                +8273 B  (+1.3%)    +3594 B  (+2.1%)
google-my-business                  +8273 B  (+1.9%)    +3594 B  (+2.7%)
export                              +8273 B  (+3.1%)    +3594 B  (+4.2%)
email                               +8273 B  (+1.4%)    +3594 B  (+2.1%)
earn                                +8273 B  (+1.6%)    +3594 B  (+2.4%)
customize                           +8273 B  (+3.1%)    +3594 B  (+4.2%)
concierge                           +8273 B  (+1.9%)    +3594 B  (+2.9%)
comments                            +8273 B  (+1.1%)    +3594 B  (+1.8%)
backup                              +8273 B  (+1.0%)    +3594 B  (+1.6%)
activity                            +8273 B  (+1.2%)    +3594 B  (+1.9%)
account                             +8273 B  (+1.6%)    +3594 B  (+2.5%)
jetpack-cloud-partner-portal         +631 B  (+0.1%)     +127 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 (~3958 bytes added 📈 [gzipped])

name                                                            parsed_size            gzip_size
async-load-design-wordpress-components-gallery                     +10820 B   (+1.4%)    +4040 B   (+2.0%)
async-load-signup-steps-woocommerce-install-step-business-info      +8451 B   (+5.7%)    +3663 B   (+7.9%)
async-load-signup-steps-woocommerce-install-transfer                +8273 B   (+9.7%)    +3594 B  (+13.4%)
async-load-signup-steps-woocommerce-install-confirm                 +8273 B   (+7.4%)    +3594 B  (+10.2%)
async-load-signup-steps-woocommerce-install                         +8273 B  (+13.4%)    +3594 B  (+18.5%)
async-load-signup-steps-website-content                             +8273 B   (+6.3%)    +3594 B   (+8.6%)
async-load-signup-steps-user                                        +8273 B   (+4.6%)    +3594 B   (+6.8%)
async-load-signup-steps-theme-selection                             +8273 B   (+6.0%)    +3594 B   (+9.0%)
async-load-signup-steps-test-step                                   +8273 B  (+11.2%)    +3594 B  (+15.6%)
async-load-signup-steps-survey                                      +8273 B  (+10.0%)    +3594 B  (+14.0%)
async-load-signup-steps-store-features                              +8273 B   (+8.6%)    +3594 B  (+12.0%)
async-load-signup-steps-starting-point                              +8273 B   (+9.3%)    +3594 B  (+12.9%)
async-load-signup-steps-social-profiles                             +8273 B  (+10.4%)    +3594 B  (+14.5%)
async-load-signup-steps-site-type                                   +8273 B  (+10.8%)    +3594 B  (+14.9%)
async-load-signup-steps-site-topic                                  +8273 B   (+8.9%)    +3594 B  (+12.6%)
async-load-signup-steps-site-title                                  +8273 B  (+10.8%)    +3594 B  (+15.0%)
async-load-signup-steps-site-picker                                 +8273 B   (+4.5%)    +3594 B   (+6.1%)
async-load-signup-steps-site-or-domain                              +8273 B   (+9.1%)    +3594 B  (+12.8%)
async-load-signup-steps-site-options                                +8273 B   (+9.0%)    +3594 B  (+12.8%)
async-load-signup-steps-site                                        +8273 B   (+8.8%)    +3594 B  (+12.3%)
async-load-signup-steps-rewind-were-backing                         +8273 B  (+11.2%)    +3594 B  (+15.4%)
async-load-signup-steps-rewind-migrate                              +8273 B   (+8.7%)    +3594 B  (+12.2%)
async-load-signup-steps-rewind-form-creds                           +8273 B   (+7.4%)    +3594 B  (+10.4%)
async-load-signup-steps-reader-landing                              +8273 B  (+10.7%)    +3594 B  (+14.9%)
async-load-signup-steps-plans-atomic-store                          +8273 B   (+3.8%)    +3594 B   (+6.0%)
async-load-signup-steps-plans                                       +8273 B   (+2.8%)    +3594 B   (+4.3%)
async-load-signup-steps-page-picker                                 +8273 B  (+10.3%)    +3594 B  (+14.2%)
async-load-signup-steps-p2-site                                     +8273 B   (+7.9%)    +3594 B  (+11.2%)
async-load-signup-steps-p2-join-workspace                           +8273 B   (+9.7%)    +3594 B  (+13.4%)
async-load-signup-steps-p2-get-started                              +8273 B  (+10.7%)    +3594 B  (+14.8%)
async-load-signup-steps-p2-details                                  +8273 B  (+10.7%)    +3594 B  (+14.7%)
async-load-signup-steps-p2-confirm-email                            +8273 B  (+10.4%)    +3594 B  (+14.4%)
async-load-signup-steps-p2-complete-profile                         +8273 B   (+5.4%)    +3594 B   (+7.5%)
async-load-signup-steps-new-or-existing-site                        +8273 B   (+8.8%)    +3594 B  (+12.3%)
async-load-signup-steps-intent                                      +8273 B   (+9.0%)    +3594 B  (+12.6%)
async-load-signup-steps-import-light                                +8273 B   (+8.4%)    +3594 B  (+11.9%)
async-load-signup-steps-import-from                                 +8273 B   (+0.5%)    +3594 B   (+0.8%)
async-load-signup-steps-import                                      +8273 B   (+7.3%)    +3594 B  (+10.3%)
async-load-signup-steps-emails                                      +8273 B   (+9.3%)    +3594 B  (+12.9%)
async-load-signup-steps-domains                                     +8273 B   (+2.0%)    +3594 B   (+3.1%)
async-load-signup-steps-difm-site-picker                            +8273 B   (+4.4%)    +3594 B   (+5.9%)
async-load-signup-steps-design-picker                               +8273 B   (+6.1%)    +3594 B   (+8.6%)
async-load-signup-steps-creds-permission                            +8273 B   (+8.6%)    +3594 B  (+11.8%)
async-load-signup-steps-creds-confirm                               +8273 B   (+8.6%)    +3594 B  (+11.9%)
async-load-signup-steps-creds-complete                              +8273 B  (+11.2%)    +3594 B  (+15.4%)
async-load-signup-steps-courses                                     +8273 B  (+10.2%)    +3594 B  (+14.1%)
async-load-signup-steps-clone-start                                 +8273 B  (+10.4%)    +3594 B  (+14.4%)
async-load-signup-steps-clone-ready                                 +8273 B   (+8.4%)    +3594 B  (+11.9%)
async-load-signup-steps-clone-point                                 +8273 B   (+3.7%)    +3594 B   (+6.3%)
async-load-signup-steps-clone-jetpack                               +8273 B  (+10.9%)    +3594 B  (+15.2%)
async-load-signup-steps-clone-destination                           +8273 B   (+9.8%)    +3594 B  (+13.7%)
async-load-signup-steps-clone-credentials                           +8273 B   (+7.0%)    +3594 B  (+10.0%)
async-load-signup-steps-clone-cloning                               +8273 B  (+10.5%)    +3594 B  (+14.5%)
async-load-signup-steps-choose-service                              +8273 B   (+8.9%)    +3594 B  (+12.6%)
async-load-quick-language-switcher                                  +8273 B   (+6.3%)    +3594 B   (+8.4%)
async-load-design-playground                                        +8273 B   (+0.5%)    +3594 B   (+0.8%)
async-load-design-blocks                                            +8273 B   (+0.4%)    +3594 B   (+0.6%)
async-load-design                                                   +8273 B   (+0.4%)    +3594 B   (+0.8%)
async-load-calypso-components-sites-popover                         +8273 B   (+5.2%)    +3594 B   (+7.0%)
async-load-calypso-blocks-jitm-templates-modal                      +8273 B  (+12.2%)    +3594 B  (+16.8%)
async-load-calypso-blocks-inline-help-popover                       +8273 B   (+1.4%)    +3594 B   (+2.2%)
async-load-signup-steps-woocommerce-install-step-store-address      +8271 B   (+6.2%)    +3591 B   (+8.4%)
async-load-calypso-layout-masterbar-checkout-tsx                    +7970 B   (+1.1%)    +3504 B   (+1.6%)
async-load-calypso-layout-masterbar-checkout                        +7970 B   (+1.3%)    +3504 B   (+2.0%)
async-load-calypso-my-sites-checkout-modal                           -303 B   (-0.0%)      -88 B   (-0.0%)
async-load-calypso-blocks-editor-checkout-modal                       +66 B   (+0.0%)      +31 B   (+0.0%)

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

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.

Copy link
Contributor

@Addison-Stavlo Addison-Stavlo left a comment

Choose a reason for hiding this comment

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

Gave this a test run and it solves the WSOD on my end. Smoke testing everything seems good!

I would like to see another review / smoke test though since we are upgrading so many packages here.

@fullofcaffeine
Copy link
Contributor

fullofcaffeine commented May 27, 2022

Thanks for the help testing, @Addison-Stavlo!

I also spent some time this morning testing this with @brookewp and the web app seems to work fine. However, we did see some issues on the /devdocs page. More specifically, there's an uncaught exception (more on that below) that originates from react-with-styles-interface-css 6.0.0, which is a transitive dependency to react-dates 21.8.0, which itself is a dependency to the new version of @wordpress/components (19.11.0).

The error is the following:

Uncaught TypeError: _interopRequireDefault is not a function

In ../node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js. It returns the module object with a default property pointing to the actual function, but the consumer code tries to call the object:

// react-with-styles-interface-css/dist/index.js

var _interopRequireDefault = __webpack_require__("../node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js");

// _interopRequireDefaultg is not a function, but an object with a shape like: `Object { default: Getter, … }`. 
// The `default` getter points to the actual function that should be called. We could force-fix it by calling 
// `_interopRequireDefault.default` below, but obviously not a suitable fix as this is a third-party transitive dependency and the file is generated by WebPack.

// Errors here because `_interopRequireDefault` is not a function. 
var _arrayPrototype = _interopRequireDefault(__webpack_require__("../node_modules/array.prototype.flat/index.js"));

It appears as if the first require is wrong. I think the __interopRequireDefault should be inlined AFAIU, so that it can be used to get the default export?

The same generated file on trunk inlines the definition for the _interopRequireDefault function in the same index.js file instead of requiring it:

// react-with-styles-interface-css/dist/index.js

(...)

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

(...)

Which works fine.


This seems to be something that can be fixed at the Webpack level, though I'm not entirely sure yet. This also doesn't seem to be a hard blocker for releasing GB 13.3.0 as the web app seems to be working fine, but of course, it'd be best to get to the bottom of this issue and come up with a fix first. I'll spend some additional time on that today.

cc @noahtallen and @Automattic/team-calypso-frameworks here as well to see if you have any additional ideas.

@fullofcaffeine
Copy link
Contributor

fullofcaffeine commented May 28, 2022

I've spent most of my time today trying to get to the bottom of this. Kudos to @noahtallen for helping as well. I couldn't yet find a workaround, but I might be onto something as I found out it might be related to a new version of the react-dates package that is required by the some (or most?) of the new WP packages (see the message above for more details).

To verify this:

  1. Checkout this branch and apply the following diff:
diff --git a/package.json b/package.json
index 641d7058f7..52d4831add 100644
--- a/package.json
+++ b/package.json
@@ -278,6 +278,7 @@
                "yargs": "^17.0.1"
        },
        "resolutions": {
+               "react-dates": "17.1.1",
                "@automattic/newspack-blocks/[email protected]": "patch:[email protected]#.patches/[email protected]",
                "@automattic/newspack-blocks/prettier": "npm:[email protected]",
                "@types/react": "^17.0.39",

This will force react-dates to the previous working version.

  1. Run yarn && yarn start. Wait for assets to be compiled.
  2. Access http://calypso.localhost:3000/devdocs/wordpress-components-gallery, it should render without any JS errors. If you revert the changes, you'll see the error described in the message above.

So at least it seems we managed to narrow it down to a single package? Hopefully! 🤞🏻 I'll proceed to investigate what in react-dates version 21.8.0 might be causing the issue. If you have any thoughts, let me know!

Also, cc'ing @jsnajdr to see if you have any thoughts about this as well! 🙇🏻

@fullofcaffeine
Copy link
Contributor

fullofcaffeine commented May 30, 2022

I narrowed the issue down to this PR from react-with-styles-and-interface-css: airbnb/react-with-styles-interface-css#23. This changeset is included in version 6.0.0 that's a direct dependency of the new react-dates (21.8.0) that's installed as part of this mass update @wordpress of dependencies.

The culprit seems to be the babel update in the aforementioned PR. It generates a require for importing babel's _interopRequireDefault function in its dist/, like this:

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");  

This is what triggers the error in the Calypso /devdocs/wordpress-components-gallery page:

Uncaught (in promise) TypeError: _interopRequireDefault is not a function
    <anonymous> app:///../node_modules/react-with-styles-interface-css/dist/index.js:10
    js http://calypso.localhost:3000/calypso/evergreen/vendors-node_modules_wordpress_components_build-module_card_card-divider_component_js-node_mo-041708.js:1771
(...)

See why.

It's probably due to some incompatibility with Calypso's Webpack configuration, I assume, but I couldn't pinpoint what, yet. This is what I'll try to find out next cc @noahtallen if you have any ideas!

Before that PR in react-with-styles-interface-css, the same function was inlined, like this:

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }    

You can verify that with the following steps:

  1. Clone [email protected]:airbnb/react-with-styles-interface-css.git and cd into the newly-created directory;
  2. git-checkout the interface-v4.0.2 branch. This is the version Calypso's trunk uses;
  3. Install babel-cli globally -- the build task in that branch will fail to find the babel binary if you don't do this: npm uninstall -g babel-cli;
  4. Install packages and build: npm install && npm run build;
  5. Relative to the same dir, open packages/interface/dist/index.js in you favorite editor and verify that the _interopRequireDefault is defined there, in the same file;
  6. Now switch over to the master branch;
  7. Run find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; && npm install && npm run build for a clean install and build;
  8. Relative to the same dir, open packages/interface/dist/index.js in your favorite editor and verify that the _interopRequireDefault is now required from an external js file.

UPDATE: It's important to note, that dist/index.js file is further processed by the Webpack in Calypso, and the require is turned into a __webpack_require__. it's possible Calypso's Webpack configuration needs to be updated to support properly importing this module. Remember, the function is actually there, but it's in a default property in the returned object, see #.

@fullofcaffeine
Copy link
Contributor

fullofcaffeine commented May 31, 2022

The culprit seems to be the babel update in the aforementioned PR. It generates a require for importing babel's _interopRequireDefault function in its dist/, like this:

I've further researched this and what I mentioned above It's not really the culprit, but a symptom of a change in babel. I've found that same change in dozens of other packages, too. The culprit seems to be the fact that those packages were built with a more recent version of babel that requires the interop function like that.

I did find a hacky workaround - to use the yarn patch protocol to change the require line from:

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");  

To:

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

This works. However, we'd have to patch dozens of different packages (mostly the new @wordpress packages versions and some transient dependencies, but still a lot!) so it wouldn't scale. Still, this at least explains how this could be solved. I still don't know if we should tweak the Webpack or Babel configuration to solve this, yet. I'll continue the investigation tomorrow.

@fullofcaffeine
Copy link
Contributor

fullofcaffeine commented May 31, 2022

Oh, I see what might be wrong. Webpack is changing the require param to require the ESM version of the module for some reason:

var _interopRequireDefault = __webpack_require__("../node_modules/@babel/runtime/helpers/esm/interopRequireDefault.js");

We should get the CJS version instead, that correctly exports it in a compatible way:

module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; 

I still don't know where in Webpack configuration is the issue, though. I'll keep looking.

@fullofcaffeine
Copy link
Contributor

fullofcaffeine commented May 31, 2022

Seems it's related to the conditional exports and Webpack. It seems to be something similar to what was reported in this issue: iamkun/dayjs#492.

@noahtallen
Copy link
Contributor

noahtallen commented May 31, 2022

This is what I'll try to find out next cc @noahtallen if you have any ideas!

I unfortunately don't have any immediate ideas!

Since this is blocking Gutenberg release, my thought process is:

  • utilize resolutions to pin the working version of the package for now so that we can ship. (After testing it still works correctly of course!)
  • p2 about the problem to see if others have more ideas about how to solve the root problem.

@fullofcaffeine
Copy link
Contributor

fullofcaffeine commented May 31, 2022

I've pinned react-dates to 17.1.1, which solves the issue on the /devdocs/wordpress-components-gallery page. Interestingly enough, as I mentioned here, I'm still seeing a lot of packages that require the interopRequireDefault function, you can verify that by going to the node_modules dir in the root of Calypso and running: ag '_interopRequireDefault = require\("@babel\/' (I'm using ag silversearcher, which I find easier/better than grep).

However, for@wordpress/components bundling in Calypso, this doesn't seem to be a problem, as Webpack seems to pick up the source from build_module instead of build directory, and then the generated modules don't use interopRequireDefault. For some reason, it broke with the react-dates 21.8.0 transient dependencies, more specifically the react-with-styles-interface-css 6.0.0, which is a dependency of the new react-dates, as I explained in a previous message:

I narrowed the issue down to this PR from react-with-styles-and-interface-css: airbnb/react-with-styles-interface-css#23. This changeset is included in version 6.0.0 that's a direct dependency of the new react-dates 21.8.0 that's installed as part of this mass update @wordpress of dependencies.

Unfortunately, I couldn't pinpoint the root of the issue. It seems to be due to some unintended interaction with conditional exports. My hunch is that the Webpack+babel setup for Calypso can't handle packages that are pre-compiled with a more recent version of Babel that export the interopRequireDefault function from an ES module and require it from a CJS module. It appears that it was working before for react-with-styles-interface-css because it was built with a previous version of Babel that inlined the same function instead, as I explained in a previous comments above.

Copy link
Contributor

@noahtallen noahtallen left a comment

Choose a reason for hiding this comment

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

This is testing well for me! (Smoke tested WordPress components, Calypso, and ETK)

@fullofcaffeine fullofcaffeine merged commit 9c0f388 into trunk May 31, 2022
@fullofcaffeine fullofcaffeine deleted the fix/edit-site-loading-in-gutenberg-13.3.0 branch May 31, 2022 23:27
@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 May 31, 2022
@fullofcaffeine
Copy link
Contributor

Thanks for testing, Noah!

This should unblock the release of GB 13.3.0 :) -- the pin of react-dates to version 17.1.1 is not ideal, but I couldn't find another workaround for now. Would to know if anyone else has any clues as to what might be the root issue here. cc @Automattic/team-calypso-frameworks @Automattic/team-calypso-components

@mirka Also cc'ing you since I know you've recently worked on a Babel plugin and might have it fresh in your mind and maybe has some insights to share :)

Thanks! 🙇🏻

@ciampo
Copy link
Contributor

ciampo commented Jun 2, 2022

@noisysocks may help with making sure that the version of react-dates is good for this PR :)

@noahtallen
Copy link
Contributor

I can't recall a lot of the original issue, but do we think the react-dates resolution could be removed at this point?

@ciampo
Copy link
Contributor

ciampo commented Jun 23, 2023

react-dates was removed as a dependency of the components package in WordPress/gutenberg#43005 — I don't think that package is used anywhere else in Gutenberg?

It also looks like we're still listing @types/react-dates as a dev dependency, I think we should be able to remove that one too.

@noahtallen
Copy link
Contributor

Great! I'll make sure that's updated in #77046

@noisysocks
Copy link
Contributor

Yes I think react-dates was only used by @wordpress/components and that I removed that dependency in WordPress/gutenberg#43005.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
caused-by-gutenberg-upgrade Labels an issue (or PR) as caused by or related to a Gutenberg upgrade on WPCOM.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Gutenberg 13.3.0-rc.1] FSE: The Site Editor does not load
7 participants