-
Notifications
You must be signed in to change notification settings - Fork 170
refactor: eliminate RuntimeContextBridge and runtimeClientStore
#8967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 82 commits
Commits
Show all changes
83 commits
Select commit
Hold shift + click to select a range
19f6897
feat: add RuntimeClient, RuntimeProvider, and ConnectRPC proto gen (P…
ericpgreen2 ba367e8
feat: add TanStack Query hook code generator (Phase 2)
ericpgreen2 8cdc22d
feat: update invalidation and query matching for dual key formats (Ph…
ericpgreen2 3aaa80d
fix: resolve type errors in generated query hooks
ericpgreen2 366c809
fix: prevent reactive loop in runtime store bridge
ericpgreen2 13adf06
feat: add JSON bridge to v2 code generator (Phase 4)
ericpgreen2 243dd49
feat: add generic TData support to v2 query hooks for select transforms
ericpgreen2 a77cf00
fix: strip undefined values before proto fromJson in JSON bridge
ericpgreen2 369e0b5
fix: emit default values in proto toJson to match gRPC-Gateway output
ericpgreen2 301244f
fix: deep-strip undefined values in `stripUndefined` for nested reque…
ericpgreen2 840e757
feat: port request queue to ConnectRPC transport interceptor
ericpgreen2 ae800e0
refactor: migrate connectors and column-profile to v2 RuntimeClient
ericpgreen2 d760301
refactor: migrate more connectors components to v2 RuntimeClient
ericpgreen2 133a411
refactor: migrate column-profile, canvas, and remaining connectors to…
ericpgreen2 fafeda1
fix: restore select transforms now that v2 hooks support generic TData
ericpgreen2 46ae340
refactor: migrate chart providers and canvas leaf components to v2 Ru…
ericpgreen2 25a80d1
refactor: add runtimeClient to dashboard StateManagers and migrate co…
ericpgreen2 8392af2
refactor: migrate dashboard time-series and selector modules to v2 Ru…
ericpgreen2 b65d646
refactor: migrate dashboard Svelte components from runtime store to u…
ericpgreen2 e7bc93b
fix: update test infrastructure for v2 ConnectRPC hooks
ericpgreen2 2267e4d
refactor: migrate export and pivot-query modules from runtime store t…
ericpgreen2 d4e0b17
refactor: migrate time controls and time ranges from runtime store to…
ericpgreen2 bfe9b4b
refactor: migrate canvas, explores, and state-managers from runtime s…
ericpgreen2 5947503
refactor: thread `RuntimeClient` through `.ts` query factories and re…
ericpgreen2 fb10785
refactor: migrate web-common features from `runtime` store to `Runtim…
ericpgreen2 fe3b390
fix: update conversation tests to use mock `RuntimeClient`
ericpgreen2 2102ddd
refactor: migrate remaining `.ts` modules from runtime store to Runti…
ericpgreen2 8061a16
refactor: cleanup — migrate embed to v2 RuntimeProvider, delete old p…
ericpgreen2 2b11911
refactor: delete unused `StreamingQueryBatch` and fix `createDownload…
ericpgreen2 b777e09
refactor: migrate remaining legacy consumers + delete Orval gen and h…
ericpgreen2 63c62ba
fix: three UXQA bugs — empty GetFile path, missing TableCardinality p…
ericpgreen2 b1dd0f6
fix: resolve TypeScript and svelte-check errors from v2 migration
ericpgreen2 4ddc1d5
fix: provide RuntimeClient to TopNavigationBar via global store
ericpgreen2 def18ff
fix: prevent infinite SSE reconnection loop when server closes immedi…
ericpgreen2 3ade689
fix: pass JWT to SSE log connection and forward options to fetch client
ericpgreen2 4338016
fix: retarget barrel to v2/gen and fix remaining legacy imports
ericpgreen2 2192094
refactor: migrate all remaining consumers to v2 RuntimeClient signatures
ericpgreen2 6fa0bcb
fix: resolve all svelte-check and unit test errors from v2 migration
ericpgreen2 826b3dd
merge: resolve conflicts from main, migrate generateCanvas.ts to v2 R…
ericpgreen2 9c65c7b
fix: resolve remaining v2 RuntimeClient migration errors blocking build
ericpgreen2 9e022c6
fix: remove dead `instanceId` vars and fix remaining v2 call signatures
ericpgreen2 5213771
fix: remove unused `runtimeClient` in `NavFile`, fix `$lib` alias in …
ericpgreen2 a1ca2fd
fix: allow empty-string host in RuntimeProvider, fix `client` arg in …
ericpgreen2 3f2591f
fix: set `FileArtifacts` client synchronously to prevent undefined ac…
ericpgreen2 ca80172
fix: validate `RuntimeClient` constructor args, remove redundant temp…
ericpgreen2 5a3a103
fix: replace manual REST `fetch()` calls with v2 RPC, remove dead que…
ericpgreen2 7fa13bd
fix: update web-local for v2 RPC compatibility
ericpgreen2 0a02a6a
fix: handle ConnectRPC errors in REST-style error checks
ericpgreen2 12fec35
fix: replace REST-style error handling with ConnectRPC-compatible uti…
ericpgreen2 fc5e973
fix: update timeseries e2e test to match ConnectRPC URL pattern
ericpgreen2 23459c0
fix: guard `RuntimeProvider` mount until runtime connection props res…
ericpgreen2 cb82774
fix: use `runtimeClientStore` in `ProjectGlobalStatusIndicator` and e…
ericpgreen2 fe517ce
merge main, resolve conflict in `DeploymentSection.svelte`
ericpgreen2 a5ff1dc
fix: `Heap.delete` must try `moveUp` before `moveDown`
ericpgreen2 c244546
fix: `removeByName` must reject pending promises before deleting
ericpgreen2 d703a07
refactor: use `async/await` in generated base functions
ericpgreen2 3f2c517
fix: guard `runtimeClientStore` clear against stale identity
ericpgreen2 ef2e38f
chore: remove `frontend.md` from this branch
ericpgreen2 5a71e78
chore: restore `generate:runtime-client` script name, document Orval …
ericpgreen2 e8ef7ca
fix: add 60s timeout to `waitForFreshJwt`
ericpgreen2 e3d528c
fix: add `RequestQueue.clear()` and use it in `dispose()`
ericpgreen2 e7d4ac8
fix: tear down `featureFlags` subscription on RuntimeProvider unmount
ericpgreen2 da3fcd5
fix: remove unused `prioritiseColumn` from `RequestQueue`
ericpgreen2 a9b85ed
fix: skip generating hooks for instance-management methods
ericpgreen2 4974e52
chore: move query hooks generator into `runtime-client/v2/`
ericpgreen2 04fccc4
refactor: adopt `ConnectError` as the TanStack Query error type
ericpgreen2 b1f0e97
fix: update `smartRefetchIntervalFunc` and `useCanvas` to use `Connec…
ericpgreen2 ff41139
chore: standardize import paths to use runtime-client barrel
ericpgreen2 674d583
fix: use extractErrorMessage in RenameAssetModal
ericpgreen2 fc5c049
test: add tests for query hooks code generator
ericpgreen2 2411e80
merge main, resolve conflicts from MeasureChart refactor (#8752)
ericpgreen2 c380c52
fix: convert Luxon DateTimes to UTC before `.toISO()` for proto Times…
ericpgreen2 765c697
fix: detect empty time range from access controls with ConnectRPC
ericpgreen2 3598037
fix: unit test failures in DashboardStateManager
ericpgreen2 300b6a9
merge main, resolve conflicts from generateCanvas feature flag removal
ericpgreen2 15583f7
refactor: unify runtime client access with cached `getRuntimeClient()…
ericpgreen2 ed2a019
refactor: eliminate `RuntimeContextBridge` and `runtimeClientStore`
ericpgreen2 34e71b7
fix: header border on project page and duplicate share button on dash…
ericpgreen2 4d1fb74
fix: avatar flicker during header transitions and redundant `GetCurre…
ericpgreen2 75c3d47
merge main, resolve conflicts from codegen and connector form changes
ericpgreen2 dc1e5fe
remove old generate-query-hooks files replaced by codegen/
ericpgreen2 054fba2
fix review issues: header height, avatar reactivity, types, and templ…
ericpgreen2 d75224a
extract shared breadcrumb selectors with `select` transforms
ericpgreen2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
File renamed without changes.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| <script lang="ts"> | ||
| import { page } from "$app/stores"; | ||
| import Breadcrumbs from "@rilldata/web-common/components/navigation/breadcrumbs/Breadcrumbs.svelte"; | ||
| import type { PathOption } from "@rilldata/web-common/components/navigation/breadcrumbs/types"; | ||
| import Header from "@rilldata/web-common/layout/header/Header.svelte"; | ||
| import HeaderLogo from "@rilldata/web-common/layout/header/HeaderLogo.svelte"; | ||
| import { | ||
| createAdminServiceGetCurrentUser, | ||
| createAdminServiceListOrganizations as listOrgs, | ||
| createAdminServiceListProjectsForOrganization as listProjects, | ||
| type V1Organization, | ||
| } from "../../client"; | ||
| import AvatarButton from "../authentication/AvatarButton.svelte"; | ||
| import SignIn from "../authentication/SignIn.svelte"; | ||
| import { isOrganizationPage } from "../navigation/nav-utils"; | ||
|
|
||
| export let readProjects: boolean; | ||
| export let planDisplayName: string | undefined; | ||
| export let organizationLogoUrl: string | undefined; | ||
|
|
||
| const user = createAdminServiceGetCurrentUser(); | ||
|
|
||
| $: ({ | ||
| params: { organization, project }, | ||
| } = $page); | ||
|
|
||
| $: onOrgPage = isOrganizationPage($page); | ||
|
|
||
| $: loggedIn = !!$user.data?.user; | ||
| $: rillLogoHref = !loggedIn ? "https://www.rilldata.com" : "/"; | ||
|
|
||
| $: organizationQuery = listOrgs( | ||
| { pageSize: 100 }, | ||
| { | ||
| query: { | ||
| enabled: !!$user.data?.user, | ||
| retry: 2, | ||
| refetchOnMount: true, | ||
| }, | ||
| }, | ||
| ); | ||
|
|
||
| $: projectsQuery = listProjects( | ||
| organization, | ||
| { pageSize: 100 }, | ||
| { | ||
| query: { | ||
| enabled: !!organization && readProjects, | ||
| retry: 2, | ||
| refetchOnMount: true, | ||
| }, | ||
| }, | ||
| ); | ||
|
|
||
| $: organizations = $organizationQuery.data?.organizations ?? []; | ||
| $: projects = $projectsQuery.data?.projects ?? []; | ||
|
|
||
| $: organizationPaths = { | ||
| options: createOrgPaths(organizations, organization, planDisplayName), | ||
| }; | ||
|
|
||
| function createOrgPaths( | ||
| organizations: V1Organization[], | ||
| viewingOrg: string | undefined, | ||
| planDisplayName: string | undefined, | ||
| ) { | ||
| const pathMap = new Map<string, PathOption>(); | ||
|
|
||
| organizations.forEach(({ name, displayName }) => { | ||
| pathMap.set(name.toLowerCase(), { | ||
| label: displayName || name, | ||
| pill: planDisplayName, | ||
| }); | ||
| }); | ||
|
|
||
| if (!viewingOrg) return pathMap; | ||
|
|
||
| if (!pathMap.has(viewingOrg.toLowerCase())) { | ||
| pathMap.set(viewingOrg.toLowerCase(), { | ||
| label: viewingOrg, | ||
| pill: planDisplayName, | ||
| }); | ||
| } | ||
|
|
||
| return pathMap; | ||
| } | ||
|
|
||
| $: projectPaths = { | ||
| options: projects.reduce( | ||
| (map, { name }) => | ||
| map.set(name.toLowerCase(), { label: name, preloadData: false }), | ||
| new Map<string, PathOption>(), | ||
| ), | ||
| }; | ||
|
|
||
| $: pathParts = [organizationPaths, projectPaths]; | ||
| $: currentPath = [organization, project]; | ||
| </script> | ||
|
|
||
| <Header borderBottom={!onOrgPage}> | ||
| <HeaderLogo href={rillLogoHref} logoUrl={organizationLogoUrl} /> | ||
| {#if organization} | ||
| <Breadcrumbs {pathParts} {currentPath} /> | ||
| {/if} | ||
|
|
||
| <div class="flex gap-x-2 items-center ml-auto"> | ||
| {#if $user.isSuccess} | ||
| {#if $user.data?.user} | ||
| <AvatarButton /> | ||
| {:else} | ||
| <SignIn /> | ||
| {/if} | ||
| {/if} | ||
| </div> | ||
| </Header> | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.