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! 👍 |
jeherve
left a comment
There was a problem hiding this comment.
It works well as is. Merging.
Changes proposed in this Pull Request:
devDependencyinstallation (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/urlis 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/urlis 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-productionbuilds without errors.