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
feat: make it possible to run install.js
script with puppeteer-core
#5325
Merged
mathiasbynens
merged 4 commits into
puppeteer:master
from
gziolo:update/puppeteer-core-install
Jan 28, 2020
Merged
feat: make it possible to run install.js
script with puppeteer-core
#5325
mathiasbynens
merged 4 commits into
puppeteer:master
from
gziolo:update/puppeteer-core-install
Jan 28, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Jan 20, 2020
gziolo
commented
Jan 20, 2020
mathiasbynens
approved these changes
Jan 27, 2020
Co-Authored-By: Mathias Bynens <mathias@qiwi.be>
As you point out, this makes |
Added with 601a571 👍 |
This was referenced Apr 13, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
At the moment, when you set
puppeteer-core
as a dependency of your project, you won't have Chromium installed as part ofnpm install
run. This is great. However, the existing setup prevents 3rd party tools to runinstall.js
script, which might be desired in some scenarios.We see the growing number of complaints about Chromium download in
@wordpress/scripts
(A set of reusable scripts tailored for WordPress development) package which for many use cases is not necessary when you don’t want to use e2e tests. Some projects decide to not use this package because of the time and size factors introduced by the installation process of Chromium. We are seeking for a way to make it a non-issue. The idea is to usepuppeteer-core
and useinstall.js
script only when someone opts-in for the e2e script and actually runs it.Related Issues
Sharing some issues from the WordPress project, which triggered this proposal:
Solution
Update
utils/prepare_puppeteer_core.js
to removeinstall
fromscript
sectionpackage.json
forpuppeteer-core
. This is nearly identical to the current configuration but opensinstall.js
for usage frompuppeteer-core
. At the same time, it would become a public API, so the project would have to maintain it.It will allow starting using
puppeteer-core
as a dependency in the@wordpress/scripts
package intended to offer zero-config reusable scripts for WordPress development. This way, folks who don't use Puppeteer in their workflows won't complain about the install process of Chromium. Instead, it should be possible to install Chromium on demand, when the script which needs it would run for the first time. The update could run whenever the version changes as part of the regular run as well.The only inconvenience would be that other dependency which set
puppeteer
as a peer dependency would warn. Still, it's something that can be ignored and listed in the docs in the troubleshooting section.Open Question
Should the same change get applied to
puppeteer-firefox
? I see this guard clause:puppeteer/experimental/puppeteer-firefox/install.js
Lines 19 to 20 in 14b2369
However, it's not clear for me how it would work with
puppeteer-core
.