Extract reusable drasi-react components from the Trading example#119
Draft
Copilot wants to merge 3 commits into
Draft
Extract reusable drasi-react components from the Trading example#119Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Copilot
AI
changed the title
[WIP] Extract QueryPanel into separate reusable component
Extract reusable drasi-react components from the Trading example
Jun 4, 2026
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.
The Trading example's
QueryTableand the shared SSE muxer were entangled with app-specific logic. This extracts them into a distinct, reusable, documenteddrasi-reactpackage and rewires the app to consume it as an independent dependency, with no change to runtime behavior.New package:
examples/trading/drasi-react/(@drasi/react)Application-agnostic React library — all queries, reaction config, and routing are injected by the host:
DrasiSSEClient— single sharedEventSourcemultiplexing every query; trading content-routing replaced by an optionalrouteUnidentified(rows, deliver)callback.DrasiClient— query/reaction lifecycle, REST seeding, connection management via constructor options.DrasiProvider+ hooks:useDrasiQuery(generic accumulation viagetKey/transform/postProcess),useDrasiConnectionStatus,useDrasiServerUiUrl,useDrasiQueryDefinition.QueryTable— sortable/animated/full-screen table with code viewer; app Tailwind tokens replaced with neutral values, fully themeable viaclassNameprops.index.ts,styles.css,package.json,tsconfig.json,.gitignore, and a fullREADME.md(API + build instructions). Builds independently (npm install && npm run build).App integration (
examples/trading/app/)src/drasi/config.ts(query list, SSE reaction, content router) andsrc/drasi/queryOptions.ts(per-query key/transform/sort), replicating prior behavior exactly.main.tsxwraps the tree in<DrasiProvider>; all consumers import from@drasi/react.services/DrasiClient.ts,hooks/useDrasi.ts,services/grpc/*,components/QueryTable.tsx,hooks/useRowAnimation.ts,shared/CodeViewerDialog.tsx), which also clears a latenttscbreak (createdReactionunused).Docs
README.md/CONTRIBUTING.mdupdated for the new layout and shared components; stale file references corrected.Note: the live end-to-end demo (Docker/Postgres/Drasi Server) was not run in this environment; verification was limited to
tsc/vite buildand dev-server module resolution.