Repository navigation
Surface composables in the standard Components inspector panel - #34
Merged
Merged
Conversation
added 2 commits
June 7, 2026 14:28
Injects a "Composables" group into the State view of Vue Devtools' built-in Components inspector for any component that directly uses composables. Two quirks of the core components plugin had to be worked around: it overwrites payload.state wholesale rather than merging (fixed by deferring our merge by one microtask so it lands last), and it renders State as a flat entry list grouped by `type` rather than by named state groups (fixed by appending entries with type: 'Composables' instead of adding a top-level key).
The test job ran tests before pnpm build, so workspace dependencies like @runtime-labs/observer-core had no built dist/ for vitest to resolve. This was previously masked because no plugin test imported the runtime package directly — the new build-component-composables-state test does, and fails to resolve it in CI without this reorder.
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.
Summary
@vue/devtools-kit's built-in components plugin:payload.statewholesale (payload.state = result) rather than merging — worked around by deferring ourgetInspectorStatemerge by one microtask (await Promise.resolve()) so it always runs after the core handler's synchronous assignment, regardless of hook registration order;typefield (e.g.setup,props) rather than by named top-level groups — worked around by appending entries withtype: 'Composables'to that list instead of adding a new top-level key (the same technique Pinia/Vue Router use).nodeIdVue Devtools encodes as${appId}:rootrather than a numeric uid — the root'sinstance.uid(and thecomponent.uidrecorded bytrackComposable) is always0.Test plan
pnpm vitest run packages/plugin— 19/19 passingpnpm lintpnpm plugin:buildApporDemoWidgetin Vue Devtools' Components panel now shows a "Composables" group listing each composable's state next to "setup"