@elg/speedscope

中文文档
1.9.0-a6f84db发布于 2020/08/17MITTypeScriptCommonJS近 30 天下载 2.6万

Custom Speedscope fork with exported internals

原始使用文档
文档目录3 节
  1. Rebasing on upstream
  2. Modifying exports
  3. Flow types

🔬speedscope

Originally, Speedscope is a fast, interactive web-based viewer for performance profiles. For more information, see the upstream repository https://github.com/jlfwong/speedscope.

This fork exposes some of its internals for use in the React Concurrent Mode Profiler. There are no plans to upstream the changes in this fork; for more details, see this discussion.

Usage

yarn add @elg/speedscope
# OR
npm install @elg/speedscope

Maintenance

Rebasing on upstream

When upstream is updated, we'll want to update this fork as well. Because this fork adds a few commits on top of Speedscope's master branch, we'll just need to rebase it on upstream/master and fix anything that's broken.

  1. Update the fork's master branch.
  2. Rebase fork-for-scheduling-profiler on it.
  3. Test build: run yarn build to run the scripts/build-release.sh script.
  4. Flow typecheck
    1. cd dist/library
    2. Run flow init to add a .flowconfig file. (assumes you have flow-bin installed globally)
    3. flow check. Follow the steps below to fix any errors.
  5. Force push to this branch.

Modifying exports

This package's exports are declared in src/library.ts. Exports added here will be able to be imported.

Flow types

Flow types are generated by Flowgen and manually fixed up with regex. If flow check is failing, follow these steps to fix the errors:

  1. Try modifying the TypeScript type definitions to resolve the errors.
  2. If that doesn't work, add/modify the regex codemods in scripts/build-release.sh.

Deployment

The fork-for-scheduling-profiler branch of this repository is automatically published to NPM by GitHub Actions.

Our generated version numbers have this format: <upstream Speedscope version>-<Git commit hash>

版本与发布记录

@elg/speedscope 共发布 9 个版本,首次发布于 2020/07/07;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.9.0-a6f84dblatest2020/08/176 年前
1.9.0-c46bbab2020/08/176 年前
1.9.0-b0130532020/08/176 年前
1.9.0-846c4e72020/08/056 年前
1.6.0-7beda702020/08/046 年前
1.6.0-787837d2020/07/076 年前

关于 @elg/speedscope 的常见问题

@elg/speedscope 是什么?

Custom Speedscope fork with exported internals

如何安装 @elg/speedscope?

在项目目录运行 npm install @elg/speedscope,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 speedscope,可以用 npx speedscope 直接运行。

@elg/speedscope 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@elg/speedscope 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@elg/speedscope 可以商用吗?

@elg/speedscope 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@elg/speedscope 的下载量有多少?

根据 npm 官方下载统计,@elg/speedscope 在 2026/10/14 – 2026/11/12 这 30 天内被下载 26,370 次,日均约 879 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@elg/speedscope 还在维护吗?

最新版本 1.9.0-a6f84db 发布于 2020/08/17(6 年前);至今共发布 9 个版本,其中过去 12 个月发布了 0 个;首次发布于 2020/07/07。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。