-
Notifications
You must be signed in to change notification settings - Fork 814
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
Dependencies: Fix broken prod dependencies #13343
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
This is an automated check which relies on |
Yes, that's the exact reason why I was adding those as devDeps. |
Not entirely sure I'm following the rationale here. Should it not be enough to keep them as |
Yes, if we drop the production-only installation it doesn't matter where dependencies are declared. I'd remove For an application like Jetpack which isn't a published package, there's no clear distinction about what dependencies and devDependencies are. It's one set of dependencies and a superset of those, we can make an arbitrary decision between dependencies and devDependencies. At runtime, we don't need any dependencies. @zinigor mentioned that some devDependencies are large, take a lot of time and space to install, and cause problems with the beta builder. That would mean that one place we can make the |
Okay, sounds like a good approach! 👍 |
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.
It works well as is. Merging.
Changes proposed in this Pull Request:
devDependency
installation (save some time in an infrequent process) and it leads to issues that only occur when making the production bundle.This was working because
@wordpress/url
is installed as a transitive dependency,@wordpress/e2e-test-utils
(a devDependency) causes it to be installed. If@wordpress/e2e-test-utils
(like withyarn install --production
) -@wordpress/url
is not installed.I believe, this is only a problem with extensions that have "SSR" from the implementation in #13070, at the moment only Simple Payments. At runtime in the browser,
@wordpress/*
dependencies are externals, meaning they are pulled from the runtime environment. That makes the presence or absence of a@wordpress/*
package irrelevant. However, with #13070 SSR, some of these dependencies will be required at build time.See p1566905517230900-slack-luna / d871cf9
Testing instructions:
yarn build-production
builds without errors.