Skip to content

chore: use react-query package alias #10118

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 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion site/.storybook/preview.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { withRouter } from "storybook-addon-react-router-v6";
import { HelmetProvider } from "react-helmet-async";
import { dark } from "theme";
import "theme/globalFonts";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { QueryClient, QueryClientProvider } from "react-query";

export const decorators = [
(Story) => (
Expand Down
2 changes: 1 addition & 1 deletion site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@mui/styles": "5.14.0",
"@mui/system": "5.14.0",
"@mui/utils": "5.14.11",
"@tanstack/react-query": "4.35.3",
"@vitejs/plugin-react": "4.1.0",
"@xstate/inspect": "0.8.0",
"@xstate/react": "3.2.1",
Expand Down Expand Up @@ -78,6 +77,7 @@
"react-dom": "18.2.0",
"react-helmet-async": "1.3.0",
"react-markdown": "8.0.7",
"react-query": "npm:@tanstack/react-query@4.35.3",
"react-router-dom": "6.16.0",
"react-syntax-highlighter": "15.5.0",
"react-use": "17.4.0",
Expand Down
6 changes: 3 additions & 3 deletions site/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion site/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CssBaseline from "@mui/material/CssBaseline";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { QueryClient, QueryClientProvider } from "react-query";
import { AuthProvider } from "components/AuthProvider/AuthProvider";
import { FC, PropsWithChildren } from "react";
import { HelmetProvider } from "react-helmet-async";
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/appearance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryClient } from "@tanstack/react-query";
import { QueryClient } from "react-query";
import * as API from "api/api";
import { AppearanceConfig } from "api/typesGenerated";
import { getMetadataAsJSON } from "utils/metadata";
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/entitlements.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryClient } from "@tanstack/react-query";
import { QueryClient } from "react-query";
import * as API from "api/api";
import { Entitlements } from "api/typesGenerated";
import { getMetadataAsJSON } from "utils/metadata";
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/groups.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryClient } from "@tanstack/react-query";
import { QueryClient } from "react-query";
import * as API from "api/api";
import { checkAuthorization } from "api/api";
import {
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
type UserQuietHoursScheduleResponse,
type UpdateUserQuietHoursScheduleRequest,
} from "api/typesGenerated";
import { type QueryClient, type QueryOptions } from "@tanstack/react-query";
import { type QueryClient, type QueryOptions } from "react-query";

export const userQuietHoursScheduleKey = (userId: string) => [
"settings",
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/sshKeys.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryClient } from "@tanstack/react-query";
import { QueryClient } from "react-query";
import * as API from "api/api";
import { GitSSHKey } from "api/typesGenerated";

Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
type ProvisionerJobStatus,
type TemplateVersion,
} from "api/typesGenerated";
import { type QueryClient, type QueryOptions } from "@tanstack/react-query";
import { type QueryClient, type QueryOptions } from "react-query";
import { delay } from "utils/delay";

export const templateByNameKey = (orgId: string, name: string) => [
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/users.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QueryClient, QueryOptions } from "@tanstack/react-query";
import { QueryClient, QueryOptions } from "react-query";
import * as API from "api/api";
import {
GetUsersResponse,
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/workspace.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as API from "api/api";
import { type Workspace } from "api/typesGenerated";
import { type QueryOptions } from "@tanstack/react-query";
import { type QueryOptions } from "react-query";

export const workspaceByOwnerAndNameKey = (owner: string, name: string) => [
"workspace",
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/workspaceBuilds.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { UseInfiniteQueryOptions } from "@tanstack/react-query";
import { UseInfiniteQueryOptions } from "react-query";
import * as API from "api/api";
import { WorkspaceBuild, WorkspaceBuildsRequest } from "api/typesGenerated";

Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Dashboard/DashboardProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { buildInfo } from "api/queries/buildInfo";
import { experiments } from "api/queries/experiments";
import { entitlements } from "api/queries/entitlements";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { usePermissions } from "hooks/usePermissions";
import { DeploymentBannerView } from "./DeploymentBannerView";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { deploymentStats } from "api/queries/deployment";

export const DeploymentBanner: React.FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Dashboard/HealthBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Alert } from "components/Alert/Alert";
import { Link as RouterLink } from "react-router-dom";
import Link from "@mui/material/Link";
import { colors } from "theme/colors";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getHealth } from "api/api";
import { useDashboard } from "./DashboardProvider";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { RequirePermission } from "components/RequirePermission/RequirePermissio
import { usePermissions } from "hooks/usePermissions";
import { Outlet } from "react-router-dom";
import { DeploymentConfig } from "api/api";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { deploymentConfig } from "api/queries/deployment";

