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 摘要。