@hakam-aldeen-kh/blix 0.4.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -21
- package/dist/{DevToolsPanel-TXMT43YN.js → DevToolsPanel-M4DOTADX.js} +2696 -1840
- package/dist/capture/index.d.ts +9 -8
- package/dist/capture/index.js +2 -2
- package/dist/{chunk-OQHKPRNI.js → chunk-L2MFAP7B.js} +1 -1
- package/dist/{chunk-MRTSIXR7.js → chunk-S76WQLND.js} +4 -3
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
|
|
4
4
|
An in-app dev-tools panel for React apps. Captures HTTP requests, Redux
|
|
5
5
|
actions, TanStack Query cache events and realtime traffic, and renders them in
|
|
6
|
-
a dockable panel with
|
|
6
|
+
a dockable panel with cross-source links, diffing, replay and HAR/cURL
|
|
7
|
+
export.
|
|
7
8
|
|
|
8
9
|
The entire panel is eliminated from production builds — see
|
|
9
10
|
[Production elimination](#production-elimination).
|
|
@@ -173,8 +174,8 @@ instance.interceptors.response.use(undefined, (error) =>
|
|
|
173
174
|
|
|
174
175
|
The consequence is silent and total: **every non-2xx request stays `pending`
|
|
175
176
|
in the panel for the rest of the session.** No error, no warning, no Failed
|
|
176
|
-
filter. (The 30-second pending cap only bounds
|
|
177
|
-
it does not resolve the entry.)
|
|
177
|
+
filter. (The 30-second pending cap only bounds how far the row's duration bar
|
|
178
|
+
grows; it does not resolve the entry.)
|
|
178
179
|
|
|
179
180
|
Two ways out, and you currently have to choose one:
|
|
180
181
|
|
|
@@ -385,7 +386,7 @@ both. There is no wrong choice here and no silent failure.
|
|
|
385
386
|
|
|
386
387
|
What *does* matter is which one your app calls through. Only the proxy's traps
|
|
387
388
|
record a stack, so every request made against the unwrapped instance is still
|
|
388
|
-
captured but arrives with
|
|
389
|
+
captured but arrives with no initiator. Export the wrapped one and
|
|
389
390
|
keep the original private:
|
|
390
391
|
|
|
391
392
|
```ts
|
|
@@ -401,7 +402,7 @@ The traps cover the callable form (`apiClient(config)`) plus `request`, `get`,
|
|
|
401
402
|
the `*Form` helpers — pass through unwrapped: still captured, just with no
|
|
402
403
|
initiator stack.
|
|
403
404
|
|
|
404
|
-
> **Known limitation.** The
|
|
405
|
+
> **Known limitation.** The initiator stack is produced by filtering your own
|
|
405
406
|
> HTTP wrapper's frames out of the captured stack, and that filter currently
|
|
406
407
|
> matches a fixed set of module paths rather than deriving them from where
|
|
407
408
|
> `withInitiatorCapture` was called. If your axios module does not sit at one
|
|
@@ -601,6 +602,39 @@ structural typing means you just pass your store and client.)
|
|
|
601
602
|
Passing neither still gives you a fully working capture log; you only lose the
|
|
602
603
|
two features that need a live handle on the app.
|
|
603
604
|
|
|
605
|
+
### Finding your way around
|
|
606
|
+
|
|
607
|
+
The panel is one header, one rail and two panes.
|
|
608
|
+
|
|
609
|
+
**The rail on the left is the four sources** — Network, Realtime, Redux,
|
|
610
|
+
Query. They are not filters over one table: each has its own columns and its
|
|
611
|
+
own notion of a row, so switching source switches the whole view. `1`–`4` jump
|
|
612
|
+
between them, and each keeps its own selection, so stepping to Redux and back
|
|
613
|
+
returns you to the request you were reading. Below the sources it carries the
|
|
614
|
+
session totals, and it collapses to icons — click the chevron, or let a narrow
|
|
615
|
+
dock do it for you.
|
|
616
|
+
|
|
617
|
+
**The header is the session**, not the entry: whether capture is running, what
|
|
618
|
+
is being filtered out, and where the panel lives. Filter tokens you have
|
|
619
|
+
already applied become chips *inside* the filter field, each removable on its
|
|
620
|
+
own, so `method:post status:5xx` is two things you can undo separately rather
|
|
621
|
+
than one string to re-edit. `.*` widens the search to request and response
|
|
622
|
+
bodies.
|
|
623
|
+
|
|
624
|
+
**`Ctrl/⌘ K` opens the command palette**, and for several things it is the only
|
|
625
|
+
way in — sort order, row density, dock position, the copy formats, the filter
|
|
626
|
+
syntax. The header spends its width on what you read constantly; everything you
|
|
627
|
+
reach for occasionally lives one keystroke away instead of costing a button
|
|
628
|
+
each. Every row shows its key binding where it has one, so the palette teaches
|
|
629
|
+
its own shortcuts. `?` still opens the full cheatsheet.
|
|
630
|
+
|
|
631
|
+
**Linked events tie the sources together.** When Blix can see that a query
|
|
632
|
+
caused a request, that a request came from a query, or that one entry is a
|
|
633
|
+
replay of another, the row grows a coloured tick and the foot of the detail
|
|
634
|
+
pane grows a chip you can click to step straight to the other side. The
|
|
635
|
+
relation is observed, never inferred: no tick means *not known*, not
|
|
636
|
+
*unrelated*.
|
|
637
|
+
|
|
604
638
|
### Viewing payloads
|
|
605
639
|
|
|
606
640
|
Every payload pane has a format switch. The choice is remembered, so you pick
|
|
@@ -634,7 +668,7 @@ literal rather than a pre-serialized string.
|
|
|
634
668
|
|
|
635
669
|
### Exporting the log
|
|
636
670
|
|
|
637
|
-
The
|
|
671
|
+
The **Export** button in the header offers six formats and a scope
|
|
638
672
|
toggle — **Shown** (what the current section and filters leave visible) or
|
|
639
673
|
**All**. It defaults to Shown, with both counts on the control, so an export
|
|
640
674
|
says what it will contain before you pick a format.
|
|
@@ -653,7 +687,8 @@ placeholder rather than a working token — use **Replay** for a real re-run.
|
|
|
653
687
|
|
|
654
688
|
### Themes
|
|
655
689
|
|
|
656
|
-
Twelve themes, under the
|
|
690
|
+
Twelve themes, under the theme button in the header — it names the one
|
|
691
|
+
currently applied:
|
|
657
692
|
|
|
658
693
|
| | Theme | |
|
|
659
694
|
| --- | --- | --- |
|
|
@@ -682,7 +717,7 @@ panel's other preferences and survives a reload.
|
|
|
682
717
|
The panel never inherits your app's styling — it portals outside every stacking
|
|
683
718
|
context and ships its own palettes, so nothing you do to your own theme can
|
|
684
719
|
distort it. Themes are complete rather than partial: every colour the panel
|
|
685
|
-
paints, down to the JSON syntax highlighting and the
|
|
720
|
+
paints, down to the JSON syntax highlighting and the duration bars, comes from
|
|
686
721
|
the active theme. Each palette is checked against WCAG contrast targets — 4.5:1
|
|
687
722
|
for anything read as text, 3:1 for badges and quiet chrome — which is why a few
|
|
688
723
|
of the ported palettes differ by a shade from the originals in the slots used
|
|
@@ -825,15 +860,16 @@ the database is opened only when the panel mounts — see
|
|
|
825
860
|
while it is off nothing Blix captures reaches IndexedDB — the store is
|
|
826
861
|
actively cleared on every panel mount.
|
|
827
862
|
|
|
828
|
-
|
|
863
|
+
Four ways to toggle it:
|
|
829
864
|
|
|
830
865
|
| Where | Note |
|
|
831
866
|
| --- | --- |
|
|
832
|
-
|
|
|
867
|
+
| Header button | Keeps its icon at every width; loses its label when the panel is narrow |
|
|
833
868
|
| **⋯ More actions** overflow menu | — |
|
|
869
|
+
| Command palette (`Ctrl/⌘ K`) | Listed as **Preserve log across reloads** / **Stop preserving the log** |
|
|
834
870
|
| `Shift+L` | — |
|
|
835
871
|
|
|
836
|
-
All
|
|
872
|
+
All four require the panel to be mounted.
|
|
837
873
|
|
|
838
874
|
**Turning it on is retroactive.** The toggle does not mean "from now on".
|
|
839
875
|
Switching it on writes every entry already sitting in the live buffer — the
|
|
@@ -874,7 +910,9 @@ that is not one of the four above, it is captured verbatim.
|
|
|
874
910
|
|
|
875
911
|
Masking is partial rather than total: for a value longer than 12 characters
|
|
876
912
|
the first 8 and last 4 survive, so you can still tell which token you sent.
|
|
877
|
-
Shorter values are replaced outright.
|
|
913
|
+
Shorter values are replaced outright. The Headers tab tags every masked row
|
|
914
|
+
`MASKED` rather than leaving you to infer it from an ellipsis, and the stored
|
|
915
|
+
value keeps a `(masked)` suffix so every export path carries the fact too.
|
|
878
916
|
|
|
879
917
|
**Nothing inside a body is redacted.** Request bodies, response bodies, error
|
|
880
918
|
payloads, the encrypted request/response values, Redux payloads and diffs, and
|
|
@@ -899,21 +937,27 @@ records or 24 MB of newer traffic push it out, or when you clear it yourself.
|
|
|
899
937
|
On a low-traffic app with preserve-log left on, a captured token stays in the
|
|
900
938
|
browser profile indefinitely.
|
|
901
939
|
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
940
|
+
Three ways to purge:
|
|
941
|
+
|
|
942
|
+
| Where | Note |
|
|
943
|
+
| --- | --- |
|
|
944
|
+
| The persisted-size label in the status bar — the one reading `12 saved · 3.4 MB` | The label *is* the control, and it is the only one that asks twice: click once to arm it, at which point it changes to `Purge saved log?`, and click again. It disarms itself after three seconds. Rendered only while preserve-log is on |
|
|
945
|
+
| **⋯ More actions** → **Purge saved log** | Deletes on a single press, with no confirmation |
|
|
946
|
+
| Command palette (`Ctrl/⌘ K`) → **Purge the saved log** | Deletes on a single press, with no confirmation |
|
|
947
|
+
|
|
948
|
+
The menu and palette entries are disabled when nothing is on disk, but unlike
|
|
949
|
+
the status-bar label they do not depend on preserve-log being on — so a log
|
|
950
|
+
written earlier in the session can still be deleted after you have switched
|
|
951
|
+
the toggle off.
|
|
905
952
|
|
|
906
953
|
Switching preserve-log **off** also clears the stored entries, so turning it
|
|
907
954
|
off is itself a way to drop everything Blix has written.
|
|
908
955
|
|
|
909
|
-
|
|
956
|
+
Every path clears the captured entries; Purge additionally deletes the
|
|
910
957
|
IndexedDB database itself. **Your panel preferences survive either way** —
|
|
911
958
|
they are mirrored to `localStorage`, and a fresh database is re-seeded from
|
|
912
|
-
that mirror on the next boot. There is no UI or API for clearing them
|
|
913
|
-
|
|
914
|
-
**The purge control is only rendered while preserve-log is on**, so once you
|
|
915
|
-
have switched it off there is nothing left in the UI to press. There is no
|
|
916
|
-
programmatic API for either path.
|
|
959
|
+
that mirror on the next boot. There is no UI or API for clearing them, and no
|
|
960
|
+
programmatic API for purging either.
|
|
917
961
|
|
|
918
962
|
### Threat model
|
|
919
963
|
|