type DeploySettingsContextValue = {
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Filter/menu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo, useRef, useState } from "react";
import { BaseOption } from "./options";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";

export type UseFilterMenuOptions<TOption extends BaseOption> = {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/Resources/PortForwardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { SecondaryAgentButton } from "components/Resources/AgentButton";
import { docs } from "utils/docs";
import Box from "@mui/material/Box";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getAgentListeningPorts } from "api/api";
import {
WorkspaceAgent,
Expand Down
2 changes: 1 addition & 1 deletion site/src/components/UserAutocomplete/UserAutocomplete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { AvatarData } from "components/AvatarData/AvatarData";
import { ChangeEvent, ComponentProps, FC, useState } from "react";
import Box from "@mui/material/Box";
import { useDebouncedFunction } from "hooks/debounce";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { users } from "api/queries/users";
import { prepareQuery } from "utils/filters";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import InfoIcon from "@mui/icons-material/InfoOutlined";
import { makeStyles } from "@mui/styles";
import { colors } from "theme/colors";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { templateVersion } from "api/queries/templates";
import Box from "@mui/material/Box";
import Skeleton from "@mui/material/Skeleton";
Expand Down
2 changes: 1 addition & 1 deletion site/src/contexts/ProxyContext.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getWorkspaceProxies, getWorkspaceProxyRegions } from "api/api";
import { Region, WorkspaceProxy } from "api/typesGenerated";
import { useDashboard } from "components/Dashboard/DashboardProvider";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/AuditPage/AuditPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { AuditPageView } from "./AuditPageView";
import { useUserFilterMenu } from "components/Filter/UserFilter";
import { useFilter } from "components/Filter/filter";
import { usePagination } from "hooks";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getAuditLogs } from "api/api";
import { useActionFilterMenu, useResourceTypeFilterMenu } from "./AuditFilter";

Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/CreateTokenPage/CreateTokenPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useNavigate } from "react-router-dom";
import { useFormik } from "formik";
import { Loader } from "components/Loader/Loader";
import { displaySuccess, displayError } from "components/GlobalSnackbar/utils";
import { useMutation, useQuery } from "@tanstack/react-query";
import { useMutation, useQuery } from "react-query";
import { createToken, getTokenConfig } from "api/api";
import { CreateTokenForm } from "./CreateTokenForm";
import { NANO_HOUR, CreateTokenData } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/CreateUserPage/CreateUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom";
import { CreateUserForm } from "./CreateUserForm";
import { Margins } from "components/Margins/Margins";
import { pageTitle } from "utils/page";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { authMethods, createUser } from "api/queries/users";
import { displaySuccess } from "components/GlobalSnackbar/utils";

Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/CreateWorkspacePage/CreateWorkspacePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
colors,
NumberDictionary,
} from "unique-names-generator";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { templateVersionExternalAuth } from "api/queries/templates";

export type ExternalAuthPollingState = "idle" | "polling" | "abandoned";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FC } from "react";
import { Helmet } from "react-helmet-async";
import { pageTitle } from "utils/page";
import { AppearanceSettingsPageView } from "./AppearanceSettingsPageView";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQueryClient } from "react-query";
import { updateAppearance } from "api/queries/appearance";
import { getErrorMessage } from "api/errors";
import { displayError, displaySuccess } from "components/GlobalSnackbar/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FC } from "react";
import { Helmet } from "react-helmet-async";
import { pageTitle } from "utils/page";
import { GeneralSettingsPageView } from "./GeneralSettingsPageView";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { deploymentDAUs } from "api/queries/deployment";

const GeneralSettingsPage: FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMutation } from "@tanstack/react-query";
import { useMutation } from "react-query";
import { createLicense } from "api/api";
import { displayError, displaySuccess } from "components/GlobalSnackbar/utils";
import { FC } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { getLicenses, removeLicense } from "api/api";
import { displayError, displaySuccess } from "components/GlobalSnackbar/utils";
import { FC, useEffect } from "react";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/ExternalAuthPage/ExternalAuthPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { useQuery, useQueryClient } from "react-query";
import {
exchangeExternalAuthDevice,
getExternalAuthDevice,
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/GroupsPage/CreateGroupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Helmet } from "react-helmet-async";
import { useNavigate } from "react-router-dom";
import { pageTitle } from "utils/page";
import CreateGroupPageView from "./CreateGroupPageView";
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQueryClient } from "react-query";
import { createGroup } from "api/queries/groups";

