Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/chilled-donkeys-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@callstack/tracesift": minor
---

Record Chrome performance traces from the CLI, without the browser extension.

`tracesift record start` launches its own Chrome over the DevTools Protocol and begins tracing before the page is navigated, so page load is inside the recording; `record stop` flushes it and `record status` reports the result. The trace streams into a running TraceSift when one is reachable and is written as a `.json.gz` otherwise. `tracesift record launch` instead opens a Chrome that stays running after the command returns, so you can sign in or navigate by hand; `record start` then attaches to it without navigating, `record stop` leaves it open for further recordings, and `record close` quits it. This gives harnesses such as Codex a route to a capture that needs no extension and no one to click.

The gzip exporter the web app already used is now shared from `@callstack/tracesift/trace-export`, so both routes produce the same enhanced-trace document. A `TracingStartedInBrowser` event that names no frames no longer suppresses the rebuilt frame metadata.
7 changes: 7 additions & 0 deletions .changeset/olive-moons-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@callstack/tracesift": minor
---

Analyze gzipped traces, so an exported recording can be opened again.

A trace exported from a recording — by the web app's own Export trace button or by `tracesift record` with no TraceSift running — is a `.json.gz`, and nothing could read it back: the upload pane accepted only `.json` and both analyze routes parsed the upload as text. Uploads and the Integration API's `analyze` endpoint now inflate a gzipped profile before parsing it, decided by the file's own first bytes rather than its name, and refuse one that would exceed the upload ceiling once uncompressed.
7 changes: 7 additions & 0 deletions .changeset/olive-pugs-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@callstack/tracesift": patch
---

Record the tab that is on screen, not the first one Chrome lists.

`record launch` hands the browser to a person, and signing in leaves consent popups and second tabs behind. Chrome lists a newly opened background tab first, so the recorder attached to it and produced a trace of a page nobody was looking at, with nothing to say anything had gone wrong. It now picks the visible page, which a background tab is not whichever application holds the OS focus, and uses window focus only to choose between two windows that are both showing a page.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ next-env.d.ts

/packages/cli/release.json
/packages/cli/*.tgz
/packages/rn-profiler/android/build

test-fixtures/local/
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,34 @@ See the [CLI documentation](packages/cli/CLI.md) for storage, troubleshooting, a

## Using the web interface

### Capture a Chrome performance trace

TraceSift can record an already-open Chrome tab without opening the DevTools
Performance panel. Open **Capture** in the header, then click the TraceSift
Capture extension in Chrome's toolbar while that exact page is active. This
explicit gesture approves the page; a loopback website cannot pair itself.
Choose the website tab and start recording. The page remains the control
surface while the extension uses Chrome DevTools Protocol as a narrow, local
bridge. Reloading or navigating the approved capture page requires another
toolbar click.

Chrome buffers events internally while recording. When recording stops, the
extension pulls the resulting CDP stream in fixed-size chunks and waits for
each append to `~/.tracesift/captures` before reading the next. The finished
trace is exported as a Chrome-compatible `.json.gz`; captures remain until
they are deleted in TraceSift. TraceSift monitors Chrome's trace buffer and
automatically stops at 90% to avoid losing a full recording. A Chrome crash
before it exposes the completed stream can still make that recording
unrecoverable.

The extension currently ships as a developer package. In Chrome 125 or newer,
open `chrome://extensions`, enable **Developer mode**, choose **Load unpacked**,
and select [`packages/chrome-extension`](packages/chrome-extension). Chrome
shows its standard debugging banner during a capture. Opening DevTools for the
same tab, closing the tab, or dismissing that banner can detach the recorder;
TraceSift reports the capture as interrupted rather than presenting it as a
complete export.

### 1. Configure Analysis settings

Without a provider configured, TraceSift still reads a profile end to end and produces its cards. Configure one for the optional extras:
Expand Down
4 changes: 1 addition & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"dependencies": {
"@callstack/tracesift": "workspace:*",
"@jridgewell/trace-mapping": "^0.3.31",
"@callstack/tracesift-explore": "workspace:*",
"@earendil-works/pi-coding-agent": "0.87.1",
"@rozenite/ui": "^2.4.0",
Expand Down
22 changes: 22 additions & 0 deletions packages/chrome-extension/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# TraceSift Capture extension

This Manifest V3 extension is the privileged CDP bridge used by the local
TraceSift capture page. Chrome 125 or newer is required.

For local development:

1. Open `chrome://extensions`.
2. Enable **Developer mode**.
3. Choose **Load unpacked** and select this directory.
4. Open TraceSift's exact `/capture` page and click **TraceSift Capture** in
Chrome's toolbar while that tab is active. Then choose **Check connection**.

The toolbar click is the pairing approval. A loopback website cannot approve
itself, and reloading or navigating the approved tab clears the approval. The
extension attaches only after an explicit recording request from that tab.

Chrome buffers the recording internally. On stop, the extension pulls Chrome's
`ReturnAsStream` result in fixed-size chunks, waiting for each local disk append
before requesting the next one. It never uploads captures to an external
service. A browser or renderer crash before Chrome exposes the completed stream
can still make that recording unrecoverable.
Loading
Loading