RequestRecorder
class RequestRecorder
Records the Inertia request lifecycle for the devtools extension, holding the per-request collection state and delegating to {SourceLocator}, {PropClassifier}, {@see Collector} and {IncomingEntryBuilder}.
Properties
| protected Collector|null | $collector |
Methods
Scan the share() method source to resolve per-key line numbers.
Capture the call site of a share() call and associate it with the given prop keys.
Mark which of the page's props are shared, once shared property providers have been expanded into the props they provide.
Record a resolved prop.
Record a deferred prop whose resolver threw but was rescued (Inertia::defer(rescue: true)).
Classify the prop and add it to the collector.
Store the collected payload for the rendered page on the request.
Stamp the DevTools headers on the response and record its entry.
Set the source location for the given shared prop keys.
Compute the top-level keys of the currently-shared props for DevTools shared-vs-render annotations.
Whether this response is the initial load of an Inertia page. A plain HTML page is left alone: the extension reads the tag as devtools being enabled there, and would warn about a missing interceptor registry that was never going to appear.
Render the entry id into the page, along with the path the app is mounted on. A panel that attaches after the initial load has only the DOM to read, and the entry endpoint lives under that same path.
Resolve the batch root id sent back to the client.
Resolve the entry's batch id and the outgoing parent id.
Details
at line 30
void
requestStarted(Request $request)
Stamp the request start time.
at line 44
void
sharedPropsResolved(object $middleware, array $shared)
Scan the share() method source to resolve per-key line numbers.
at line 70
void
propsShared(array $keys)
Capture the call site of a share() call and associate it with the given prop keys.
at line 98
void
pageRendering(string $component, Response $response)
Start collecting the page being rendered.
at line 123
void
sharedPropsExpanded(array $shared)
Mark which of the page's props are shared, once shared property providers have been expanded into the props they provide.
at line 131
void
propResolved(string $path, mixed $prop)
Record a resolved prop.
at line 141
void
propRescued(string $path, mixed $prop)
Record a deferred prop whose resolver threw but was rescued (Inertia::defer(rescue: true)).
It is skipped from the response props before normal metadata collection, so it needs its own hook: capture the defer type/group and flag it rescued, with no resolved value.
at line 149
protected void
recordProp(string $path, mixed $prop, bool $rescued = false)
Classify the prop and add it to the collector.
at line 176
void
pageRendered(Request $request, array $page, array $resolvedProps)
Store the collected payload for the rendered page on the request.
at line 210
void
respondedWith(Request $request, Response $response)
Record the response sent for the request.
at line 228
protected void
recordResponse(Request $request, Response $response)
Stamp the DevTools headers on the response and record its entry.
at line 264
protected void
setShareSource(array $keys, array $source)
Set the source location for the given shared prop keys.
at line 280
protected array
topLevelSharedKeys(array $sharedProps)
Compute the top-level keys of the currently-shared props for DevTools shared-vs-render annotations.
at line 298
protected bool
isInitialHtmlResponse(Request $request, Response $response)
Whether this response is the initial load of an Inertia page. A plain HTML page is left alone: the extension reads the tag as devtools being enabled there, and would warn about a missing interceptor registry that was never going to appear.
at line 324
protected void
injectDevToolsIdTag(Response $response, string $id, string $basePath)
Render the entry id into the page, along with the path the app is mounted on. A panel that attaches after the initial load has only the DOM to read, and the entry endpoint lives under that same path.
at line 363
protected string
resolveOutgoingParentId(bool $isPrefetch, string $id, string|null $batchId)
Resolve the batch root id sent back to the client.
at line 377
protected array
resolveLineage(Request $request, string $id)
Resolve the entry's batch id and the outgoing parent id.