Skip to content

chore(codegen): generate the public TypedDicts from the docs - #3247

Open
Pavel Feldman (pavelfeldman) wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:codegen-structs
Open

Pavel Feldman (pavelfeldman) wants to merge 1 commit into
microsoft:mainfrom
pavelfeldman:codegen-structs

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • The generator now writes playwright/_impl/_api_structures.py from the docs, nested structs included. The internal types move to the hand-written _impl/_internal_structures.py.
  • python_rules.js names the nested storage state structs and keeps the shipped total= of 5 TypedDicts (structTotal).
  • legacy_order.json keeps today's class order, so the diff shows only the moved internal types and the order inside the DropPayload.files union. compare_api.py now compares TypedDicts too and finds no difference.

- 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.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant