@trpc/next 10.34.0 → 10.34.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"nextCache.d.ts","sourceRoot":"","sources":["../../../src/app-dir/links/nextCache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,QAAQ,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAiB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAK5E,KAAK,oBAAoB,CAAC,OAAO,SAAS,SAAS,IAAI;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7B,CAAC;AAGF,wBAAgB,0BAA0B,CAAC,OAAO,SAAS,SAAS,EAClE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAClC,QAAQ,CAAC,OAAO,CAAC,CAqDnB"}
1
+ {"version":3,"file":"nextCache.d.ts","sourceRoot":"","sources":["../../../src/app-dir/links/nextCache.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,QAAQ,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,SAAS,EAAiB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAK5E,KAAK,oBAAoB,CAAC,OAAO,SAAS,SAAS,IAAI;IACrD,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,OAAO,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1D,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC7B,CAAC;AAGF,wBAAgB,0BAA0B,CAAC,OAAO,SAAS,SAAS,EAClE,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAClC,QAAQ,CAAC,OAAO,CAAC,CAwDnB"}
@@ -19,7 +19,10 @@ function experimental_nextCacheLink(opts) {
19
19
  const requestRevalidate = typeof context.revalidate === 'number' || context.revalidate === false ? context.revalidate : undefined;
20
20
  const revalidate = requestRevalidate ?? opts.revalidate ?? false;
21
21
  const promise = opts.createContext().then(async (ctx)=>{
22
- const callProc = async ()=>{
22
+ const callProc = async (_cachebuster)=>{
23
+ // // _cachebuster is not used by us but to make sure
24
+ // // that calls with different tags are properly separated
25
+ // // @link https://github.com/trpc/trpc/issues/4622
23
26
  const procedureResult = await server.callProcedure({
24
27
  procedures: opts.router._def.procedures,
25
28
  path,
@@ -36,7 +39,7 @@ function experimental_nextCacheLink(opts) {
36
39
  tags: [
37
40
  cacheTag
38
41
  ]
39
- })();
42
+ })(cacheTag);
40
43
  }
41
44
  return callProc();
42
45
  }).catch((cause)=>{
@@ -15,7 +15,10 @@ function experimental_nextCacheLink(opts) {
15
15
  const requestRevalidate = typeof context.revalidate === 'number' || context.revalidate === false ? context.revalidate : undefined;
16
16
  const revalidate = requestRevalidate ?? opts.revalidate ?? false;
17
17
  const promise = opts.createContext().then(async (ctx)=>{
18
- const callProc = async ()=>{
18
+ const callProc = async (_cachebuster)=>{
19
+ // // _cachebuster is not used by us but to make sure
20
+ // // that calls with different tags are properly separated
21
+ // // @link https://github.com/trpc/trpc/issues/4622
19
22
  const procedureResult = await callProcedure({
20
23
  procedures: opts.router._def.procedures,
21
24
  path,
@@ -32,7 +35,7 @@ function experimental_nextCacheLink(opts) {
32
35
  tags: [
33
36
  cacheTag
34
37
  ]
35
- })();
38
+ })(cacheTag);
36
39
  }
37
40
  return callProc();
38
41
  }).catch((cause)=>{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/next",
3
- "version": "10.34.0",
3
+ "version": "10.34.1",
4
4
  "description": "The tRPC Next.js library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -66,9 +66,9 @@
66
66
  ],
67
67
  "peerDependencies": {
68
68
  "@tanstack/react-query": "^4.18.0",
69
- "@trpc/client": "10.34.0",
70
- "@trpc/react-query": "10.34.0",
71
- "@trpc/server": "10.34.0",
69
+ "@trpc/client": "10.34.1",
70
+ "@trpc/react-query": "10.34.1",
71
+ "@trpc/server": "10.34.1",
72
72
  "next": "*",
73
73
  "react": ">=16.8.0",
74
74
  "react-dom": ">=16.8.0"
@@ -78,9 +78,9 @@
78
78
  },
79
79
  "devDependencies": {
80
80
  "@tanstack/react-query": "^4.18.0",
81
- "@trpc/client": "10.34.0",
82
- "@trpc/react-query": "10.34.0",
83
- "@trpc/server": "10.34.0",
81
+ "@trpc/client": "10.34.1",
82
+ "@trpc/react-query": "10.34.1",
83
+ "@trpc/server": "10.34.1",
84
84
  "@types/express": "^4.17.17",
85
85
  "@types/node": "^18.16.16",
86
86
  "@types/react": "^18.2.8",
@@ -100,5 +100,5 @@
100
100
  "funding": [
101
101
  "https://trpc.io/sponsor"
102
102
  ],
103
- "gitHead": "4b4bb80470b0f03626b6861c2b4cdfc8bb3afd81"
103
+ "gitHead": "8e4676ad23d6220d6462850d277924735c85cc78"
104
104
  }
@@ -33,7 +33,10 @@ export function experimental_nextCacheLink<TRouter extends AnyRouter>(
33
33
  const promise = opts
34
34
  .createContext()
35
35
  .then(async (ctx) => {
36
- const callProc = async () => {
36
+ const callProc = async (_cachebuster: string) => {
37
+ // // _cachebuster is not used by us but to make sure
38
+ // // that calls with different tags are properly separated
39
+ // // @link https://github.com/trpc/trpc/issues/4622
37
40
  const procedureResult = await callProcedure({
38
41
  procedures: opts.router._def.procedures,
39
42
  path,
@@ -50,10 +53,10 @@ export function experimental_nextCacheLink<TRouter extends AnyRouter>(
50
53
  return unstable_cache(callProc, path.split('.'), {
51
54
  revalidate,
52
55
  tags: [cacheTag],
53
- })();
56
+ })(cacheTag);
54
57
  }
55
58
 
56
- return callProc();
59
+ return callProc(cacheTag);
57
60
  })
58
61
  .catch((cause) => {
59
62
  observer.error(TRPCClientError.from(cause));