You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9185684
Browse filesBrowse the repository at this point in the historyBrowse files
fix(analog): scope server calls to their tab and keep the source scan (#467)
- Server calls and renders are tagged with the page that made them, and the Server view and analog-list-server-calls show the current tab's calls by default.
- The source scan is cached until a file changes (Vite watcher, or fs.watch with re-watch on errors), and open pages are checked against each rescan.
Refs #369
|`analog-inspect-page`| The open page: its files (layouts first, then pages in named outlets with the outlet name), the `load()` data it received, server rendering and hydration state, and hydration errors. | page | none |
974
-
|`analog-list-server-calls`| Recent page renders, `load()` fetches, form actions (with their outcome), server functions by name and API calls, with status, time and size. Flags a `load()` fetched twice and a seeded server function read called again. | Vite plugin |`kind` (`page`, `load`, `action`, `fn` or `api`), `route`, `limit`|
|`analog-inspect-page`| The open page: its files (layouts first, then pages in named outlets with the outlet name), the `load()` data it received, server rendering and hydration state, and hydration errors. | page | none|
974
+
|`analog-list-server-calls`| Recent page renders, `load()` fetches, form actions (with their outcome), server functions by name and API calls, with status, time and size. Flags a `load()` fetched twice and a seeded server function read called again. Each call names its tab when the dev server could tell. | Vite plugin |`kind` (`page`, `load`, `action`, `fn` or `api`), `route`, `limit`, `page` (only that tab's calls; leave it out for every call, untagged ones included)|
Copy file name to clipboardExpand all lines: apps/docs/src/content/inspectors/analog.md
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,12 +56,15 @@ Type a URL into **Test a URL** and click **Explain** to see which files render i
56
56
57
57
Page renders (server rendered or client only), `load()` fetches, form actions, server functions and API calls, newest first. Each row shows the status, the time, who called it, and a redacted response preview.
| Kind filter | Show one kind of call. Each choice counts the tab's calls of that kind, before the search and **Failed only**. |
62
+
|**Find a URL, path or function** search | Keeps calls whose URL, route path, server function name or file contains the text. `Escape` clears it. |
63
+
|**Failed only**| Keeps calls with a status of 400 or more, no status, or a form action that failed. |
64
+
|**All tabs (including untagged)**| Shows the calls of every tab, and calls the dev server could not tie to a tab. Off by default. |
65
+
|**Clear calls**| Empties the list on the dev server, for every tab. The tab says **Calls cleared.** or **Could not clear the calls.**|
66
+
67
+
The list shows the calls of the tab the panel belongs to (with no page id, the tab that reported last). **All tabs (including untagged)** appears while a page reports. See [Which tab a call belongs to](#which-tab-a-call-belongs-to).
65
68
66
69
The filters combine, and the count next to them reads like **12 of 80**. If nothing matches, click **Clear filters** to reset the search, **Failed only** and the kind.
67
70
@@ -114,6 +117,18 @@ Checks grouped by rule, each with a fix. The count on the tab adds up errors and
114
117
</ngmd-card>
115
118
</ngmd-card-grid>
116
119
120
+
### Which tab a call belongs to
121
+
122
+
The dev server ties each call to a tab from the best source it has:
|`x-pangular-page` header | Browser `HttpClient` calls, such as `load()` fetches on navigation and server functions. With `providePangularHttp()` or `withPangular()`, a dev build sends the tab's page id on requests to its own origin only. |
127
+
| Render id | Page renders, and the `load()` and server function requests a render makes over HTTP. The Vite plugin sends the render an id in `Server-Timing` (`pangular-analog`), and the page reports it. Needs a secure context, such as `localhost`. |
128
+
|`Referer`| Other requests, such as form actions sent with `fetch()`, when exactly one open tab shows that path. |
129
+
130
+
A call none of these covers stays untagged, and shows only with **All tabs (including untagged)** or in `analog-list-server-calls` without `page`. A tab's calls leave with the tab: when it closes or reloads, or 30 seconds after its last report or heartbeat.
131
+
117
132
### Supported layouts
118
133
119
134
-**Single app**: `package.json`, `vite.config.ts` and `src/app/pages` in one folder. The build output is read from `dist/analog/public`.
@@ -190,7 +205,7 @@ If an option comes from a variable, a spread (`...`), a template string or a com
190
205
|`pangular:analog-scan-routes`|`filter`| File routes in match order, with page, layout and server files. |
191
206
|`pangular:analog-scan-url`|`url` (required) | Which files render a URL, or the closest candidates. |
192
207
|`pangular:analog-inspect-page`|`page`| The open page: its files, `load()` data, rendering and hydration state. |
193
-
|`pangular:analog-list-server-calls`|`kind`, `route`, `limit`| Recent server calls, with server function names and action outcomes. |
208
+
|`pangular:analog-list-server-calls`|`kind`, `route`, `limit`, `page`| Recent server calls, with server function names and action outcomes. |
194
209
|`pangular:analog-scan-api-routes`|| Server routes with method, URL and file, plus middleware. |
195
210
|`pangular:analog-scan-server-functions`|| Server functions with name, method, file, id and call counts. |
196
211
|`pangular:analog-run-api`|`path` (required), `method`, `body`, `confirm`| Sends a real request to the dev server. |
@@ -213,7 +228,7 @@ Response previews and `load()` data redact secret-looking keys, tokens, `Bearer`
213
228
214
229
### Call history size
215
230
216
-
The server keeps the last 200 calls, and the **Server** tab renders the newest 150 that match its filters. The server cuts previews to 1000 characters, and page renders have no preview.
231
+
The server keeps the last 200 calls of all tabs, and the **Server** tab renders the newest 150 that match its filters. The server cuts previews to 1000 characters, and page renders have no preview.
0 commit comments