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

TypeScript definition of protocol #18

Closed
paulirish opened this issue May 18, 2017 · 11 comments
Closed

TypeScript definition of protocol #18

paulirish opened this issue May 18, 2017 · 11 comments

Comments

@paulirish
Copy link
Member

paulirish commented May 18, 2017

I've seen a number of developers interested in this.

Currently, there is no officially maintained typescript definition file. We have no immediate plans to begin offering one, but I wanted to point at a great alternative from the community.

I recommend looking at these two projects:
➡️ @krisselden's chrome-debugging-client (see tot.ts)
➡️ @nojvek's chrome-remote-debug-protocol (see crdp.d.ts). (a fork by @roblourens is currently more maintained)

Comment edited March 2018

@JustinRyanH
Copy link

JustinRyanH commented May 19, 2017

I'm working on project to solve this. I'm open to forking off the section relating to Type definitions to it's own repo and collaborating. https://github.com/MajorHard/Enz/tree/proto_types

@krisselden
Copy link

krisselden commented May 19, 2017

https://github.com/krisselden/chrome-debugging-client already works well for automating Chrome, can run headless chrome just fine, just call spawn with additional --headless arg.

@paulirish what's missing? just an example of running a test?

@paulirish
Copy link
Member Author

@krisselden nothings really missing for me! was just sending folks your way for now.

@krisselden
Copy link

@paulirish I updated the tests on travis to use headless instead of the x virtual frame buffer https://travis-ci.org/krisselden/chrome-debugging-client and added it to the README example.

@JustinRyanH
Copy link

@krisselden I think I've confused chrome-debugg-protocol with your repo. Use the current work as a learning experience.

@auchenberg
Copy link
Contributor

Ping @nojvek @roblourens

@nojvek
Copy link
Contributor

nojvek commented Jul 21, 2017

I built a project a while ago that pulls in the protocol.json files from v8 and chrome repos and automatically generate crdp.d.ts files.

The generator lives here: https://github.com/nojvek/chrome-remote-debug-protocol/blob/master/src/protocolToCrdp.ts

@roblourens has a fork that pulls in specific versions of protocol.json and builds version specific crdp.d.ts for use in vscode chrome debugger and node inspector. https://github.com/roblourens/chrome-remote-debug-protocol/blob/master/src/main.ts

crdp.d.ts is promise based and works great with async await: https://github.com/nojvek/chrome-remote-debug-protocol/blob/master/lib/crdp.d.ts

Do note that chrome debugging protocol changes quite a bit, maintaining by hand will quickly get out of hand.

@Bnaya
Copy link

Bnaya commented Jul 29, 2017

It will be very useful to have @types package with the protocol declarations so all of the projects as chrome-remote-interface will depend on to create their own declarations.

What would be the name of such package?

@bbrzoska
Copy link

@Bnaya @types packages have to map to actual NPM packages.

@nojvek
Copy link
Contributor

nojvek commented Aug 10, 2017 via email

@paulirish paulirish mentioned this issue Sep 14, 2017
Closed
@paulirish
Copy link
Member Author

This has been contributed to the repo in #90

It's shipped in the npm package devtools-protocol@0.0.547074

Thanks @nojvek !

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

No branches or pull requests

7 participants