export const CreateGroupPage: FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/GroupsPage/GroupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
} from "components/TableToolbar/TableToolbar";
import { UserAvatar } from "components/UserAvatar/UserAvatar";
import { isEveryoneGroup } from "utils/groups";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQuery, useQueryClient } from "react-query";
import {
addMember,
deleteGroup,
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/GroupsPage/GroupsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FC, useEffect } from "react";
import { Helmet } from "react-helmet-async";
import { pageTitle } from "utils/page";
import GroupsPageView from "./GroupsPageView";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { groups } from "api/queries/groups";
import { displayError } from "components/GlobalSnackbar/utils";
import { getErrorMessage } from "api/errors";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/GroupsPage/SettingsGroupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Helmet } from "react-helmet-async";
import { useNavigate, useParams } from "react-router-dom";
import { pageTitle } from "utils/page";
import SettingsGroupPageView from "./SettingsGroupPageView";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { group, patchGroup } from "api/queries/groups";
import { displayError } from "components/GlobalSnackbar/utils";
import { getErrorMessage } from "api/errors";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/HealthPage/HealthPage.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Box from "@mui/material/Box";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getHealth } from "api/api";
import { Loader } from "components/Loader/Loader";
import { useTab } from "hooks";
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/SetupPage/SetupPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Helmet } from "react-helmet-async";
import { pageTitle } from "utils/page";
import { SetupPageView } from "./SetupPageView";
import { Navigate } from "react-router-dom";
import { useMutation } from "@tanstack/react-query";
import { useMutation } from "react-query";
import { createFirstUser } from "api/queries/users";

export const SetupPage: FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/StarterTemplatePage/StarterTemplatePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Helmet } from "react-helmet-async";
import { useParams } from "react-router-dom";
import { pageTitle } from "utils/page";
import { StarterTemplatePageView } from "./StarterTemplatePageView";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { templateExamples } from "api/queries/templates";

const StarterTemplatePage: FC = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FC } from "react";
import { Helmet } from "react-helmet-async";
import { pageTitle } from "utils/page";
import { StarterTemplatesPageView } from "./StarterTemplatesPageView";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { templateExamples } from "api/queries/templates";
import { getTemplatesByTag } from "utils/starterTemplates";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Button from "@mui/material/Button";
import FormControlLabel from "@mui/material/FormControlLabel";
import Radio from "@mui/material/Radio";
import RadioGroup from "@mui/material/RadioGroup";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getTemplateVersionRichParameters } from "api/api";
import { Template, TemplateVersionParameter } from "api/typesGenerated";
import { FormSection, VerticalForm } from "components/Form/Form";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getPreviousTemplateVersionByName } from "api/api";
import { TemplateVersion } from "api/typesGenerated";
import { Loader } from "components/Loader/Loader";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import LinearProgress from "@mui/material/LinearProgress";
import Box from "@mui/material/Box";
import { styled, useTheme } from "@mui/material/styles";
import { BoxProps } from "@mui/system";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import {
ActiveUsersTitle,
ActiveUserChart,
Expand Down
2 changes: 1 addition & 1 deletion site/src/pages/TemplatePage/TemplateLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
getTemplateByName,
getTemplateVersion,
} from "api/api";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { AuthorizationRequest } from "api/typesGenerated";
import { ErrorAlert } from "components/Alert/ErrorAlert";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FC } from "react";
import { Helmet } from "react-helmet-async";
import { getTemplatePageTitle } from "../utils";
import { TemplateSummaryPageView } from "./TemplateSummaryPageView";
import { useQuery } from "@tanstack/react-query";
import { useQuery } from "react-query";
import { getTemplateVersionResources } from "api/api";

export const TemplateSummaryPage: FC = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMutation, useQuery } from "@tanstack/react-query";
import { useMutation, useQuery } from "react-query";
import { getTemplateVersions, updateActiveTemplateVersion } from "api/api";
import { getErrorMessage } from "api/errors";
import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQueryClient } from "react-query";
import { updateTemplateMeta } from "api/api";
import { UpdateTemplateMeta } from "api/typesGenerated";
import { displaySuccess } from "components/GlobalSnackbar/utils";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMutation, useQueryClient } from "@tanstack/react-query";
import { useMutation, useQueryClient } from "react-query";
import { updateTemplateMeta } from "api/api";
import { UpdateTemplateMeta } from "api/typesGenerated";
import { useDashboard } from "components/Dashboard/DashboardProvider";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { action } from "@storybook/addon-actions";
import { Meta, StoryObj } from "@storybook/react";
import { MockTemplate } from "testHelpers/entities";
import { TemplateSchedulePageView } from "./TemplateSchedulePageView";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { QueryClient, QueryClientProvider } from "react-query";

const queryClient = new QueryClient({
defaultOptions: {
Expand Down
Loading