You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/skills/playwright-roll/SKILL.md
+16-20Lines changed: 16 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,21 +27,6 @@ The upstream documentation source of truth is `docs/src/api/*.md` in the playwri
27
27
28
28
> **The mistake the 1.59 roll made twice over:** classifying things as "internal tooling, N/A for Python" based on the *name* of the API (Screencast, Debugger, pickLocator, clearConsoleMessages, artifactsDir, …). Almost all of those had empty `langs: {}` in `api.json` and were real Python APIs. Sounding tooling-y is not a `langs` filter. **The `langs` field on the member in `api.json` is the only authoritative signal.** When in doubt, dump it (see "Verifying classifications" below).
29
29
30
-
## Pre-flight
31
-
32
-
You will need two checkouts in the parent directory:
33
-
-`~/code/playwright-python` — this repo.
34
-
-`~/code/playwright` — the upstream playwright monorepo (used read-only for diffing).
35
-
36
-
Bring upstream up to date and ensure release branches/tags are present:
There is sometimes no `vX.Y.0` tag for the latest release (the bots cut release branches first and tag later). Anchor on commits, not tags — see "Identify the commit range" below.
There is sometimes no `vX.Y.0` tag for the latest release (the bots cut release branches first and tag later). Anchor on commits, not tags.
74
+
79
75
The diff range is "every commit on the new release branch since the previous release was cut". Anchor commits:
80
76
81
77
-**Previous release end**: the `chore: bump version to vX.Y.0-next` commit on `main`. That commit is the first commit *after* the previous release (X.Y-1) was cut. Use its parent (`<sha>~1`) as the lower bound.
82
78
```sh
83
-
git -C ~/code/playwright log --all --grep="bump version to v" --oneline | head
79
+
git -C driver/playwright-src log --all --grep="bump version to v" --oneline | head
84
80
```
85
81
-**New release end**: the tip of `release-<new>` (or the matching tag if it exists).
86
82
87
83
Save the commit list, oldest first, scoped to `docs/src/api/`:
A normal roll yields 50–100 commits. If you see 0 or thousands, the range is wrong.
@@ -99,7 +95,7 @@ Format the file as a markdown checklist and add the standard preamble (status le
99
95
For each commit, in chronological order:
100
96
101
97
```sh
102
-
git -C ~/code/playwright show <sha> -- docs/src/api/
98
+
git -C driver/playwright-src show <sha> -- docs/src/api/
103
99
```
104
100
105
101
Look for:
@@ -144,7 +140,7 @@ A few rules of thumb that catch most "actually a PORT" cases:
144
140
145
141
#### PORT
146
142
147
-
Implement the change in `playwright/_impl/<module>.py`. Use the upstream JS implementation as a reference: `~/code/playwright/packages/playwright-core/src/client/<module>.ts`. Translate idioms:
143
+
Implement the change in `playwright/_impl/<module>.py`. Use the upstream JS implementation as a reference: `driver/playwright-src/packages/playwright-core/src/client/<module>.ts`. Translate idioms:
148
144
149
145
| Upstream JS | Python |
150
146
|---|---|
@@ -285,7 +281,7 @@ Class names use the upstream PascalCase (`BrowserContext`, `BrowserType`); metho
285
281
-**A cluster of suppressions on the same class is a smell.** If you're about to add five `Method not implemented: Foo.*` lines, you're almost certainly looking at a class that needs to be implemented. Implement the whole thing once and the suppressions disappear.
286
282
-**Watch for revert pairs in the same range.** 1.59 added and reverted `Browser.isRemote` (#39613 / #39620) inside the same release. Walking chronologically lets you skip the add when you see the revert later.
287
283
-**Watch for rename-revert pairs.** 1.59 had `Locator.normalize` → `Locator.toCode` (#39648) → `Locator.normalize` (#39754). Final state wins; only port the last.
288
-
-**Doc renames almost always include a wire-protocol rename.** Whenever you see `### param: X.y.oldName` → `### param: X.y.newName` in a doc commit, also `git -C ~/code/playwright show <sha> -- packages/protocol/src/protocol.yml` and the corresponding `*Dispatcher.ts` file. If the wire field changed too, the channel-send dict key in `_impl/` must change. Suppressing the doc-side mismatch is hiding a real bug — the previous Python code is silently sending an unknown field that the new server ignores.
284
+
-**Doc renames almost always include a wire-protocol rename.** Whenever you see `### param: X.y.oldName` → `### param: X.y.newName` in a doc commit, also `git -C driver/playwright-src show <sha> -- packages/protocol/src/protocol.yml` and the corresponding `*Dispatcher.ts` file. If the wire field changed too, the channel-send dict key in `_impl/` must change. Suppressing the doc-side mismatch is hiding a real bug — the previous Python code is silently sending an unknown field that the new server ignores.
289
285
-**TypedDicts beat `Dict[str, X]` for any structured return.** When the docs describe a return as `[Object]` with named fields (or even `[Object=Foo]`), define a `TypedDict` in `_api_structures.py`, re-export from both public `__init__.py` files, and use it. Zero runtime cost (it's still a `dict`), and the doc generator's type comparator matches by structure via `get_type_hints`.
290
286
-**Positional renames are free.** A param with no default before any `*` separator is positional-or-keyword in Python, but realistic call sites pass it positionally. Renaming such a param doesn't break callers.
291
287
-**The "Backport changes" GitHub issue can be misleading.** In the 1.59 roll its checkboxes were all marked `[x]` with annotations like "✅ IMPLEMENTED", but several of those features had not actually been merged into the Python port. Trust the `docs/src/api/` walk over the issue.
0 commit comments