feat(data-inspector): inline sources, lazy deep-node expansion, auto-rerun, playground toolbar#111
Merged
Conversation
…rerun, playground toolbar - exposeDataInspector accepts a sources[] option, registering them before the endpoint opens (a convenience over calling registerDataSource separately) - lazy-expand depth-truncated nodes: the normalizer records a NodePath on each depth marker, a new queryPath RPC re-runs the query and returns a fresh slice of that subtree, and the viewer splices it in below a 'load deeper' link - auto rerun: an optional poller under the filters re-runs the query every N seconds against the live object; persisted in the URL, skipped while a run is in flight or the query is broken - richer result/query toolbar: copy query, expand-all/collapse-all, copy JSON
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
… TimeAgo, themed tooltips - auto-rerun pauses while the tab is backgrounded (Page Visibility) and resumes with an immediate catch-up run when it returns to the foreground - status bar shows a live 'ran … ago' label (@antfu/design DisplayDate) tracking the last successful query - tooltips use @antfu/design's themed floating-vue stylesheet so they follow the design tokens (surface, border, light/dark) instead of the default look
The zero-code `--import` agent has nowhere to call registerDataSource, so it now auto-registers a `globalThis` source (createGlobalThisDataSource) — assigning to the global object is enough to inspect anything. Opt out with DEVFRAME_DATA_INSPECTOR_GLOBAL=0. Docs updated with the workflow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four enhancements to the data-inspector plugin, all in one branch.
1.
exposeDataInspectoraccepts data sourcesA new
sources?: DataSourceEntry[]option registers sources before the endpoint opens — a convenience over callingregisterDataSourceyourself. Both paths share the one process-global registry, so inline and separately-registered sources coexist.2. Lazy expansion of deep nodes
Large graphs no longer arrive all at once. The normalizer records a structural
NodePathon every depth-truncation marker; a newqueryPathRPC re-runs the base query, re-descends to that node, and returns just its subtree normalized with a fresh depth budget. In the viewer, a depth-capped node renders aload deeperlink that fetches the subtree on demand and splices it in place (recursively — nested markers carry absolute paths). Navigation mirrors the normalizer exactly (arrays re-applyexcludeFunctions, Maps/Sets handled), so a lazily fetched slice lines up with what is on screen.3. Auto rerun
An optional poller under the filters —
auto rerun every N seconds(checkbox + numeric seconds, default 5) — re-runs the current query against the live object on a fixed period, so a value that changes over time updates on its own. It persists in the URL (and restores an already-on toggle on load), and skips a tick while a run is in flight or the query is syntactically broken.4. Playground-style toolbar
The query/result surfaces gain the affordances of the discovery jora playground, built with the shared
@antfu/designcomponents: copy-query, and expand-all / collapse-all / copy-as-JSON over the results.Verification
navigate,runQueryAtPath, and the$pathmarker (filters, Set/Map steps, soft-fail).load deeperfetches and splices subtrees, auto-rerun restores from the URL and polls live, and the toolbar buttons work.pnpm lint && pnpm test && pnpm typecheck && pnpm buildall green (743 tests); API snapshots regenerated.This PR was created with the help of an agent.