Repository navigation
chore: generate typed protocol channels and use them in _impl - #3264
Merged
Pavel Feldman (pavelfeldman) merged 2 commits intoOct 16, 2026
Merged
Conversation
- Generate typed channels (_protocol_channels.py) and message types (_protocol_types.py) from the protocol spec, like upstream's channels.d.ts. Each command is a method with the protocol parameters and no defaults; each event has on<Event>/off<Event>. Absent optional fields are None. - Implementation methods take the Python names that the generated API passes, with no defaults, and send through the typed channels. locals_to_params is gone. mypy now reports each place that must pass a new protocol parameter or option. - Fix bugs found on the way: WebSocketRoute close handlers raised KeyError, locator.dblclick(steps=) raised TypeError, file drops failed on remote browsers, Locator.wait_for leaked handles, Locator.clear was not strict, and unknown keys such as noWaitAfter were sent.
Also fix the generator header and the roll skill, which still described the params dicts.
Yury Semikhatsky (yury-s)
approved these changes
Oct 16, 2026
Pavel Feldman (pavelfeldman)
merged commit Oct 16, 2026
9d198c0
into
microsoft:main
28 of 29 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_protocol_channels.py) and message types (_protocol_types.py) from the protocol spec, like upstream'schannels.d.ts: one method per command with the protocol parameters and no defaults,on<Event>/off<Event>per event. Absent optional fields areNone.locals_to_paramsis gone. mypy now reports each place that must pass a new protocol parameter or option.WebSocketRouteclose handlers raisedKeyError,locator.dblclick(steps=)raisedTypeError, file drops failed on remote browsers,Locator.wait_forleaked handles,Locator.clearwas not strict, and unknown keys such asnoWaitAfterwere sent.