Proposal: some improvements, and how to track them

未關閉
#9 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
5/5
預估耗時
一週以上
新手友好度
12/100
Issue 類型
功能
描述清晰度
需要釐清
活躍度
活躍
技術堆疊
nodejs, typescript
領域
cli, devtools

研究方向

This is a maintainer-approval proposal, not a single task, so do not start a patch from it. Before any work, the maintainer needs to agree on which items to take and how to split them. The items name the insights, navigations, tasks, profile and scan commands, and scan uses fs.globSync. A useful first step is to reproduce one of the listed bugs and ask in the thread which item to pick.

由索引模型根據 Issue 內容生成。

描述

Hi @jackfranklin,

I've been using trace-engine-cli and spent some time going through the codebase. I have a list of possible improvements. Before opening a batch of issues, I'd like to check which ones make sense to you and how you prefer to handle them.

Bugs (reproduced locally)
  • insights and navigations silently ignore --time-range. The option is global, so both commands accept it and return data for the full trace.
  • insights reports navigationId: null even when it uses the first InsightSet.
  • Numeric options are not validated. tasks --top -5 and profile --bucket 0 return empty results with exit code 0, which an agent reads as "nothing found".
  • scan silently skips files it cannot decompress or parse. With a directory containing one valid trace, one truncated .json and one corrupt .json.gz, scan <dir> --grep RunTask reports totalFilesScanned: 3, totalFilesMatched: 1 and exits 0 with no warning, so a broken file looks the same as a file with no matches.
Features
  • compare <baseline> <candidate>: compare two traces (CWV deltas and rating changes, main thread busy time, long tasks, top function regressions). Useful for before/after checks on a PR.
  • Cover more insight models. insights exposes 5 of the 19 models in the engine (ForcedReflow, DOMSize, LCPDiscovery, DocumentLatency, ImageDelivery and FontDisplay are missing, among others). Exposing state and metricSavings would also help agents prioritize.
  • --format json, and possibly stdin input and --fail-on thresholds for CI.
Tests and infra
  • Add a small real Chrome trace with snapshot tests. All fixtures are synthetic, and Dependabot bumps @paulirish/trace_engine daily, so a change in the engine's output shape could still pass CI.
  • Add "engines": { "node": ">=22" }. scan uses fs.globSync, which is not available in Node 20.
Docs
  • A section on how to record a compatible trace (DevTools, Puppeteer, chrome-devtools-mcp).

Would it be OK if I open one issue per item (or only for the ones you're interested in), and then send a PR for each once we agree on the approach in the issue? If you'd prefer to skip some of these or handle them differently, just let me know.

Thanks!

主要語言
TypeScript
星號
15
分支
4
平均合併
1 天 17 小時
30 天內合併 PR
22

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ChromeDevTools/trace-engine-cli 的其他 Issue

查看 ChromeDevTools/trace-engine-cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。