-
Notifications
You must be signed in to change notification settings - Fork 29
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
Please publish instructions about how to update the API bindings to the latest version #17
Comments
Thank you for the issue that this crate holds. The update went as follows
types.json is a temporary file extracted from api.json to improve the type generation in gen.rs I don't know if it will work though, since api.json is often changed and the directory structure of playwright is also changed. |
Thanks for your fast response, @octaltree!
Will I get compiler error messages for all the missing things, or do I need to figure this out myself (e.g. by comparing the generated API to some API docs) ?
It seems, this doesn't work anymore (probably because api.json isn't bundled anymore). Cloning 'https://github.com/microsoft/playwright', and running |
I will add some notes to this issue, in case others want to contribute to this repo. The issue that I've opened in the 'playwright' repo (linked above), might be interesting, too.
The version can be found in setup.py (search for 'driver_version = ').
As mentioned above,
|
This rust binding is something I'm doing on my own. I don't want it to be a conscious hindrance to the original. The author of Ruby Binding is really enthusiastic and keeps up with the latest. It is inevitable that there will be changes in the schema of the interface definition json. It's not that I've abandoned it, but it's become less of a priority because I don't find playwright clients as attractive as I used to. At the time of starting development, rust-headless-chrome had stopped being updated and chromiumoxide did not exist. |
Don't worry, @octaltree. I know a binding like this is a lot of work to keep up-to-date. I hope you don't think that I'm criticizing you or anything. I just wanted to share my notes with other people who might want to contribute to this project. For example, so that people don't have to search for the version of the current driver, and just can open the file that contains it via the link I've posted above. |
I just tried to generate the interface. sed 's/1.11.0-1620331022000/1.16.0-next-1634703014000/' -i src/build.rs
rm -r /tmp/build-playwright-rust # remove download cache
rm -r ~/.cache/ms-playwright/playwright-rust/driver # remove runtime driver
cd scripts
make ../src/api/api.json # success
make ../src/api/generated.rs # thread 'main' panicked at 'internal error: entered unreachable code', src/gen.rs:335:22 |
The reason why I'd like to use Playwright is because it has more features than 'rust-headless-chrome' and 'chromiumoxide'. However, a comment from one of the Playwright maintainers in the issue I've linked above discouraged me a bit to work on a Rust binding for Playwright. Tomorrow I'll think about if I shouldn't better focus on contributing to 'rust-headless-chrome' or 'chromiumoxide'. A DevTools protocol client also seems easier to maintain because there is a machine-readable definition of the protocol that can be used to generate the complete Rust API. It seems with Playwright this isn't possible and its required to implement parts of the API by hand (e.g. derive it from the Python client). Not needing to package a node.js environment is also a great advantage. |
Hi,
It would be great, if you would publish some instructions about how to update this crate to the latest Playwright version, and how to contribute to this crate in general if there is a new feature in Playwright that the code generator doesn't cover.
Since the last release of this crate on crates.io, Playwright has released many new versions.
My assumption is therefore, that this crate isn't up-to-date anymore, and I'm a bit worried about using it.
Therefore, I'd like to know how to update this crate to the latest Playwright version locally.
I've seen, that there are some "scripts" that generate code, so I guess the workflow isn't too complicated.
A short step-by-step guide would still be useful, however.
For example, lets say Playwright adds a new function or class – would this somehow automatically be covered by the code generator? Or would I have to change the code generator?
Or: There is a "scripts/types.json" – where does this file come from? I guess I'd have to get or generate the latest version of this file.
Thanks for publishing this crate!
The text was updated successfully, but these errors were encountered: