Skip to content
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

[Feature] Use puppeteer-core as peer dependency instead of puppeteer #527

Closed
akornatskyy opened this issue Jul 17, 2021 · 5 comments · Fixed by #675
Closed

[Feature] Use puppeteer-core as peer dependency instead of puppeteer #527

akornatskyy opened this issue Jul 17, 2021 · 5 comments · Fixed by #675

Comments

@akornatskyy
Copy link

puppeteer-core package is a version of Puppeteer that doesn't download any browser by default.

It would be nice to use puppeteer-core as peer dependency.

puppeteer vs puppeteer-core.

@theomessin
Copy link

@berstend Bump

@berstend
Copy link
Owner

berstend commented Jul 7, 2022

Related discussion: #645

Given we now have playwright-extra as well being able to load puppeteer-extra plugins the best way seems to be using peer dependencies but marking all of them optional

@berstend
Copy link
Owner

berstend commented Jul 7, 2022

As initially suggested by @rtritto, adapting to our situation a solution could look like this:

All puppeteer-extra plugins (base plugin as well) get:

"peerDependencies": {
  "puppeteer-extra": "*",
  "playwright-extra": "*",
},
"peerDependenciesMeta": {
  "puppeteer-extra": {
    "optional": true
  },
  "playwright-extra": {
    "optional": true
  }  
}

(I don't think we can model an "either/or" thing here, so both optional seems like the best option)

playwright-extra gets playwright and playwright-core as both optional
puppeteer-extra gets puppeteer and puppeteer-core as both optional

@berstend
Copy link
Owner

berstend commented Jul 7, 2022

Just for context: both puppeteer-extra and (especially) playwright-extra support being used with non-standard API compatible implementations, that are not vanilla puppeteer or playwright, by using their addExtra exports.

So it makes sense to not force either of those as a hard dependency.

Also both frameworks will throw at runtime in case the default exports are used and no respective launcher package is found

@berstend
Copy link
Owner

berstend commented Jul 7, 2022

Fixed in [email protected] (#675)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants