-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix @wordpress/*
duplicates
#41141
Fix @wordpress/*
duplicates
#41141
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Webpack Runtime (~50 bytes removed 📉 [gzipped])
Webpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded. App Entrypoints (~3595 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~6482 bytes removed 📉 [gzipped])
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 (~1627 bytes removed 📉 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
Looks like this saves ~3.5KB (compressed) on gutenboarding, which is where most of the duplication was living. |
Changing status to "on hold" as @scinos looks into a possible |
The |
Thanks for doing this! I am not very familiar with the various work that has been done to improve |
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.
I tested the following are working after npm ci
on this branch
- ✅ calypso.localhost
- ✅ calypso.localhost Gutenboarding
- ✅ FSE plugin synced to dotcom
- ✅ SPT selector in the page editor
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.
After doing a npm run clean
and npm ci
I'm still getting warnings in the logs: 249b0-pb
I don't think I remember the warnings about the missing exports before this PR.
Everything's working when I manually test though.
"@wordpress/editor": "^9.13.0", | ||
"@wordpress/element": "^2.12.0", | ||
"@wordpress/i18n": "^3.10.0", | ||
"classnames": "^2.2.6" |
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.
classnames
hasn't been moved to the root package.json
as a pinned dependency. Given that o2 blocks is an "app" should this dependency still be pinned?
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.
I think we're ok not pinning these versions anywhere for now, since we already have the ranges here guaranteeing we won't get incompatible versions. Team Calypso is working on a migration to yarn
where we won't be pinning at all, just ranges, and they're hoping to get it ready in the next few days.
"core-js": "^3.6.3", | ||
"isomorphic-fetch": "^2.2.1", | ||
"regenerator-runtime": "^0.13.3", | ||
"svg4everybody": "^2.1.9" |
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.
Given this is a sharable package it makes sense that these dependencies are no longer pinned. Was this required for the PR or just some house keeping? Just checking that you didn't mean to add these to the root package.json
too.
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.
I needed to make these ranges because of regenerator-runtime
, which would have been duplicated. I went ahead and did the same for the other dependencies.
They are there already in master, I'm afraid. They're part of the reason I'm working in this PR, and a subsequent one that will update Babel. You'll notice in your pb that there are no warnings for any |
Thank you for the reviews, @noahtallen and @p-jackson! 🙇 |
#39644 introduced a number of duplicates when updating packages from the
@wordpress
org. This is visible in the build logs:This PR fixes that, by ensuring that there are no duplicate
@wordpress/*
packages in use.Changes proposed in this Pull Request
@wordpress/*
dependencies to the rootpackage.json
@wordpress/*
dependencies on sub-projects use a compatibility range@wordpress/*
packages, to match the ones that were installed and thus avoid pulling in duplicate versions of their dependencies.Testing instructions
Ensure that the application builds correctly, and canaries/smoke testing doesn't reveal any issues.