Universal PowerSync Diagnostics (POC) - #1094
Draft
khawarizmus wants to merge 17 commits into
Draft
Conversation
…lient implementations
…ge with components and playground
…d indexes; add SchemaTab to diagnostics UI
…line module imports and setup
…ding columns, indexes, and table options
…ream, UI components, and schema inspection features
…for a cleaner separation
…ion alongside currentOptions
…t and enhance connection handling in extension
…ostMessageTransport, enhance package metadata, and add Chrome types
…nents with icons and status bar
…play and integrate virtual scrolling for upload queue
…t detail component, and improved data handling features
…sizable columns, and theme synchronization
🦋 Changeset detectedLatest commit: 8048c3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
simolus3
requested changes
Sep 10, 2026
simolus3
left a comment
Contributor
There was a problem hiding this comment.
To share more context here (I've also shared that offline with more context @khawarizmus). I think the idea is awesome, my initial architectural complaints are:
- It's not clear whether we need a browser extension, so remove that from this PR which is already very big (you can open a follow-up PR for that separately).
- I think a JSON-based protocol over "any two way channel" is the wrong abstraction here. It e.g. forces us to re-invent an RPC protocol when some implementations we'll use (say the Dart VM service protocol) are already RPC based.
- None of this should require any changes to an existing SDK package (aside from forwarding core diagnostics events, but even that should likely be a separate PR to validate that the basic integration can work without SDK changes). We can likely inject an agent by writing a vite devtools package instead. Or initially, we could also expose it as a seperate package a user would depend on to expose the channel (e.g. a
enablePowerSyncDiagnostics(port: MessagePort, db: BasePowerSyncDatabase)). - Related to 2 and 3, the interface the diagnostics tool expects an SDK to provide should be an actual TypeScript interface with async methods and event listeners. It is the responsibility of each integration (vite,
postMessageiframe, Dart) to figure out how to implement that interface by doing the serialization itself.
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.
This PR implements a live-attach diagnostics tool built once and reused across different hosts.
New packages
@powersync/diagnostics-ui— the shared UI (contains six tabs: Sync Status, Data, Buckets, Streams, Config, Logs).@powersync/diagnostics-core— the host-side client and thePostMessageTransport.tools/diagnostics-extension— a Chrome DevTools extension (using WXT).@powersync/commondiagnosticssubpath: the protocol, the agent, and the state mappers.Schema.serialize()andfromSerialized(), with tests.connectorandconnectionOptionsto the public database interface.diagnosticssync option.@powersync/webBroadcastChanneltransport and event source.enableDiagnostics(db).shared-internals
connectorgetter to persist for the connection lifetime.HandleDiagnostics) into the JS SDK.@powersync/nuxtNotes
Claude code was used to steer the discovery and development. The code was reviewed and modified manually.