-
Notifications
You must be signed in to change notification settings - Fork 195
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
Use Bikeshed pre-processor for WebDriver #1462
Comments
Does doing this have support among the editors and others impacted? I've done some conversions to Bikeshed before, am pretty good at vetting for unintended differences, and might volunteer if it's likely to be accepted. |
Both @shs96c and I don't mind what tool is used. I am happy for it to be moved over, I just haven't prioritised this work |
I'd be happy to take a stab at this. There are 11 open pull requests in https://github.com/w3c/webdriver/pulls right now, and rebasing them will be an entirely manual affair. Are there any that can be merged or closed to reduce the amount of work needed? |
@foolip it would be great if this protocol could be machine readable as it would simplify the creation of rudimental bindings that can be used to build a framework with higher level abstractions as well as for documentation. For example: the Chrome DevTools protocol is maintained as a pure json file and is used to build its documentation page as well as CDP modules like chrome-remote-interface. This can safe a lot of time and duplication for adopters building packages around the protocol. Another example is from the WebdriverIO project where I've defined a custom JSON format of the WebDriver spec that is used to autogenerate a minimal functional binding. While I think a spec text is not necessarily suited as user documentation - being able to have the ability for type checks especially in the JS ecosystem would be very beneficial. A while ago I tried to convert the current WebDriver protocol into an OpenAPI spec and was able to generate a page like this: https://webdriver.github.io/webdriver/. I can imagine that it should be not that difficult to build a bikeshed pre processor that reads an OpenAPI spec and coverts it into a spec document. I would be happy to help contribute and drive the effort for a machine readable spec if you all think it is worthwhile. |
I played around with OpenRPC when writing the explainer. There's an example here. I ran into some minor issues. The spec supports only one-way calls (no concept of bidi) so I ended up using tags to mark things as either "events" or "commands". The tooling support also seems pretty limited. There's a code gen tool but this supports only TypeScript and Rust at the moment. AsyncAPI looks promising instead. It's more generic and can express both HTTP and WebSocket transports in the same file. It also has proper support for bidi communication through "channels". |
In the initial conversion for this I'd try to have as few visual and markup changes possible, as looking for differences is the best way to catch mistakes. I wouldn't want to make any deliberate change at all, even typo fixes, in that initial change. @christian-bromann @bwalderman I suspect you're mostly interested in machine readable for bidi, right? Can you file an issue for that? If you'd like the main webdriver spec to also be more machine readable, an issue for that would be great too. |
I've filed #1510 and w3c/webdriver-bidi#21 for machine readable definitions for the REST and BiDi protocols, respectively. |
Per discussion in speced/bikeshed#1682. This is mainly to minimize changes in #1462.
Per discussion in speced/bikeshed#1682. This is mainly to minimize changes in #1462.
Discovered as part of w3c#1462. It doesn't matter in ReSpec because the <section> nesting level is used, but Bikeshed does not use the HTML outline algorithm: https://tabatkins.github.io/bikeshed/#table-of-contents
Discovered as part of w3c#1462. It doesn't matter in ReSpec because the <section> nesting level is used, but Bikeshed does not use the HTML outline algorithm: https://tabatkins.github.io/bikeshed/#table-of-contents
Discovered as part of #1462. It doesn't matter in ReSpec because the <section> nesting level is used, but Bikeshed does not use the HTML outline algorithm: https://tabatkins.github.io/bikeshed/#table-of-contents
I'd like to ask the input of regular WebDriver spec contributors about ID stability. Given a definition like Preserving all IDs is possible, but would make the source fairly verbose. I'd therefore like to suggest allowing a lot of IDs to change, while making an effort to not break links. One thing we can do is create a mapping of IDs to be checked client-side in JS. HTML does some stuff like this. The most important thing is to not break links from other specs. Using reffy-reports and Bikeshed's tests there are the specs that link to WebDriver that I can find:
My questions:
|
Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.)
Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.)
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 UltraBlame original commit: 4ea9d35d56d9cba2e0711df3986b340168bed03c
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794 UltraBlame original commit: ed8cbf0c075c028dded58fa3192cd8965f9f37a0
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794 UltraBlame original commit: 6572082b695a7a149a6a715b1cb26f9982ec394b
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 UltraBlame original commit: 4ea9d35d56d9cba2e0711df3986b340168bed03c
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794 UltraBlame original commit: ed8cbf0c075c028dded58fa3192cd8965f9f37a0
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794 UltraBlame original commit: 6572082b695a7a149a6a715b1cb26f9982ec394b
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 UltraBlame original commit: 4ea9d35d56d9cba2e0711df3986b340168bed03c
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794 UltraBlame original commit: ed8cbf0c075c028dded58fa3192cd8965f9f37a0
…he WebDriver spec, a=testonly Automatic update from web-platform-tests [webdriver] normalize and fix links to the WebDriver spec (#23911) Spotted while looking for incoming links to the spec: w3c/webdriver#1462 (comment) (#dfn-set-window-rect changed to #set-window-rect for consistency, not to enable the ID to be changed.) -- wpt-commits: 5d0dcf0142d07916584db9c76c2fdec02833e959 wpt-pr: 23911 Differential Revision: https://phabricator.services.mozilla.com/D78794 UltraBlame original commit: 6572082b695a7a149a6a715b1cb26f9982ec394b
So, obviously I'm super biased (as I maintain ReSpec), but I don't see any advantage to using BS over ReSpec. ReSpec supports the same cross referencing features are BikeShed, and it's really a group's choice if they enable GitHub pages or not for a spec (you don't need to use a browser to transform the output - or let anyone in a browser view ReSpec document... you can generate a static snapshot in exactly the same manner as BikeShed does). |
I would like to propose converting the specification to use the Bikeshed spec pre-processor.
Bikeshed produces specification documents that are equivalent to ReSpec that we currently use, but instead of transforming the source document at load-time (through content JavaScript) it pre-processes the source document into a complete, finished HTML document as a build step.
As many of you know I have a distaste for hard-to-explain build steps and a love for the mutable what-you-see-is-what-you-get web, so I am not the natural proponent of this kind of change. But I have come to the realisation that some of the forthcoming changes we need to make for the bi-directional protocol would be easier to tackle if we can run tasks as build steps.
One of the takeaways from TPAC 2019 in Nagoya, Japan was that we need to make WebDriver more discoverable for web authors, client maintainers, and browser developers. There are various things we could do, but I believe the most effective is to make the specification machine-readable.
With the proliferation of APIs that we expect to see with the bi-directional work, we will be moving from a human-managable set of endpoints to a reality where computer automation would be necessary to assist with ingesting changes. Having formalised schema definitions for the different interfaces, methods, and types will enable wider and earlier adoption of new APIs because the specification is offering a useful service to implementors.
Now to the point of this issue and why it means we need a pre-processor:
I picture that the schemas should be defined in separate files/artifacts, rather than be inlined in the source spec document. This would allow generation of API documentation (using Swagger or something equivalent) to serve as client maintainer documentation, MDN browser compat data and API documentation, and—most importantly!—generation of source files ready for use in browser implementations (for example into C++ or Rust) for schema validation, or local-end clients (Go/C#/Java).
With schema definitions as separate artifacts, ingesting them into the document would require a build step. We could hack together the inlining of interfaces for ReSpec with m4(1) or sed(1), but if there’s already a necessity to add a build step it would seem more obvious to adopt a spec authoring tool that already supports inclusion of files.
Here are some arbitrary examples of Bikeshed-backed specs from W3C, WHATWG, and non-affiliated:
Pros:
Cons:
Overall I don’t think the change should impact our workflow too much.
The text was updated successfully, but these errors were encountered: