Repository navigation
test: rely on the ESLint rule instead of the browser import test - #3561
Merged
Lightning00Blade merged 1 commit intoNov 23, 2026
Merged
Lightning00Blade merged 1 commit into
Lightning00Blade merged 1 commit into
Conversation
Lightning00Blade
approved these changes
Nov 23, 2026
Lightning00Blade
force-pushed
the
chore/remove-browser-imports-test
branch
from
November 23, 2026 12:36
ffb2b9a to
0a9903d
Compare
Lightning00Blade
enabled stacked auto-merge
November 23, 2026 12:40
github-merge-queue
Bot
removed this pull request from the merge queue because a pull request earlier in the stack was removed
Nov 23, 2026
The @typescript-eslint/no-restricted-imports rule from the previous commit rejects value imports from third_party/browser.js in tool, config and telemetry modules. Remove tests/browser-imports.test.ts and fold the import graph walk back into cli-imports.test.ts, its only other user. Indirect imports through other modules are no longer checked. Refs #3427
Lightning00Blade
force-pushed
the
chore/remove-browser-imports-test
branch
from
November 23, 2026 13:23
0a9903d to
3194163
Compare
OrKoN
pushed a commit
to JasonOA888/chrome-devtools-mcp
that referenced
this pull request
Nov 23, 2026
…evTools#3566) Refs ChromeDevTools#3427 Stacked on ChromeDevTools#3561. Splits the `Mutex` bundle move out of ChromeDevTools#3563 so `BrowserManager` can drop value imports from `third_party/browser.js` in its own PR. Behavior doesn't change. ## What moved - **`Mutex`**: - Now re-exported from the light `src/third_party/index.ts` by its direct path (`puppeteer-core/internal/util/Mutex.js`) instead of `src/third_party/browser.ts`. `BrowserManager` uses `Mutex` in a field initializer. - `src/BrowserManager.ts`, `src/McpContext.ts`, and `src/NetworkOverrideManager.ts` import `Mutex` from `./third_party/index.js`, so it's exported in one place. ## Modules now in both bundles New with this PR, compared from the two metafiles (debug build): | Module | Size in index.js | Why it's safe | |---|---|---| | `puppeteer-core/…/util/Mutex.js` | 0.8 KiB | Each user creates its own `Mutex` instance. Nothing checks `instanceof Mutex`, and no instance is passed into Puppeteer. | | `puppeteer-core/…/util/Deferred.js` | 2.0 KiB | Imported by `Mutex.js`. `Mutex` only calls `Deferred.create()` without a timeout, so this copy never creates a `TimeoutError`. `Deferred` isn't exported from `index.ts`. | | `puppeteer-core/…/common/Errors.js` (tree-shaken part) | 0.3 KiB | Imported by `Deferred.js` for its timeout path, which `Mutex` doesn't use. `TimeoutError` is still exported only from `browser.ts`, so `instanceof` checks in tools keep using Puppeteer's class. | Already in both bundles from earlier PRs: `disposable.js`, `PredefinedNetworkConditions.js`, `StringUtilities.ts`, `Debouncer.ts`. ## Test plan - `npm run test tests/browser.test.ts tests/McpContext.test.ts tests/NetworkOverrideManager.test.ts tests/network_overrides.test.ts tests/third_party_notices.test.ts`. - `npm run format` and `npm run build`.
1 task
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.
Refs #3427
Follow-up to #3558. Stacked on #3558 in stack #3530.
What
#3558 adds an ESLint rule (
@typescript-eslint/no-restricted-imports) that rejects value imports fromthird_party/browser.jsinsrc/tools/,src/config/andsrc/telemetry/. This PR relies on that rule instead of the import-graph test:tests/browser-imports.test.tsand itstests/BUILD.gnentry.tests/importGraph.tshelper.tests/cli-imports.test.tswas its only other user, so the graph walk goes back inline there. That file is now identical to its version before refactor(telemetry): import flagUtils without the browser bundle #3518, so the CLI check behaves exactly as before.AGENTS.md: the "Third-party bundles" section now describes only the lint rule: it rejects direct value imports frombrowser.jsinsrc/tools/,src/config/andsrc/telemetry/.Known limitation
ESLint checks one file at a time and only sees direct imports. An indirect import through another module is no longer caught, for example
tools/memory.ts→formatters/HeapSnapshotFormatter.ts→third_party/browser.js. The removed test used to catch that case by walking the built import graph.Test plan
npm run format.npm run test tests/cli-imports.test.tsand the fullnpm run testpass.