diff --git a/.changeset/pre.json b/.changeset/pre.json index eb5b6ad..5f14877 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -13,5 +13,7 @@ "e2e": "1.0.0", "unit": "1.0.0" }, - "changesets": [] + "changesets": [ + "tender-ducks-bow" + ] } diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index ed6fade..90a7eb1 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -1,5 +1,36 @@ # @trpc-swr/client +## 3.0.0-canary.0 + +### Major Changes + +- [#54](https://github.com/sannajammeh/trpc-swr/pull/54) [`5b020a2`](https://github.com/sannajammeh/trpc-swr/commit/5b020a2a9d01e86d125eee33192f025ce7e35462) Thanks [@sannajammeh](https://github.com/sannajammeh)! - ## What: + + `@trpc-swr/ssr` - `createProxySSGHelpers` renamed to `createSSRHelpers` + + `@trpc-swr/ssr` - Calling `api.endpoint.fetch` is no longer support, use api.endpoint() directly. trpc-swr will now proxy all arguments directly into appRouter.createCaller() instead of calling `caller.query`. + This allows for both mutations and queries to endpoints in React Server Components and other SSR calls + + #### Before + + ```tsx + const data = await rsc.users.byId.fetch({ id: 1 }); + + const swrFallback = await rsc.dehydrate(); + ``` + + #### After + + ```tsx + const data = await rsc.users.byId({ id: 1 }); + + // Other supported methods: + const key = rsc.users.byId.getKey(); // Use to manually forward to SWRConfig. + const swrFallback = await rsc.dehydrate(); + ``` + + As always both direct access and dehydration into SWR serializable fallback is supported. + ## 2.0.1 ### Patch Changes diff --git a/packages/client/package.json b/packages/client/package.json index ac40414..67fac3f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@trpc-swr/client", - "version": "2.0.1", + "version": "3.0.0-canary.0", "description": "", "main": "./dist/index.js", "module": "./dist/index.esm.js", diff --git a/packages/infinite/CHANGELOG.md b/packages/infinite/CHANGELOG.md index e1bb4b3..5d4fe9b 100644 --- a/packages/infinite/CHANGELOG.md +++ b/packages/infinite/CHANGELOG.md @@ -1,5 +1,41 @@ # @trpc-swr/infinite +## 3.0.0-canary.0 + +### Major Changes + +- [#54](https://github.com/sannajammeh/trpc-swr/pull/54) [`5b020a2`](https://github.com/sannajammeh/trpc-swr/commit/5b020a2a9d01e86d125eee33192f025ce7e35462) Thanks [@sannajammeh](https://github.com/sannajammeh)! - ## What: + + `@trpc-swr/ssr` - `createProxySSGHelpers` renamed to `createSSRHelpers` + + `@trpc-swr/ssr` - Calling `api.endpoint.fetch` is no longer support, use api.endpoint() directly. trpc-swr will now proxy all arguments directly into appRouter.createCaller() instead of calling `caller.query`. + This allows for both mutations and queries to endpoints in React Server Components and other SSR calls + + #### Before + + ```tsx + const data = await rsc.users.byId.fetch({ id: 1 }); + + const swrFallback = await rsc.dehydrate(); + ``` + + #### After + + ```tsx + const data = await rsc.users.byId({ id: 1 }); + + // Other supported methods: + const key = rsc.users.byId.getKey(); // Use to manually forward to SWRConfig. + const swrFallback = await rsc.dehydrate(); + ``` + + As always both direct access and dehydration into SWR serializable fallback is supported. + +### Patch Changes + +- Updated dependencies [[`5b020a2`](https://github.com/sannajammeh/trpc-swr/commit/5b020a2a9d01e86d125eee33192f025ce7e35462)]: + - @trpc-swr/client@3.0.0-canary.0 + ## 2.0.1 ### Patch Changes diff --git a/packages/infinite/package.json b/packages/infinite/package.json index 575e49e..35b3d1c 100644 --- a/packages/infinite/package.json +++ b/packages/infinite/package.json @@ -1,6 +1,6 @@ { "name": "@trpc-swr/infinite", - "version": "2.0.1", + "version": "3.0.0-canary.0", "description": "", "main": "./dist/index.js", "module": "./dist/index.esm.js", diff --git a/packages/next/CHANGELOG.md b/packages/next/CHANGELOG.md index 49c1783..b64f2eb 100644 --- a/packages/next/CHANGELOG.md +++ b/packages/next/CHANGELOG.md @@ -1,5 +1,41 @@ # @trpc-swr/next +## 3.0.0-canary.0 + +### Major Changes + +- [#54](https://github.com/sannajammeh/trpc-swr/pull/54) [`5b020a2`](https://github.com/sannajammeh/trpc-swr/commit/5b020a2a9d01e86d125eee33192f025ce7e35462) Thanks [@sannajammeh](https://github.com/sannajammeh)! - ## What: + + `@trpc-swr/ssr` - `createProxySSGHelpers` renamed to `createSSRHelpers` + + `@trpc-swr/ssr` - Calling `api.endpoint.fetch` is no longer support, use api.endpoint() directly. trpc-swr will now proxy all arguments directly into appRouter.createCaller() instead of calling `caller.query`. + This allows for both mutations and queries to endpoints in React Server Components and other SSR calls + + #### Before + + ```tsx + const data = await rsc.users.byId.fetch({ id: 1 }); + + const swrFallback = await rsc.dehydrate(); + ``` + + #### After + + ```tsx + const data = await rsc.users.byId({ id: 1 }); + + // Other supported methods: + const key = rsc.users.byId.getKey(); // Use to manually forward to SWRConfig. + const swrFallback = await rsc.dehydrate(); + ``` + + As always both direct access and dehydration into SWR serializable fallback is supported. + +### Patch Changes + +- Updated dependencies [[`5b020a2`](https://github.com/sannajammeh/trpc-swr/commit/5b020a2a9d01e86d125eee33192f025ce7e35462)]: + - @trpc-swr/client@3.0.0-canary.0 + ## 2.0.1 ### Patch Changes diff --git a/packages/next/package.json b/packages/next/package.json index 4ef17b6..8095128 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "@trpc-swr/next", - "version": "2.0.1", + "version": "3.0.0-canary.0", "description": "", "main": "./dist/index.js", "module": "./dist/index.esm.js", diff --git a/packages/ssr/CHANGELOG.md b/packages/ssr/CHANGELOG.md index 06f0114..4614efa 100644 --- a/packages/ssr/CHANGELOG.md +++ b/packages/ssr/CHANGELOG.md @@ -1,5 +1,41 @@ # @trpc-swr/ssr +## 3.0.0-canary.0 + +### Major Changes + +- [#54](https://github.com/sannajammeh/trpc-swr/pull/54) [`5b020a2`](https://github.com/sannajammeh/trpc-swr/commit/5b020a2a9d01e86d125eee33192f025ce7e35462) Thanks [@sannajammeh](https://github.com/sannajammeh)! - ## What: + + `@trpc-swr/ssr` - `createProxySSGHelpers` renamed to `createSSRHelpers` + + `@trpc-swr/ssr` - Calling `api.endpoint.fetch` is no longer support, use api.endpoint() directly. trpc-swr will now proxy all arguments directly into appRouter.createCaller() instead of calling `caller.query`. + This allows for both mutations and queries to endpoints in React Server Components and other SSR calls + + #### Before + + ```tsx + const data = await rsc.users.byId.fetch({ id: 1 }); + + const swrFallback = await rsc.dehydrate(); + ``` + + #### After + + ```tsx + const data = await rsc.users.byId({ id: 1 }); + + // Other supported methods: + const key = rsc.users.byId.getKey(); // Use to manually forward to SWRConfig. + const swrFallback = await rsc.dehydrate(); + ``` + + As always both direct access and dehydration into SWR serializable fallback is supported. + +### Patch Changes + +- Updated dependencies [[`5b020a2`](https://github.com/sannajammeh/trpc-swr/commit/5b020a2a9d01e86d125eee33192f025ce7e35462)]: + - @trpc-swr/client@3.0.0-canary.0 + ## 2.0.1 ### Patch Changes diff --git a/packages/ssr/package.json b/packages/ssr/package.json index 649dc5f..f841e94 100644 --- a/packages/ssr/package.json +++ b/packages/ssr/package.json @@ -1,6 +1,6 @@ { "name": "@trpc-swr/ssr", - "version": "2.0.1", + "version": "3.0.0-canary.0", "description": "", "main": "./dist/index.js", "module": "./dist/index.esm.js",