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

deps: defer to pptr for devtools-protocol version #12534

Closed
wants to merge 1 commit into from
Closed

Conversation

brendankenny
Copy link
Member

As mentioned in #12284, we risk issues with two sets of protocol definitions active in our type system. There's a performance issue (the types are big and we do lots of unioning and narrowing of them...having two of them would mean we'd also do type comparisons of the giant unions/narrowings of two different versions of the protocol), but if the types drift too much we'll also get type errors.

Those errors happen today at the fraggle rock session boundaries if you do yarn add -D devtools-protocol@latest to get the latest version of the protocol vs what's currently shipped in puppeteer (release from April 6).

I suggested in the last PR that if we are going to go all in on puppeteer for our protocol provider, then we should just defer to them for the protocol version. An easy way is to just use the same version number as them, which this PR is doing, but that's kind of annoying to remember to update every time we bump puppeteer (I guess we could add a CI check).

I was hoping another approach would be to have our version float on devtools-protocol@*, but yarn doesn't show any interest in updating that when you change the other version in the transitive dependency.

Anyone else have ideas or completely different approaches to stay in sync?

@brendankenny brendankenny requested a review from a team as a code owner May 21, 2021 20:07
@brendankenny brendankenny requested review from connorjclark and removed request for a team May 21, 2021 20:07
@google-cla google-cla bot added the cla: yes label May 21, 2021
version "0.2.1"
resolved "https://registry.yarnpkg.com/@firebase/util/-/util-0.2.1.tgz#b59a2fbf14fce21401cbebf776a3e0260b591380"
integrity sha512-KPNcIK5+bUUBMII87NqGu+tRUnMcY95xujS2z0QyAfoQCKe11DMHICv3M6uweiLSXqdQwrMTyFtiql1q+0UOYQ==
"@firebase/[email protected]":
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this was just a drive by vulnerability-warning dependency update. We only use this for types for a devDep in viewer/treemap, but w/e dependabot)

@connorjclark
Copy link
Collaborator

connorjclark commented May 21, 2021

Can we override the version puppeteer has to equal what we have?

"resolutions": {
      "puppeteer/**/devtools-protocol": "0.0.863986",
}

@brendankenny
Copy link
Member Author

Can we override the version puppeteer has to equal what we have?

"resolutions": {
      "puppeteer/**/devtools-protocol": "0.0.863986",
}

yeah, I guess this is strictly better. It still requires looking in two places to keep things in sync, but at least this approach keeps everything in package.json and doesn't have one reference deep in yarn.lock :)

@brendankenny
Copy link
Member Author

One issue is incompatibility with puppeteer types (e.g. a pptr function that depends on a particular protocol type that's not in our resolved version) but I don't know how probable that is. I guess we can see if we run into it.

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

Successfully merging this pull request may close these issues.

3 participants