-
Notifications
You must be signed in to change notification settings - Fork 823
Remove most pnpm hoisting, fix phantom deps #24096
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
Conversation
We've long had pnpm's public hoisting disabled, but it also privately hoists everything into `node_modules/.pnpm/node_modules/` for compatibility with packages that have undeclared dependencies. Let's disable most of that private hoisting and see what turns up. Changes of note: * We still hoist a bunch of eslint plugins (and one prettier plugin) as untangling that mess seems like enough work to put off for later. * Only a few upstream packages have bugs that need working around: * `@mdx-js/loader`: mdx-js/mdx#2019 * `@automattic/components`: Missing dep on `@wordpress/base-styles`. And the next version will probably be unusable for us due to added `i18n-calypso`. * `@automattic/popup-monitor`: Missing dep on `events`. * markdown-it`: Missing dep on `punycode`. markdown-it/markdown-it#230 * `@samverschueren/stream-to-observable`: Outdated dep on `any-observable`. SamVerschueren/stream-to-observable#9 Hacking around that should also fix p1649254510834369-slack-CBG1CP4EN. * `fetch-mock`'s peer dep on `node-fetch` is optional, but only because they also allow running in-browser. It's required for node. * Added `webpack-cli` alongside `webpack` everywhere to make sure p1650571211251179-slack-CBG1CP4EN is fixed. Dropped Webpack entirely from Boost instead though, they don't use it. * Had our webpack-config package point to its own copy of `@babel/runtime` instead of making that a peer dep. * Jetpack's extensions tests use a ton of `@wordpress/` packages that weren't being directly depended on.
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
Boost plugin:
|
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.
This tests well for me, let's give it a try.
r244512-wpcom |
Great news! One last step: head over to your WordPress.com diff, D79551-code, and deploy it. Thank you! |
We've long had pnpm's public hoisting disabled, but it also privately hoists everything into `node_modules/.pnpm/node_modules/` for compatibility with packages that have undeclared dependencies. Let's disable most of that private hoisting and see what turns up. Changes of note: * We still hoist a bunch of eslint plugins (and one prettier plugin) as untangling that mess seems like enough work to put off for later. * Only a few upstream packages have bugs that need working around: * `@mdx-js/loader`: mdx-js/mdx#2019 * `@automattic/components`: Missing dep on `@wordpress/base-styles`. And the next version will probably be unusable for us due to added `i18n-calypso`. * `@automattic/popup-monitor`: Missing dep on `events`. * markdown-it`: Missing dep on `punycode`. markdown-it/markdown-it#230 * `@samverschueren/stream-to-observable`: Outdated dep on `any-observable`. SamVerschueren/stream-to-observable#9 Hacking around that should also fix p1649254510834369-slack-CBG1CP4EN. * `git-node-fs`: Missing peer dep on `js-git`. creationix/git-node-fs#8 * `fetch-mock`'s peer dep on `node-fetch` is optional, but only because they also allow running in-browser. It's required for node. * Added `webpack-cli` alongside `webpack` everywhere to make sure p1650571211251179-slack-CBG1CP4EN is fixed. Dropped Webpack entirely from Boost instead though, they don't use it. * Had our webpack-config package point to its own copy of `@babel/runtime` instead of making that a peer dep. * Jetpack's extensions tests use a ton of `@wordpress/` packages that weren't being directly depended on.
Changes proposed in this Pull Request:
We've long had pnpm's public hoisting disabled, but it also privately
hoists everything into
node_modules/.pnpm/node_modules/
forcompatibility with packages that have undeclared dependencies. Let's
disable most of that private hoisting and see what turns up.
Changes of note:
untangling that mess seems like enough work to put off for later.
@mdx-js/loader
:@mdx-js/loader
v1 does not work with yarn pnp or pnpm mdx-js/mdx#2019@automattic/components
: Missing dep on@wordpress/base-styles
.And the next version will probably be unusable for us due to added
i18n-calypso
.@automattic/popup-monitor
: Missing dep onevents
.: Missing dep on
punycode`.Library requires punycode but not in package.json markdown-it/markdown-it#230
@samverschueren/stream-to-observable
: Outdated dep onany-observable
.update any-observable SamVerschueren/stream-to-observable#9
Hacking around that should also fix p1649254510834369-slack-CBG1CP4EN.
git-node-fs
: Missing peer dep onjs-git
.fix: add missing optional peer dependency
js-git
creationix/git-node-fs#8fetch-mock
's peer dep onnode-fetch
is optional, but only becausethey also allow running in-browser. It's required for node.
webpack-cli
alongsidewebpack
everywhere to make surep1650571211251179-slack-CBG1CP4EN is fixed. Dropped Webpack entirely
from Boost instead though, they don't use it.
@babel/runtime
instead of making that a peer dep.@wordpress/
packages thatweren't being directly depended on.
Jetpack product discussion
None
Does this pull request change what data or activity we track or use?
No
Testing instructions: