Skip to content

Commit

Permalink
fix(react-query): skip export * from @trpc/client (trpc#6382)
Browse files Browse the repository at this point in the history
  • Loading branch information
KATT authored Jan 12, 2025
1 parent 8ff4ef8 commit e5c0c1a
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/next/src/ssrPrepass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import type { DehydratedState } from '@tanstack/react-query';
import { dehydrate } from '@tanstack/react-query';
import { createTRPCUntypedClient } from '@trpc/client';
import type { TRPCClientError, TRPCClientErrorLike } from '@trpc/client';
import type { CoercedTransformerParameters } from '@trpc/client/unstable-internals';
import { getTransformer } from '@trpc/client/unstable-internals';
import type { TRPCClientError, TRPCClientErrorLike } from '@trpc/client';
import { getQueryClient } from '@trpc/react-query/shared';
import type {
AnyRouter,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/withTRPC.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { HydrationBoundary, QueryClientProvider } from '@tanstack/react-query';
import type {
CreateTRPCClientOptions,
inferRouterClient,
TRPCClientError,
TRPCUntypedClient,
} from '@trpc/client';
import type { CoercedTransformerParameters } from '@trpc/client/unstable-internals';
import {
getTransformer,
type TransformerOptions,
} from '@trpc/client/unstable-internals';
import type { TRPCClientError } from '@trpc/client';
import type {
CreateTRPCReactOptions,
CreateTRPCReactQueryClientConfig,
Expand Down
2 changes: 0 additions & 2 deletions packages/react-query/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export * from '@trpc/client';

export { getQueryKey, getMutationKey } from './internals/getQueryKey';
export {
createTRPCReact,
Expand Down
3 changes: 2 additions & 1 deletion packages/tests/server/react/createClient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { routerToServerAndClientNew } from '../___testHelpers';
import { createQueryClient } from '../__queryClient';
import { QueryClientProvider } from '@tanstack/react-query';
import { render, waitFor } from '@testing-library/react';
import { createTRPCReact, httpBatchLink } from '@trpc/react-query';
import { httpBatchLink } from '@trpc/client';
import { createTRPCReact } from '@trpc/react-query';
import { initTRPC } from '@trpc/server';
import { konn } from 'konn';
import type { ReactNode } from 'react';
Expand Down
3 changes: 2 additions & 1 deletion packages/tests/server/react/multiple-trpc-providers.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { routerToServerAndClientNew } from '../___testHelpers';
import { createQueryClient } from '../__queryClient';
import { QueryClientProvider } from '@tanstack/react-query';
import { render, waitFor } from '@testing-library/react';
import { createTRPCReact, getUntypedClient } from '@trpc/react-query';
import { getUntypedClient } from '@trpc/client';
import { createTRPCReact } from '@trpc/react-query';
import { initTRPC } from '@trpc/server';
import { konn } from 'konn';
import React, { createContext } from 'react';
Expand Down
3 changes: 2 additions & 1 deletion packages/tests/server/react/overrides.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { routerToServerAndClientNew } from '../___testHelpers';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { createTRPCReact, getUntypedClient } from '@trpc/react-query';
import { getUntypedClient } from '@trpc/client';
import { createTRPCReact } from '@trpc/react-query';
import { initTRPC } from '@trpc/server';
import { konn } from 'konn';
import type { ReactNode } from 'react';
Expand Down
3 changes: 2 additions & 1 deletion packages/tests/server/react/queryClientDefaults.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { routerToServerAndClientNew } from '../___testHelpers';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { createTRPCReact, getUntypedClient } from '@trpc/react-query';
import { getUntypedClient } from '@trpc/client';
import { createTRPCReact } from '@trpc/react-query';
import { initTRPC } from '@trpc/server';
import { konn } from 'konn';
import type { ReactNode } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createTRPCProxyClient } from '@trpc/react-query';
import { createTRPCProxyClient } from '@trpc/client';
import type { inferRouterInputs } from '@trpc/server';
import { experimental_standaloneMiddleware, initTRPC } from '@trpc/server';
import * as z from 'zod';
Expand Down
6 changes: 6 additions & 0 deletions www/docs/migration/migrate-from-v10-to-v11.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ import { InstallSnippet } from '@site/src/components/InstallSnippet';
> This is a draft document. It will be updated to a proper guide as we get closer to the v11 release.
> The only major thing that will incur work for you is that you will need to do is to update TanStack Query to v5.0.0.
### Removed export of `@trpc/client` from `@trpc/react-query` (non-breaking)

We have removed the re-exports of `@trpc/client` types and utilities from the `@trpc/react-query` package.

This should not be a breaking change, but if you have missing imports after upgrading, you may need to update some import statements from `from '@trpc/react-query'` to `from '@trpc/client'`.

### Moved `reconnectAfterInactivityMs` to `sse.client` (non-breaking)

Updated [HTTP Subscription Link improvements](#http-subscription-link-improvements)-section and related docs.
Expand Down

0 comments on commit e5c0c1a

Please sign in to comment.