Skip to content

chore: translate the client from the Node.js client line by line - #2067

Open
Yury Semikhatsky (yury-s) wants to merge 29 commits into
microsoft:mainfrom
yury-s:rewrite-oneshot
Open

Yury Semikhatsky (yury-s) wants to merge 29 commits into
microsoft:mainfrom
yury-s:rewrite-oneshot

Conversation

@yury-s

@yury-s Yury Semikhatsky (yury-s) commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Every client class in impl is now a line-by-line translation of its file in packages/playwright-core/src/client/ (same member order, upstream names, // Port of <file>.ts. header, // java: notes where Java differs), so a roll applies the upstream diff at the same place. Includes the leaf classes of chore: port the leaf classes of the client from the Node.js client #2059.
  • Helper files are ported too: Serialization follows serializers.ts; Headers, StringUtils, MimeType, Time, LocatorUtils live in impl.isomorphic; LongStandingScope, LocalUtils, ClientHelper, FileUtils follow their upstream files; Utils keeps only Java-specific helpers. Dead code is removed.
  • Not line by line, marked in the code: synchronous route handlers, Connect/JsonPipe (the connection pulls messages), UrlMatcher (globs are converted by the driver). The assertion classes are not retranslated yet.

Behaviour that now follows upstream

  • connectOverCDP defaults to a 30 s timeout (was 180 s).
  • APIRequestContext.get/post/... always send their own method, even after RequestOptions.setMethod.
  • Response.finished() waits for the page to close when the request fails after its response; APIResponse.ok() is true for 200-299 only.
  • A null header value throws Expected value of header "x" to be String, but "object" is found.
  • route.fulfill with a path takes the content type from the upstream table; the stack files of a trace go to tracesDir.
  • Long, Float, Throwable and primitive arrays serialize as evaluate arguments (byte[] as Int8Array).
  • Upstream error texts for maxRedirects, a missing upload file and an unsupported argument; four java: fixmes are dropped.

…ch, tracing and browser classes from the Node.js client
Serialization follows serializers.ts; Headers, StringUtils, MimeType, Time and LongStandingScope
follow their isomorphic files; LocalUtils, ClientHelper and FileUtils are completed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd tune the prompt a bit to keep as close to l2l as possible, even if that means that we are adding unused methods and implement features that were missing in the port.

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.

2 participants