Repository navigation
chore(puppeteer): upgrade to puppeteer v25.10.0 (Chrome 152) - #248
ruifigueira wants to merge 6 commits into
Conversation
Move submodules/puppeteer from puppeteer-v24.40.0 to puppeteer-v25.10.0 (Chrome 146 -> 152). Patch updates: - Rebase sessionId onto the new CdpBrowser._create/constructor parameters (blocklist, allowlist, logger). - BrowserConnector: keep the CDP-only Workers path, pass the logger, headers and wsOptions through to BrowserWebSocketTransport, and drop the new channel/DevToolsActivePort branch. - util: environment.value.fs is gone upstream. Write `path` output with a single environment.value.writeFile call in Workers. - cdp/Frame: import Realm from api/Realm.js, not the Node entry point. The old import pulled @puppeteer/browsers into the shipped types. Wrapper updates: - Provide the new environment file helpers (readFile, writeFile, openFileForWriting, createWriteStream, mkdir) from node:fs. - Mirror upstream _connectToCdpBrowser in connectToCDPBrowser and replace the removed debugError helper with debug(DEBUG_PREFIXES.error). - Give the top-level connect/launch/... exports explicit types so the declarations do not reference the Node entry point. - Follow the ESM-only output move from lib/esm/puppeteer to lib/puppeteer. - Bump devtools-protocol to 0.0.1666840 to match puppeteer-core. - copy_types: match the new ConnectOptions headers docs, hide wsOptions and drop the BiDi debug prefixes from the shipped declarations. - generate_worker_tests: upstream renamed *.spec.ts to *.test.ts. Update the exclude list and per-file rewrites, exclude the Node-only followSymlinks suite, alias ../mocha-utils.js for cdp/ suites, and drop sameParty from the cookie rewrites. beep-boop-🤖
State that @cloudflare/puppeteer needs Node.js compatibility: on by default for compatibility dates of 2026-08-04 or later, and the nodejs_compat flag for earlier dates. Also document that file options (screenshot/pdf/tracing `path`) use the Workers virtual file system. They need a compatibility date of 2025-09-01 or later, or the enable_nodejs_fs_module flag, and files written to /tmp exist only for the current request. beep-boop-🤖
picomatch skips dot segments for `**` by default. When the repository lives under a dot directory (for example ~/.herdr/worktrees/...), no path mapping matched and vite fell back to `[name].js`. The build then wrote the modules to lib/submodules/... and lib/packages/... instead of lib/puppeteer-core/... and lib/puppeteer-cloudflare/..., so the `./internal/*` export pointed at type declarations only. Set `dot: true` so the mappings match any absolute path. beep-boop-🤖
puppeteer v25 removed the deprecated Browser.isConnected() method (upstream f2cdffc4d4d). The keep_alive session test still called it, so it would fail at runtime with "browser.isConnected is not a function". wrangler bundles the tests without a type check, so test:bundle did not catch it. beep-boop-🤖
puppeteer-core v25 no longer uses the `debug` package (upstream 94d1e1c3dc8). Its Debug.ts uses util.debuglog in Node and console.log elsewhere. Nothing in the @cloudflare/puppeteer build imports `debug` now, so remove `debug` and `@types/debug` from the dependencies and drop the vite external. beep-boop-🤖
|
💬 Approved with comments — The skip-list update is correct. One WARNING remains (no tests for the new blocklist/allowlist path, a known gap the description already lists), plus INFO notes about a stale nested lockfile and files this pass did not re-check. Findings: 1 warning · 2 info The decision is advisory: this comment never approves, blocks or requests changes on the pull request. 🔧 Fix with your agentPaste the following into your coding agent to investigate and fix these issues. 📋 Code Quality:
|
|
npm i https://pkg.pr.new/cloudflare/browser-run/@cloudflare/puppeteer@5350cbbb51f38a47a1137b8184c0a27c01a27526Published by this workflow run. New pushes and reruns update this comment. |
puppeteer v25 renamed its test files from *.spec.ts to *.test.ts. The skip list matches on the full title, and the full title starts with the test file path, so none of the 129 entries matched any more. The full suite would run every test that the list is meant to skip. Rename the file part of each entry. Every entry still resolves to an existing file and test title in puppeteer-v25.10.0. Also skip four new v25 tests that Browser Run cannot run: - Two network restriction tests and one dialog test connect a second client with browser.wsEndpoint(). Browser Run connects through the binding and a session ID, so puppeteer.connect() rejects the options. The skip list already skips the OOPIF reconnect tests for this reason. - Page.record uses Page.startScreenRecording, which is not available before Chrome 153. Puppeteer's TestExpectations.json also expects this test to fail on Chrome. beep-boop-🤖
7755855 to
5350cbb
Compare
JIRA: BRAPI-1861
Summary
This PR upgrades
@cloudflare/puppeteerfrom puppeteer v24.40.0 (Chrome 146) to puppeteer v25.10.0 (Chrome 152). Browser Run moves to Chrome 152, and puppeteer v25.10.0 is the upstream release for that Chrome version.Changes
chore(puppeteer): upgrade to puppeteer v25.10.0: This commit movessubmodules/puppeteertopuppeteer-v25.10.0and rebasespatches/puppeteer.patch. It also updates the wrapper for the new environment file helpers, the ESM-only output path (lib/puppeteer) and the*.test.tsfile names. It bumpsdevtools-protocolto0.0.1666840.docs(puppeteer): document the Node.js compatibility requirement: The README tells you when Node.js compatibility and the Workers file system are necessary.fix(puppeteer): match output path globs inside dot directories: In a checkout under a dot directory, the build wrote modules tolib/submodules/.... As a result, the./internal/*export pointed only at type declarations. This problem is also onmain.test(puppeteer): use Browser.connected instead of isConnected(): v25 removedBrowser.isConnected(). Thekeep_alivesession test still called it.chore(puppeteer): drop the unused debug dependency: puppeteer-core v25 does not use thedebugpackage. Nothing in the build imports it.fix(puppeteer): update skipTests for the upstream v25 test suite: The skip list matches on the full test title, and the title starts with the file name. After the upstream rename, none of the 129 entries matched. Every entry still resolves to a test in v25.10.0. This commit also skips four new v25 tests:browser.wsEndpoint(). Browser Run connects through the binding and a session ID.Page.recordusesPage.startScreenRecording, which is not available before Chrome 153. Puppeteer'sTestExpectations.jsonalso expects this test to fail on Chrome.Breaking changes for users
These upstream v25 changes are visible to
@cloudflare/puppeteerusers:Browser.isConnected()is removed. Usebrowser.connected.MouseOptions.clickCountis removed. Usecount.samePartycookie attribute is removed.page.record()is new and experimental. It does not work on Browser Run before Chrome 153.The ESM-only change does not affect users, because the package was already ESM-only. The new Node.js minimum (22) applies only when you build this package.
I recommend
2.0.0for the next release. TheisConnected()removal breaks code at run time, and users on^1.xget it fromnpm update. This PR does not change the package version.Tests
npm run check:patch:puppeteer,npm run check:submodulesandnpm run build:puppeteerpass.npm run test:bundleandnpm --prefix tests run test-typespass inpackages/puppeteer-cloudflare.wrangler dev: 9 passed, 1 failed. The failed test isshould collect code coverage. It fails in the same way onmain, because the remote browser gets an error page from the test domain.keep_alivesession test passes. Tests from the skip list are reported as skipped.Known gaps
blocklistandallowlistare newconnect()options. The Workers connect path passes them to the browser, but no test covers this path. The upstream tests for these options need launch options orbrowser.wsEndpoint(), so they are skipped.packages/playwright-cloudflare/vite.config.tshas the same dot directory problem. This PR does not change it.beep-boop-🤖