Skip to content

chore: make TOON dependency optional - #2260

Merged
zyzyzyryxy merged 2 commits into
mainfrom
zyzyzyryxy/toon-peer-dependency
Jun 26, 2026
Merged

zyzyzyryxy merged 2 commits into
mainfrom
zyzyzyryxy/toon-peer-dependency

Conversation

@zyzyzyryxy

@zyzyzyryxy zyzyzyryxy commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Since toon dependency is only needed for --experimentalToonFormat flag, we can make it optional to decrease package size and security footprint for users that don't use it.

Testing npx optional peer dependency resolution before the release:

npm i -g verdaccio
verdaccio

On a separate terminal:

npm adduser --registry http://localhost:4873/
# follow prompts to create user and login

# replace the published package in verdaccio
npm unpublish [email protected] --force --registry http://localhost:4873
npm publish --registry http://localhost:4873

# clear npx cache
rm -rf ~/.npm/_npx

# run the server from commandline and observe both packages being installed:
npx --registry http://localhost:4873 --package chrome-devtools-mcp@latest --package @toon-format/toon chrome-devtools-mcp --experimentalToonFormat

Paste the following commands (each line separately) to manually interact with the mcp server and observe TOON formatted response directly

1. Initialize the session

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}

2. Confirm initialization

{"jsonrpc":"2.0","method":"notifications/initialized"}

3. Navigate to Google (this will already create snapshot in most recent versions)

{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"navigate_page","arguments":{"url":"https://google.com"}}}

4. Take Snapshot (if not returned by the previous command)

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"take_snapshot","arguments":{}}}

@zyzyzyryxy
zyzyzyryxy added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit e5bd334 Jun 26, 2026
39 of 43 checks passed
@zyzyzyryxy
zyzyzyryxy deleted the zyzyzyryxy/toon-peer-dependency branch June 26, 2026 08:26
samiyac pushed a commit to bcfmtolgahan/chrome-devtools-mcp that referenced this pull request Jun 29, 2026
Since toon dependency is only needed for `--experimentalToonFormat`
flag, we can make it optional to decrease package size and security
footprint for users that don't use it.

Testing npx optional peer dependency resolution before the release:
```
npm i -g verdaccio
verdaccio
```
On a separate terminal:
```
npm adduser --registry http://localhost:4873/
# follow prompts to create user and login

# replace the published package in verdaccio
npm unpublish [email protected] --force --registry http://localhost:4873
npm publish --registry http://localhost:4873

# clear npx cache
rm -rf ~/.npm/_npx

# run the server from commandline and observe both packages being installed:
npx --registry http://localhost:4873 --package chrome-devtools-mcp@latest --package @toon-format/toon chrome-devtools-mcp --experimentalToonFormat
```
Paste the following commands (each line separately) to manually interact
with the mcp server and observe TOON formatted response directly

### 1. Initialize the session


{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}
    
  ### 2. Confirm initialization
    {"jsonrpc":"2.0","method":"notifications/initialized"}
    
### 3. Navigate to Google (this will already create snapshot in most
recent versions)


{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"navigate_page","arguments":{"url":"https://google.com"}}}
    
  ### 4. Take Snapshot (if not returned by the previous command)


{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"take_snapshot","arguments":{}}}

---------

Co-authored-by: Piotr Paulski <[email protected]>
blackwell-systems added a commit to blackwell-systems/chrome-devtools-mcp that referenced this pull request Jun 30, 2026
Address review feedback from ChromeDevTools#2235:

1. Replace two boolean flags (experimentalToonFormat, experimentalGcfFormat)
   with a single --experimentalDataFormat=json|toon|gcf enum. The legacy
   --experimentalToonFormat flag still works via fallback for backward
   compatibility.

2. Make @blackwell-systems/gcf an optional peer dependency following the
   same pattern established for @toon-format/toon in ChromeDevTools#2260. Uses dynamic
   import() so the package is only loaded when the format is requested.

3. Resolve format choice into a single compactEncode function at the top
   of format(), eliminating the dual-boolean checks throughout.

4. Add @blackwell-systems/gcf to rollup externals.

5. Regenerate package-lock.json.
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