Skip to content

Commit

Permalink
add protobuf classes to query client hydration
Browse files Browse the repository at this point in the history
  • Loading branch information
selfcontained committed Nov 7, 2023
1 parent c0f998f commit 3fea4ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions components/dashboard/src/data/setup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { Message } from "@bufbuild/protobuf";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { FunctionComponent } from "react";
import debounce from "lodash.debounce";
// Need to import all the protobuf classes we want to support for hydration
import * as ConfigurationClasses from "@gitpod/public-api/lib/gitpod/v1/configuration_pb";

// This is used to version the cache
// If data we cache changes in a non-backwards compatible way, increment this version
Expand Down Expand Up @@ -137,6 +139,8 @@ function initializeMessages() {
...Object.values(require("@gitpod/public-api/lib/gitpod/v1/organization_pb")),
...Object.values(require("@gitpod/public-api/lib/gitpod/v1/workspace_pb")),
...Object.values(require("@gitpod/public-api/lib/gitpod/v1/pagination_pb")),
...Object.values(require("@gitpod/public-api/lib/gitpod/v1/pagination_pb")),
...Object.values(ConfigurationClasses),
];
for (const c of constr) {
if ((c as any).prototype instanceof Message) {
Expand Down

0 comments on commit 3fea4ee

Please sign in to comment.