Repository navigation
chore(codegen): use alphabetical order in the generated API - #3242
Open
Pavel Feldman (pavelfeldman) wants to merge 2 commits into
Open
Pavel Feldman (pavelfeldman) wants to merge 2 commits into
Pavel Feldman (pavelfeldman) wants to merge 2 commits into
Conversation
Pavel Feldman (pavelfeldman)
force-pushed
the
codegen-docs-order
branch
from
October 12, 2026 21:59
36e501f to
69f5d71
Compare
- The generator writes playwright/_impl/_api_structures.py (`--flavor structs`): every struct that the API uses, nested ones included. update_api.sh runs it. - The internal types move to the hand-written playwright/_impl/_internal_structures.py. - python_rules.js names the nested storage state structs, and keeps the shipped `total=` of 5 TypedDicts (structTotal). - compare_api.py compares TypedDicts. Against the hand-written file it finds no difference; the text diff only reorders the DropPayload.files union. - legacy_order.json keeps the hand-written class order, so that the diff is small.
- Removes scripts/codegen/legacy_order.json and the code that applied it. - Classes, members, keyword-only parameters, events and TypedDicts are in alphabetical order; a class comes after the class that it extends or uses. Positional parameters, union members and TypedDict fields keep the docs order. Docstrings are wrapped after member links are rendered. compare_api.py shows no other difference. - The roll skill, ROLLING.md, CONTRIBUTING.md and update_api.sh now ask for a microsoft/playwright checkout used only for rolls, on the exact release-<new> branch, and list the checks that it is on that branch, clean, and up to date with origin.
Devin Rousso (dcrousso)
approved these changes
Oct 13, 2026
Pavel Feldman (pavelfeldman)
force-pushed
the
codegen-docs-order
branch
from
October 13, 2026 00:20
69f5d71 to
3c73fff
Compare
Dmitry Gozman (dgozman)
approved these changes
Oct 13, 2026
| * change the driver pin in `DRIVER_VERSION` (the `playwright-core` npm version, e.g. `1.61.0`) and refresh `NODE_VERSION`: `python scripts/update_node_version.py` | ||
| * download the new driver: `python -m build --wheel` (fetches `playwright-core` via `npm pack` + the matching Node.js binary and assembles the bundle; no source build). | ||
| * generate API from the docs (needs a nearby `microsoft/playwright` checkout at the release branch for the new version, e.g. `release-1.64`): `PW_SRC_DIR=../playwright ./scripts/update_api.sh` | ||
| * generate API from the docs. This needs a separate `microsoft/playwright` checkout used only for rolls, on the exact release branch for the new version (e.g. `release-1.64`), clean and up to date with `origin`: `PW_SRC_DIR=../playwright-for-python ./scripts/update_api.sh` |
Contributor
There was a problem hiding this comment.
I do not plan to have a "separate checkout used only for rolls"!
This branch has not been deployed
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
scripts/codegen/legacy_order.jsonand theTEMPORARYcode. Classes, members, keyword-only parameters, events and TypedDicts are now in alphabetical order; a class comes after the class it extends or uses.compare_api.pyagainst chore(codegen): generate the public TypedDicts from the docs #3247 shows only keyword-only order and docstring differences.microsoft/playwrightcheckout on the exactrelease-<new>branch, and list checks that it is on that branch, clean and up to date.