-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(
react-query
): allow for external apps in `createServerSideHelp…
…ers` (#4547) Co-authored-by: EmericW <emericwarnez@bitsoflove.be> Co-authored-by: Emeric Warnez <emericwarnez@Emerics-MacBook-Pro.local>
- Loading branch information
1 parent
6a7096d
commit 5fa756a
Showing
8 changed files
with
258 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,4 +1,9 @@ | ||
export { createServerSideHelpers } from './ssgProxy'; | ||
export type { CreateSSGHelpersOptions } from './types'; | ||
export type { | ||
/** | ||
* @deprecated this exported is planned to be removed in the next major version | ||
*/ | ||
CreateServerSideHelpersOptions as CreateSSGHelpersOptions, | ||
} from './types'; | ||
|
||
export type { DecoratedProcedureSSGRecord } from './ssgProxy'; |
This file contains 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 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 |
---|---|---|
@@ -1,14 +1,23 @@ | ||
import { inferRouterProxyClient } from '@trpc/client'; | ||
import { | ||
AnyRouter, | ||
ClientDataTransformerOptions, | ||
inferRouterContext, | ||
} from '@trpc/server'; | ||
import { CreateTRPCReactQueryClientConfig } from '../shared'; | ||
|
||
interface CreateSSGHelpersOptionsBase<TRouter extends AnyRouter> { | ||
interface CreateSSGHelpersInternal<TRouter extends AnyRouter> { | ||
router: TRouter; | ||
ctx: inferRouterContext<TRouter>; | ||
transformer?: ClientDataTransformerOptions; | ||
} | ||
export type CreateSSGHelpersOptions<TRouter extends AnyRouter> = | ||
CreateSSGHelpersOptionsBase<TRouter> & CreateTRPCReactQueryClientConfig; | ||
|
||
interface CreateSSGHelpersExternal<TRouter extends AnyRouter> { | ||
client: inferRouterProxyClient<TRouter>; | ||
} | ||
|
||
export type CreateServerSideHelpersOptions<TRouter extends AnyRouter> = ( | ||
| CreateSSGHelpersInternal<TRouter> | ||
| CreateSSGHelpersExternal<TRouter> | ||
) & | ||
CreateTRPCReactQueryClientConfig; |
This file contains 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 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
Oops, something went wrong.
5fa756a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
www – ./www
alpha.trpc.io
www-git-main-trpc.vercel.app
www.trpc.io
beta.trpc.io
trpc.io
www-trpc.vercel.app
5fa756a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-prisma-starter – ./examples/next-prisma-starter
nextjs.trpc.io
next-prisma-starter-trpc.vercel.app
next-prisma-starter-git-main-trpc.vercel.app
5fa756a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
og-image – ./www/og-image
og-image-git-main-trpc.vercel.app
og-image-trpc.vercel.app
og-image-three-neon.vercel.app
og-image.trpc.io