@trpc/next 11.0.0-rc.621 → 11.0.0-rc.632

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.
@@ -9,7 +9,7 @@ function experimental_createTRPCNextAppDirClient(opts) {
9
9
  const client$1 = client.createTRPCUntypedClient(opts.config());
10
10
  // const useProxy = createUseProxy<TRouter>(client);
11
11
  const cache = new Map();
12
- return unstableCoreDoNotImport.createRecursiveProxy(({ path , args })=>{
12
+ return unstableCoreDoNotImport.createRecursiveProxy(({ path, args })=>{
13
13
  // const pathCopy = [key, ...path];
14
14
  const pathCopy = [
15
15
  ...path
@@ -31,11 +31,11 @@ function experimental_createTRPCNextAppDirClient(opts) {
31
31
  if (procedureType !== 'query') {
32
32
  return promise;
33
33
  }
34
- const queryCacheKey1 = JSON.stringify([
34
+ const queryCacheKey = JSON.stringify([
35
35
  path,
36
36
  args[0]
37
37
  ]);
38
- cache.set(queryCacheKey1, {
38
+ cache.set(queryCacheKey, {
39
39
  promise
40
40
  });
41
41
  return promise;
@@ -7,7 +7,7 @@ function experimental_createTRPCNextAppDirClient(opts) {
7
7
  const client = createTRPCUntypedClient(opts.config());
8
8
  // const useProxy = createUseProxy<TRouter>(client);
9
9
  const cache = new Map();
10
- return createRecursiveProxy(({ path , args })=>{
10
+ return createRecursiveProxy(({ path, args })=>{
11
11
  // const pathCopy = [key, ...path];
12
12
  const pathCopy = [
13
13
  ...path
@@ -29,11 +29,11 @@ function experimental_createTRPCNextAppDirClient(opts) {
29
29
  if (procedureType !== 'query') {
30
30
  return promise;
31
31
  }
32
- const queryCacheKey1 = JSON.stringify([
32
+ const queryCacheKey = JSON.stringify([
33
33
  path,
34
34
  args[0]
35
35
  ]);
36
- cache.set(queryCacheKey1, {
36
+ cache.set(queryCacheKey, {
37
37
  promise
38
38
  });
39
39
  return promise;
@@ -11,7 +11,7 @@ var shared = require('./shared.js');
11
11
  function experimental_serverActionLink(...args) {
12
12
  const [opts] = args;
13
13
  const transformer = unstableInternals.getTransformer(opts?.transformer);
14
- return ()=>({ op })=>observable.observable((observer)=>{
14
+ return ()=>({ op })=>observable.observable((observer)=>{
15
15
  const context = op.context;
16
16
  context._action(shared.isFormData(op.input) ? op.input : transformer.input.serialize(op.input)).then((data)=>{
17
17
  const transformed = unstableCoreDoNotImport.transformResult(data, transformer.output);
@@ -9,7 +9,7 @@ import { isFormData } from './shared.mjs';
9
9
  function experimental_serverActionLink(...args) {
10
10
  const [opts] = args;
11
11
  const transformer = getTransformer(opts?.transformer);
12
- return ()=>({ op })=>observable((observer)=>{
12
+ return ()=>({ op })=>observable((observer)=>{
13
13
  const context = op.context;
14
14
  context._action(isFormData(op.input) ? op.input : transformer.input.serialize(op.input)).then((data)=>{
15
15
  const transformed = transformResult(data, transformer.output);
@@ -11,8 +11,8 @@ var shared = require('../shared.js');
11
11
  // ts-prune-ignore-next
12
12
  function experimental_nextCacheLink(opts) {
13
13
  const transformer = unstableInternals.getTransformer(opts.transformer);
14
- return ()=>({ op })=>observable.observable((observer)=>{
15
- const { path , input , type , context } = op;
14
+ return ()=>({ op })=>observable.observable((observer)=>{
15
+ const { path, input, type, context } = op;
16
16
  const cacheTag = shared.generateCacheTag(path, input);
17
17
  // Let per-request revalidate override global revalidate
18
18
  const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
@@ -9,8 +9,8 @@ import { generateCacheTag } from '../shared.mjs';
9
9
  // ts-prune-ignore-next
10
10
  function experimental_nextCacheLink(opts) {
11
11
  const transformer = getTransformer(opts.transformer);
12
- return ()=>({ op })=>observable((observer)=>{
13
- const { path , input , type , context } = op;
12
+ return ()=>({ op })=>observable((observer)=>{
13
+ const { path, input, type, context } = op;
14
14
  const cacheTag = generateCacheTag(path, input);
15
15
  // Let per-request revalidate override global revalidate
16
16
  const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
@@ -7,7 +7,7 @@ var shared = require('../shared.js');
7
7
  function experimental_nextHttpLink(opts) {
8
8
  return (runtime)=>{
9
9
  return (ctx)=>{
10
- const { path , input , context } = ctx.op;
10
+ const { path, input, context } = ctx.op;
11
11
  const cacheTag = shared.generateCacheTag(path, input);
12
12
  // Let per-request revalidate override global revalidate
13
13
  const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
@@ -5,7 +5,7 @@ import { generateCacheTag } from '../shared.mjs';
5
5
  function experimental_nextHttpLink(opts) {
6
6
  return (runtime)=>{
7
7
  return (ctx)=>{
8
- const { path , input , context } = ctx.op;
8
+ const { path, input, context } = ctx.op;
9
9
  const cacheTag = generateCacheTag(path, input);
10
10
  // Let per-request revalidate override global revalidate
11
11
  const requestRevalidate = typeof context['revalidate'] === 'number' || context['revalidate'] === false ? context['revalidate'] : undefined;
@@ -36,7 +36,7 @@ function experimental_createTRPCNextAppDirServer(opts) {
36
36
  /**
37
37
  * Rethrow errors that should be handled by Next.js
38
38
  */ const throwNextErrors = (error)=>{
39
- const { cause } = error;
39
+ const { cause } = error;
40
40
  if (redirect.isRedirectError(cause) || notFound.isNotFoundError(cause)) {
41
41
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
42
42
  throw error.cause;
@@ -44,7 +44,7 @@ function experimental_createTRPCNextAppDirServer(opts) {
44
44
  };
45
45
  function experimental_createServerActionHandler(t, opts) {
46
46
  const config = t._config;
47
- const { normalizeFormData =true , createContext , rethrowNextErrors =true , } = opts;
47
+ const { normalizeFormData = true, createContext, rethrowNextErrors = true } = opts;
48
48
  const transformer = config.transformer;
49
49
  // TODO allow this to take a `TRouter` in addition to a `AnyProcedure`
50
50
  return function createServerAction(proc) {
@@ -109,7 +109,7 @@ function experimental_createServerActionHandler(t, opts) {
109
109
  }
110
110
  // ts-prune-ignore-next
111
111
  async function experimental_revalidateEndpoint(req) {
112
- const { cacheTag } = await req.json();
112
+ const { cacheTag } = await req.json();
113
113
  if (typeof cacheTag !== 'string') {
114
114
  return new Response(JSON.stringify({
115
115
  revalidated: false,
@@ -34,7 +34,7 @@ function experimental_createTRPCNextAppDirServer(opts) {
34
34
  /**
35
35
  * Rethrow errors that should be handled by Next.js
36
36
  */ const throwNextErrors = (error)=>{
37
- const { cause } = error;
37
+ const { cause } = error;
38
38
  if (isRedirectError(cause) || isNotFoundError(cause)) {
39
39
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
40
40
  throw error.cause;
@@ -42,7 +42,7 @@ function experimental_createTRPCNextAppDirServer(opts) {
42
42
  };
43
43
  function experimental_createServerActionHandler(t, opts) {
44
44
  const config = t._config;
45
- const { normalizeFormData =true , createContext , rethrowNextErrors =true , } = opts;
45
+ const { normalizeFormData = true, createContext, rethrowNextErrors = true } = opts;
46
46
  const transformer = config.transformer;
47
47
  // TODO allow this to take a `TRouter` in addition to a `AnyProcedure`
48
48
  return function createServerAction(proc) {
@@ -107,7 +107,7 @@ function experimental_createServerActionHandler(t, opts) {
107
107
  }
108
108
  // ts-prune-ignore-next
109
109
  async function experimental_revalidateEndpoint(req) {
110
- const { cacheTag } = await req.json();
110
+ const { cacheTag } = await req.json();
111
111
  if (typeof cacheTag !== 'string') {
112
112
  return new Response(JSON.stringify({
113
113
  revalidated: false,
@@ -1,23 +1,23 @@
1
1
  {
2
- "bundleSize": 23042,
2
+ "bundleSize": 22997,
3
3
  "bundleOrigSize": 37951,
4
- "bundleReduction": 39.28,
4
+ "bundleReduction": 39.4,
5
5
  "modules": [
6
6
  {
7
7
  "id": "/src/ssrPrepass.ts",
8
- "size": 5059,
8
+ "size": 5056,
9
9
  "origSize": 5851,
10
10
  "renderedExports": [
11
11
  "ssrPrepass"
12
12
  ],
13
13
  "removedExports": [],
14
14
  "dependents": [],
15
- "percent": 21.96,
16
- "reduction": 13.54
15
+ "percent": 21.99,
16
+ "reduction": 13.59
17
17
  },
18
18
  {
19
19
  "id": "/src/app-dir/server.ts",
20
- "size": 4577,
20
+ "size": 4572,
21
21
  "origSize": 6225,
22
22
  "renderedExports": [
23
23
  "experimental_createTRPCNextAppDirServer",
@@ -26,42 +26,42 @@
26
26
  ],
27
27
  "removedExports": [],
28
28
  "dependents": [],
29
- "percent": 19.86,
30
- "reduction": 26.47
29
+ "percent": 19.88,
30
+ "reduction": 26.55
31
31
  },
32
32
  {
33
- "id": "/src/withTRPC.tsx",
34
- "size": 3448,
35
- "origSize": 6138,
33
+ "id": "/src/app-dir/create-action-hook.tsx",
34
+ "size": 3435,
35
+ "origSize": 6799,
36
36
  "renderedExports": [
37
- "withTRPC"
37
+ "experimental_serverActionLink",
38
+ "experimental_createActionHook"
38
39
  ],
39
40
  "removedExports": [],
40
41
  "dependents": [
41
- "/src/index.ts",
42
- "/src/createTRPCNext.tsx"
42
+ "/src/app-dir/client.ts"
43
43
  ],
44
- "percent": 14.96,
45
- "reduction": 43.83
44
+ "percent": 14.94,
45
+ "reduction": 49.48
46
46
  },
47
47
  {
48
- "id": "/src/app-dir/create-action-hook.tsx",
49
- "size": 3436,
50
- "origSize": 6799,
48
+ "id": "/src/withTRPC.tsx",
49
+ "size": 3424,
50
+ "origSize": 6138,
51
51
  "renderedExports": [
52
- "experimental_serverActionLink",
53
- "experimental_createActionHook"
52
+ "withTRPC"
54
53
  ],
55
54
  "removedExports": [],
56
55
  "dependents": [
57
- "/src/app-dir/client.ts"
56
+ "/src/index.ts",
57
+ "/src/createTRPCNext.tsx"
58
58
  ],
59
- "percent": 14.91,
60
- "reduction": 49.46
59
+ "percent": 14.89,
60
+ "reduction": 44.22
61
61
  },
62
62
  {
63
63
  "id": "/src/app-dir/links/nextCache.ts",
64
- "size": 2618,
64
+ "size": 2613,
65
65
  "origSize": 3079,
66
66
  "renderedExports": [
67
67
  "experimental_nextCacheLink"
@@ -69,23 +69,23 @@
69
69
  "removedExports": [],
70
70
  "dependents": [],
71
71
  "percent": 11.36,
72
- "reduction": 14.97
72
+ "reduction": 15.13
73
73
  },
74
74
  {
75
75
  "id": "/src/app-dir/client.ts",
76
- "size": 1279,
76
+ "size": 1275,
77
77
  "origSize": 1892,
78
78
  "renderedExports": [
79
79
  "experimental_createTRPCNextAppDirClient"
80
80
  ],
81
81
  "removedExports": [],
82
82
  "dependents": [],
83
- "percent": 5.55,
84
- "reduction": 32.4
83
+ "percent": 5.54,
84
+ "reduction": 32.61
85
85
  },
86
86
  {
87
87
  "id": "/src/app-dir/links/nextHttp.ts",
88
- "size": 1192,
88
+ "size": 1189,
89
89
  "origSize": 1973,
90
90
  "renderedExports": [
91
91
  "experimental_nextHttpLink"
@@ -93,7 +93,7 @@
93
93
  "removedExports": [],
94
94
  "dependents": [],
95
95
  "percent": 5.17,
96
- "reduction": 39.58
96
+ "reduction": 39.74
97
97
  },
98
98
  {
99
99
  "id": "/src/createTRPCNext.tsx",
@@ -126,7 +126,7 @@
126
126
  "/src/app-dir/links/nextCache.ts",
127
127
  "/src/app-dir/create-action-hook.tsx"
128
128
  ],
129
- "percent": 1.45,
129
+ "percent": 1.46,
130
130
  "reduction": 89.39
131
131
  },
132
132
  {
@@ -25,7 +25,7 @@ function transformQueryOrMutationCacheErrors(result) {
25
25
  return result;
26
26
  }
27
27
  const ssrPrepass = (opts)=>{
28
- const { parent , WithTRPC , AppOrPage } = opts;
28
+ const { parent, WithTRPC, AppOrPage } = opts;
29
29
  const transformer = unstableInternals.getTransformer(parent.transformer);
30
30
  WithTRPC.getInitialProps = async (appOrPageCtx)=>{
31
31
  const shouldSsr = async ()=>{
@@ -23,7 +23,7 @@ function transformQueryOrMutationCacheErrors(result) {
23
23
  return result;
24
24
  }
25
25
  const ssrPrepass = (opts)=>{
26
- const { parent , WithTRPC , AppOrPage } = opts;
26
+ const { parent, WithTRPC, AppOrPage } = opts;
27
27
  const transformer = getTransformer(parent.transformer);
28
28
  WithTRPC.getInitialProps = async (appOrPageCtx)=>{
29
29
  const shouldSsr = async ()=>{
package/dist/withTRPC.js CHANGED
@@ -6,7 +6,7 @@ var shared = require('@trpc/react-query/shared');
6
6
  var React = require('react');
7
7
 
8
8
  function withTRPC(opts) {
9
- const { config: getClientConfig } = opts;
9
+ const { config: getClientConfig } = opts;
10
10
  const transformer = unstableInternals.getTransformer(opts.transformer);
11
11
  return (AppOrPage)=>{
12
12
  const trpc = shared.createRootHooks(opts);
@@ -26,7 +26,7 @@ function withTRPC(opts) {
26
26
  ssrContext: null
27
27
  };
28
28
  });
29
- const { queryClient , trpcClient , ssrState , ssrContext } = prepassProps;
29
+ const { queryClient, trpcClient, ssrState, ssrContext } = prepassProps;
30
30
  // allow normal components to be wrapped, not just app/pages
31
31
  const trpcState = props.pageProps?.trpcState;
32
32
  const hydratedState = React.useMemo(()=>{
@@ -49,7 +49,7 @@ function withTRPC(opts) {
49
49
  client: queryClient
50
50
  }, /*#__PURE__*/ React.createElement(reactQuery.HydrationBoundary, {
51
51
  state: hydratedState
52
- }, /*#__PURE__*/ React.createElement(AppOrPage, Object.assign({}, props)))));
52
+ }, /*#__PURE__*/ React.createElement(AppOrPage, props))));
53
53
  };
54
54
  if (opts.ssr) {
55
55
  opts.ssrPrepass({
package/dist/withTRPC.mjs CHANGED
@@ -4,7 +4,7 @@ import { createRootHooks, getQueryClient } from '@trpc/react-query/shared';
4
4
  import React, { useState } from 'react';
5
5
 
6
6
  function withTRPC(opts) {
7
- const { config: getClientConfig } = opts;
7
+ const { config: getClientConfig } = opts;
8
8
  const transformer = getTransformer(opts.transformer);
9
9
  return (AppOrPage)=>{
10
10
  const trpc = createRootHooks(opts);
@@ -24,7 +24,7 @@ function withTRPC(opts) {
24
24
  ssrContext: null
25
25
  };
26
26
  });
27
- const { queryClient , trpcClient , ssrState , ssrContext } = prepassProps;
27
+ const { queryClient, trpcClient, ssrState, ssrContext } = prepassProps;
28
28
  // allow normal components to be wrapped, not just app/pages
29
29
  const trpcState = props.pageProps?.trpcState;
30
30
  const hydratedState = React.useMemo(()=>{
@@ -47,7 +47,7 @@ function withTRPC(opts) {
47
47
  client: queryClient
48
48
  }, /*#__PURE__*/ React.createElement(HydrationBoundary, {
49
49
  state: hydratedState
50
- }, /*#__PURE__*/ React.createElement(AppOrPage, Object.assign({}, props)))));
50
+ }, /*#__PURE__*/ React.createElement(AppOrPage, props))));
51
51
  };
52
52
  if (opts.ssr) {
53
53
  opts.ssrPrepass({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trpc/next",
3
- "version": "11.0.0-rc.621+87fde6297",
3
+ "version": "11.0.0-rc.632+3df8b21be",
4
4
  "description": "The tRPC Next.js library",
5
5
  "author": "KATT",
6
6
  "license": "MIT",
@@ -73,9 +73,9 @@
73
73
  ],
74
74
  "peerDependencies": {
75
75
  "@tanstack/react-query": "^5.59.15",
76
- "@trpc/client": "11.0.0-rc.621+87fde6297",
77
- "@trpc/react-query": "11.0.0-rc.621+87fde6297",
78
- "@trpc/server": "11.0.0-rc.621+87fde6297",
76
+ "@trpc/client": "11.0.0-rc.632+3df8b21be",
77
+ "@trpc/react-query": "11.0.0-rc.632+3df8b21be",
78
+ "@trpc/server": "11.0.0-rc.632+3df8b21be",
79
79
  "next": "15.0.3",
80
80
  "react": ">=16.8.0",
81
81
  "react-dom": ">=16.8.0"
@@ -90,11 +90,11 @@
90
90
  },
91
91
  "devDependencies": {
92
92
  "@tanstack/react-query": "^5.59.15",
93
- "@trpc/client": "11.0.0-rc.621+87fde6297",
94
- "@trpc/react-query": "11.0.0-rc.621+87fde6297",
95
- "@trpc/server": "11.0.0-rc.621+87fde6297",
93
+ "@trpc/client": "11.0.0-rc.632+3df8b21be",
94
+ "@trpc/react-query": "11.0.0-rc.632+3df8b21be",
95
+ "@trpc/server": "11.0.0-rc.632+3df8b21be",
96
96
  "@types/express": "^4.17.17",
97
- "@types/node": "^20.17.3",
97
+ "@types/node": "^22.9.0",
98
98
  "@types/react": "^18.3.1",
99
99
  "@types/react-dom": "^18.3.0",
100
100
  "eslint": "^9.13.0",
@@ -102,7 +102,7 @@
102
102
  "next": "^15.0.2",
103
103
  "react": "^18.3.1",
104
104
  "react-dom": "^18.3.1",
105
- "rollup": "^4.9.5",
105
+ "rollup": "^4.24.4",
106
106
  "tsx": "^4.0.0",
107
107
  "zod": "^3.0.0"
108
108
  },
@@ -112,5 +112,5 @@
112
112
  "funding": [
113
113
  "https://trpc.io/sponsor"
114
114
  ],
115
- "gitHead": "87fde62978441b1cedd1d5cf7290f6ade9a92607"
115
+ "gitHead": "3df8b21beb4925cf73194fc776d1a88603a3c420"
116
116
  }