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
update puppeteer to use the its generated cdp protocol types #40432
Conversation
@@ -15,6 +15,9 @@ | |||
|
|||
import { EventEmitter } from "events"; | |||
import { ChildProcess } from "child_process"; | |||
// @ts-ignore: suppress error if using an older version of puppeteer, which don't |
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.
The goal here is to not force users to update puppeteer - these types are for power users, so shouldn't force everyone to update. If these are missing, the CDPSession types use a sensible fallback of method: string | number | symbol and params: any, which isn't much different from the previous.
Unfortunately there doesn't seem to be a way to disable this rule. I tried:
// tslint:disable-next-line ban-ts-ignore
// tslint:disable-next-line ts-ignore
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.
I'd kindly ask you to way until my puppeteer 2.0 PR lands #40284
I'm currently working on it.
OT: This feels pretty hacky, if you really want to support TS as first class, why not move the project to TS all together?
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.
Porting puppeteer to TS would be a huge effort.
Yeah it's pretty hacky - I think the "don't force to update for no benefit" constraint can be avoided if we 1) wait for next puppeteer version to be released (@mathiasbynens, maybe we could do a patch release?), which will have this protocol file published and 2) tack this change onto your PR, setting the minimum version to the next (unreleased 2.0.1) version
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.
@connorjclark iirc the // Type definitions for PACKAGE MAJOR.MINOR
line does not support specifying patch versions (which makes sense since the public API shouldn't change).
I think it would be reasonable to do a minor release in this case.
This doesn't need to land until puppeteer/puppeteer#5174 is published - I'll comment on this PR when it's ready. |
@connorjclark Thank you for submitting this PR! 🔔 @marvinhagemeister @cdeutsch @ksm2 @SimonSchick @serbanghita @JasonKaz @davecardwell @angrykoala - please review this PR in the next few days. Be sure to explicitly select If no reviewer appears after a week, a DefinitelyTyped maintainer will review the PR instead. |
@connorjclark The Travis CI build failed! Please review the logs for more information. Once you've pushed the fixes, the build will automatically re-run. Thanks! |
👋 Hi there! I’ve run some quick measurements against master and your PR. These metrics should help the humans reviewing this PR gauge whether it might negatively affect compile times or editor responsiveness for users who install these typings. Let’s review the numbers, shall we? Comparison details 📊
It looks like nothing changed too much. I won’t post performance data again unless it gets worse. |
@connorjclark I haven't seen anything from you in a while and this PR currently has problems that prevent it from being merged. The PR will be closed tomorrow if there aren't new commits to fix the issues. |
@connorjclark To keep things tidy, we have to close PRs that aren't mergeable but don't have activity from their author. No worries, though - please open a new PR if you'd like to continue with this change. Thank you! |
Please fill in this template.
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If changing an existing definition:
tslint.json
containing{ "extends": "dtslint/dt.json" }
. If for reason the any rule need to be disabled, disable it for that line using// tslint:disable-next-line [ruleName]
and not for whole package so that the need for disabling can be reviewed.