@trpc/next 11.0.0-alpha-tmp.198 → 11.0.0-alpha-tmp.213
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.
- package/dist/app-dir/client.d.ts.map +1 -1
- package/dist/app-dir/client.js +3 -3
- package/dist/app-dir/client.mjs +2 -2
- package/dist/app-dir/links/nextCache.js +1 -2
- package/dist/app-dir/links/nextCache.mjs +1 -2
- package/dist/app-dir/links/nextHttp.js +2 -2
- package/dist/app-dir/links/nextHttp.mjs +2 -2
- package/dist/app-dir/server.d.ts.map +1 -1
- package/dist/app-dir/server.js +8 -9
- package/dist/app-dir/server.mjs +2 -3
- package/dist/app-dir/shared.d.ts.map +1 -1
- package/dist/bundle-analysis.json +20 -20
- package/dist/createTRPCNext.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{shared-9db2d50f.mjs → shared-2f1ecbeb.mjs} +1 -1
- package/dist/{shared-8de3ad46.js → shared-62d181e7.js} +1 -1
- package/dist/{shared-7e6f7fee.js → shared-a452b80f.js} +1 -1
- package/package.json +11 -10
- package/src/app-dir/client.ts +1 -2
- package/src/app-dir/server.ts +3 -5
- package/src/app-dir/shared.ts +1 -1
- package/src/createTRPCNext.tsx +1 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/app-dir/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/app-dir/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAwB,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,EAEL,6BAA6B,EAE7B,6BAA6B,EAE7B,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAS9B,wBAAgB,uCAAuC,CACrD,OAAO,SAAS,SAAS,EACzB,IAAI,EAAE,8BAA8B,CAAC,OAAO,CAAC,6BAwC9C"}
|
package/dist/app-dir/client.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var client = require('@trpc/client');
|
|
6
|
-
var
|
|
6
|
+
var core = require('@trpc/core');
|
|
7
7
|
var shared$1 = require('@trpc/client/shared');
|
|
8
8
|
var observable = require('@trpc/core/observable');
|
|
9
9
|
var React = require('react');
|
|
10
|
-
var shared = require('../shared-
|
|
10
|
+
var shared = require('../shared-a452b80f.js');
|
|
11
11
|
|
|
12
12
|
// ts-prune-ignore-next
|
|
13
13
|
function experimental_serverActionLink() {
|
|
@@ -109,7 +109,7 @@ function experimental_createTRPCNextAppDirClient(opts) {
|
|
|
109
109
|
const client$1 = client.createTRPCUntypedClient(opts.config());
|
|
110
110
|
// const useProxy = createUseProxy<TRouter>(client);
|
|
111
111
|
const cache = new Map();
|
|
112
|
-
return
|
|
112
|
+
return core.createRecursiveProxy(({ path , args })=>{
|
|
113
113
|
// const pathCopy = [key, ...path];
|
|
114
114
|
const pathCopy = [
|
|
115
115
|
...path
|
package/dist/app-dir/client.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { TRPCClientError, createTRPCUntypedClient, clientCallTypeToProcedureType } from '@trpc/client';
|
|
2
|
-
import { createRecursiveProxy } from '@trpc/core
|
|
2
|
+
import { createRecursiveProxy } from '@trpc/core';
|
|
3
3
|
import { transformResult } from '@trpc/client/shared';
|
|
4
4
|
import { observable } from '@trpc/core/observable';
|
|
5
5
|
import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
|
|
6
|
-
import { i as isFormData } from '../shared-
|
|
6
|
+
import { i as isFormData } from '../shared-2f1ecbeb.mjs';
|
|
7
7
|
|
|
8
8
|
// ts-prune-ignore-next
|
|
9
9
|
function experimental_serverActionLink() {
|
|
@@ -6,8 +6,7 @@ var client = require('@trpc/client');
|
|
|
6
6
|
var core = require('@trpc/core');
|
|
7
7
|
var observable = require('@trpc/core/observable');
|
|
8
8
|
var cache = require('next/cache');
|
|
9
|
-
var shared = require('../../shared-
|
|
10
|
-
require('@trpc/core/shared');
|
|
9
|
+
var shared = require('../../shared-a452b80f.js');
|
|
11
10
|
|
|
12
11
|
// import "server-only";
|
|
13
12
|
// ts-prune-ignore-next
|
|
@@ -2,8 +2,7 @@ import { TRPCClientError } from '@trpc/client';
|
|
|
2
2
|
import { callProcedure } from '@trpc/core';
|
|
3
3
|
import { observable } from '@trpc/core/observable';
|
|
4
4
|
import { unstable_cache } from 'next/cache';
|
|
5
|
-
import { g as generateCacheTag } from '../../shared-
|
|
6
|
-
import '@trpc/core/shared';
|
|
5
|
+
import { g as generateCacheTag } from '../../shared-2f1ecbeb.mjs';
|
|
7
6
|
|
|
8
7
|
// import "server-only";
|
|
9
8
|
// ts-prune-ignore-next
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var client = require('@trpc/client');
|
|
6
|
-
var shared = require('../../shared-
|
|
7
|
-
require('@trpc/core
|
|
6
|
+
var shared = require('../../shared-a452b80f.js');
|
|
7
|
+
require('@trpc/core');
|
|
8
8
|
|
|
9
9
|
// ts-prune-ignore-next
|
|
10
10
|
function experimental_nextHttpLink(opts) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { httpBatchLink, httpLink } from '@trpc/client';
|
|
2
|
-
import { g as generateCacheTag } from '../../shared-
|
|
3
|
-
import '@trpc/core
|
|
2
|
+
import { g as generateCacheTag } from '../../shared-2f1ecbeb.mjs';
|
|
3
|
+
import '@trpc/core';
|
|
4
4
|
|
|
5
5
|
// ts-prune-ignore-next
|
|
6
6
|
function experimental_nextHttpLink(opts) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/app-dir/server.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,SAAS,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/app-dir/server.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,SAAS,EAMT,YAAY,EACZ,QAAQ,EAGT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,OAAO,EACL,gBAAgB,EAChB,8BAA8B,EAE9B,cAAc,EAEf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAG7D,wBAAgB,uCAAuC,CACrD,OAAO,SAAS,SAAS,EACzB,IAAI,EAAE,8BAA8B,CAAC,OAAO,CAAC,6FA2B9C;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,IAAI,SAAS,gBAAgB,IAAI,CAC7D,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAC5B,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAE/D,wBAAgB,sCAAsC,CACpD,SAAS,SAAS;IAChB,OAAO,EAAE,aAAa,CAAC;CACxB,EAED,CAAC,EAAE,SAAS,EACZ,IAAI,EAAE;IACJ,aAAa,EAAE,MAAM,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACzE;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;;;;GAgEF;AAGD,wBAAsB,+BAA+B,CAAC,GAAG,EAAE,OAAO,qBAiBjE"}
|
package/dist/app-dir/server.js
CHANGED
|
@@ -4,10 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var client = require('@trpc/client');
|
|
6
6
|
var core = require('@trpc/core');
|
|
7
|
-
var shared = require('@trpc/core/shared');
|
|
8
7
|
var cache = require('next/cache');
|
|
9
8
|
var React = require('react');
|
|
10
|
-
var shared
|
|
9
|
+
var shared = require('../shared-a452b80f.js');
|
|
11
10
|
|
|
12
11
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */ function set(obj, path, value) {
|
|
13
12
|
if (typeof path === 'string') {
|
|
@@ -47,7 +46,7 @@ function experimental_createTRPCNextAppDirServer(opts) {
|
|
|
47
46
|
const config = opts.config();
|
|
48
47
|
return client.createTRPCUntypedClient(config);
|
|
49
48
|
});
|
|
50
|
-
return
|
|
49
|
+
return core.createRecursiveProxy((callOpts)=>{
|
|
51
50
|
// lazily initialize client
|
|
52
51
|
const client$1 = getClient();
|
|
53
52
|
const pathCopy = [
|
|
@@ -57,7 +56,7 @@ function experimental_createTRPCNextAppDirServer(opts) {
|
|
|
57
56
|
const action = pathCopy.pop();
|
|
58
57
|
const procedurePath = pathCopy.join('.');
|
|
59
58
|
const procedureType = client.clientCallTypeToProcedureType(action);
|
|
60
|
-
const cacheTag = shared
|
|
59
|
+
const cacheTag = shared.generateCacheTag(procedurePath, callOpts.args[0]);
|
|
61
60
|
if (action === 'revalidate') {
|
|
62
61
|
cache.revalidateTag(cacheTag);
|
|
63
62
|
return;
|
|
@@ -75,7 +74,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
75
74
|
const ctx = undefined;
|
|
76
75
|
try {
|
|
77
76
|
const ctx1 = await createContext();
|
|
78
|
-
if (normalizeFormData && shared
|
|
77
|
+
if (normalizeFormData && shared.isFormData(rawInput)) {
|
|
79
78
|
// Normalizes formdata so we can use `z.object({})` etc on the server
|
|
80
79
|
try {
|
|
81
80
|
rawInput = formDataToObject(rawInput);
|
|
@@ -85,7 +84,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
85
84
|
message: 'Failed to convert FormData to an object'
|
|
86
85
|
});
|
|
87
86
|
}
|
|
88
|
-
} else if (rawInput && !shared
|
|
87
|
+
} else if (rawInput && !shared.isFormData(rawInput)) {
|
|
89
88
|
rawInput = transformer.input.deserialize(rawInput);
|
|
90
89
|
}
|
|
91
90
|
const data = await proc({
|
|
@@ -95,7 +94,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
95
94
|
getRawInput: async ()=>rawInput,
|
|
96
95
|
type: proc._def.type
|
|
97
96
|
});
|
|
98
|
-
const transformedJSON =
|
|
97
|
+
const transformedJSON = core.transformTRPCResponse(config, {
|
|
99
98
|
result: {
|
|
100
99
|
data
|
|
101
100
|
}
|
|
@@ -103,7 +102,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
103
102
|
return transformedJSON;
|
|
104
103
|
} catch (cause) {
|
|
105
104
|
const error = core.getTRPCErrorFromUnknown(cause);
|
|
106
|
-
const shape =
|
|
105
|
+
const shape = core.getErrorShape({
|
|
107
106
|
config,
|
|
108
107
|
ctx,
|
|
109
108
|
error,
|
|
@@ -112,7 +111,7 @@ function experimental_createServerActionHandler(t, opts) {
|
|
|
112
111
|
type: proc._def.type
|
|
113
112
|
});
|
|
114
113
|
// TODO: send the right HTTP header?!
|
|
115
|
-
return
|
|
114
|
+
return core.transformTRPCResponse(t._config, {
|
|
116
115
|
error: shape
|
|
117
116
|
});
|
|
118
117
|
}
|
package/dist/app-dir/server.mjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { createTRPCUntypedClient, clientCallTypeToProcedureType } from '@trpc/client';
|
|
2
|
-
import { TRPCError, getTRPCErrorFromUnknown } from '@trpc/core';
|
|
3
|
-
import { createRecursiveProxy, transformTRPCResponse, getErrorShape } from '@trpc/core/shared';
|
|
2
|
+
import { createRecursiveProxy, TRPCError, transformTRPCResponse, getTRPCErrorFromUnknown, getErrorShape } from '@trpc/core';
|
|
4
3
|
import { revalidateTag } from 'next/cache';
|
|
5
4
|
import { cache } from 'react';
|
|
6
|
-
import { g as generateCacheTag, i as isFormData } from '../shared-
|
|
5
|
+
import { g as generateCacheTag, i as isFormData } from '../shared-2f1ecbeb.mjs';
|
|
7
6
|
|
|
8
7
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */ function set(obj, path, value) {
|
|
9
8
|
if (typeof path === 'string') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/app-dir/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/app-dir/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,QAAQ,EACR,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EAET,MAAM,EACN,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,SAAS,IAAI;KACzD,IAAI,IAAI,MAAM,MAAM,CACnB,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzB,iBAAiB,GAAG,SAAS,CAC9B,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GACjD,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GACnD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC;CAC1E,CAAC;AAEF,wBAAgB,cAAc,CAAC,OAAO,SAAS,SAAS,EACtD,MAAM,EAAE,iBAAiB,CAAC,OAAO,CAAC,+BAOnC;AAED,KAAK,gBAAgB,CAAC,OAAO,SAAS,SAAS,IAAI;IACjD,CAAC,KAAK,SAAS,OAAO,CAAC,OAAO,CAAC,EAAE,EAC/B,EAAE,EAAE,CAAC,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GACjD;SACA,IAAI,IAAI,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;KAC5C,CAAC;IACF,CAAC,KAAK,SAAS,OAAO,CAAC,OAAO,CAAC,EAC7B,EAAE,EAAE,CAAC,CAAC,EAAE,kBAAkB,CAAC,OAAO,CAAC,KAAK,KAAK,GAC5C,OAAO,CAAC,KAAK,CAAC,CAAC;CACnB,CAAC;AACF,KAAK,2BAA2B,CAAC,OAAO,SAAS,SAAS,IAAI;IAC5D,GAAG,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;CAChC,CAAC;AACF,MAAM,MAAM,uBAAuB,CAAC,OAAO,SAAS,SAAS,IAC3D,qBAAqB,CACnB,2BAA2B,CAAC,OAAO,CAAC,EACpC,kBAAkB,CAAC,OAAO,CAAC,CAC5B,CAAC;AAEJ;;GAEG;AACH,MAAM,WAAW,8BAA8B,CAAC,OAAO,SAAS,SAAS;IACvE,MAAM,EAAE,MAAM,uBAAuB,CAAC,OAAO,CAAC,CAAC;CAChD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,UAIjE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAM5D;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,UAAU,EAAE,GAAG,CAAC;CACjB;AAGD;;GAEG;AACH,MAAM,MAAM,cAAc,CACxB,OAAO,SAAS,aAAa,EAC7B,KAAK,SAAS,YAAY,IACxB;IACF,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,YAAY,CAAC,CAAC;CAC7C,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 30.
|
|
2
|
+
"bundleSize": 22146,
|
|
3
|
+
"bundleOrigSize": 31688,
|
|
4
|
+
"bundleReduction": 30.11,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/withTRPC.tsx",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"/src/createTRPCNext.tsx",
|
|
16
16
|
"/src/index.ts"
|
|
17
17
|
],
|
|
18
|
-
"percent": 36.
|
|
18
|
+
"percent": 36.16,
|
|
19
19
|
"reduction": 13.64
|
|
20
20
|
},
|
|
21
21
|
{
|
|
22
22
|
"id": "/src/app-dir/server.ts",
|
|
23
|
-
"size":
|
|
24
|
-
"origSize":
|
|
23
|
+
"size": 3691,
|
|
24
|
+
"origSize": 4799,
|
|
25
25
|
"renderedExports": [
|
|
26
26
|
"experimental_createTRPCNextAppDirServer",
|
|
27
27
|
"experimental_createServerActionHandler",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
],
|
|
30
30
|
"removedExports": [],
|
|
31
31
|
"dependents": [],
|
|
32
|
-
"percent": 16.
|
|
33
|
-
"reduction": 23.
|
|
32
|
+
"percent": 16.67,
|
|
33
|
+
"reduction": 23.09
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"id": "/src/app-dir/create-action-hook.tsx",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"dependents": [
|
|
45
45
|
"/src/app-dir/client.ts"
|
|
46
46
|
],
|
|
47
|
-
"percent": 14.
|
|
47
|
+
"percent": 14.95,
|
|
48
48
|
"reduction": 41.37
|
|
49
49
|
},
|
|
50
50
|
{
|
|
@@ -56,20 +56,20 @@
|
|
|
56
56
|
],
|
|
57
57
|
"removedExports": [],
|
|
58
58
|
"dependents": [],
|
|
59
|
-
"percent": 11.
|
|
59
|
+
"percent": 11.23,
|
|
60
60
|
"reduction": 7.82
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"id": "/src/app-dir/client.ts",
|
|
64
|
-
"size":
|
|
65
|
-
"origSize":
|
|
64
|
+
"size": 1260,
|
|
65
|
+
"origSize": 1761,
|
|
66
66
|
"renderedExports": [
|
|
67
67
|
"experimental_createTRPCNextAppDirClient"
|
|
68
68
|
],
|
|
69
69
|
"removedExports": [],
|
|
70
70
|
"dependents": [],
|
|
71
|
-
"percent": 5.
|
|
72
|
-
"reduction":
|
|
71
|
+
"percent": 5.69,
|
|
72
|
+
"reduction": 28.45
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"id": "/src/app-dir/links/nextHttp.ts",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
"id": "/src/createTRPCNext.tsx",
|
|
88
|
-
"size":
|
|
89
|
-
"origSize":
|
|
88
|
+
"size": 1045,
|
|
89
|
+
"origSize": 2499,
|
|
90
90
|
"renderedExports": [
|
|
91
91
|
"createTRPCNext"
|
|
92
92
|
],
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
"dependents": [
|
|
95
95
|
"/src/index.ts"
|
|
96
96
|
],
|
|
97
|
-
"percent": 4.
|
|
98
|
-
"reduction": 58.
|
|
97
|
+
"percent": 4.72,
|
|
98
|
+
"reduction": 58.18
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
"id": "/src/app-dir/formDataToObject.ts",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
{
|
|
115
115
|
"id": "/src/app-dir/shared.ts",
|
|
116
116
|
"size": 335,
|
|
117
|
-
"origSize":
|
|
117
|
+
"origSize": 2411,
|
|
118
118
|
"renderedExports": [
|
|
119
119
|
"generateCacheTag",
|
|
120
120
|
"isFormData"
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
"/src/app-dir/links/nextHttp.ts"
|
|
130
130
|
],
|
|
131
131
|
"percent": 1.51,
|
|
132
|
-
"reduction": 86.
|
|
132
|
+
"reduction": 86.11
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"id": "/src/index.ts",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"createTRPCNext.d.ts","sourceRoot":"","sources":["../src/createTRPCNext.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAmB,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAGL,gBAAgB,EAEhB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEhF;;GAEG;AACH,MAAM,WAAW,kBAAkB,CACjC,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe;IAEnC;;;;OAIG;IACH,UAAU,IAAI,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACrD;;OAEG;IACH,QAAQ,IAAI,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IACnD,QAAQ,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;IAC5D,UAAU,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IACpC,kBAAkB,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,CACxB,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,EACnC,MAAM,IACJ,qBAAqB,CACvB,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,EACxC,wBAAwB,CACtB,OAAO,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,EAC1B,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,EACzB,MAAM,CACP,CACF,CAAC;AAEF,wBAAgB,cAAc,CAC5B,OAAO,SAAS,SAAS,EACzB,WAAW,SAAS,eAAe,GAAG,eAAe,EACrD,MAAM,GAAG,IAAI,EAEb,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAC,OAAO,CAAC,GAChE,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,CAAC,CA+B9C"}
|
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ var reactQuery = require('@tanstack/react-query');
|
|
|
6
6
|
var client = require('@trpc/client');
|
|
7
7
|
var shared = require('@trpc/react-query/shared');
|
|
8
8
|
var React = require('react');
|
|
9
|
-
var
|
|
9
|
+
var core = require('@trpc/core');
|
|
10
10
|
|
|
11
11
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
12
|
|
|
@@ -205,7 +205,7 @@ function createTRPCNext(opts) {
|
|
|
205
205
|
const hooks = shared.createRootHooks(opts);
|
|
206
206
|
// TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
207
207
|
const _withTRPC = withTRPC(opts);
|
|
208
|
-
return
|
|
208
|
+
return core.createFlatProxy((key)=>{
|
|
209
209
|
if (key === 'useContext' || key === 'useUtils') {
|
|
210
210
|
return ()=>{
|
|
211
211
|
const context = hooks.useUtils();
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { dehydrate, QueryClientProvider, HydrationBoundary } from '@tanstack/rea
|
|
|
2
2
|
import { createTRPCUntypedClient } from '@trpc/client';
|
|
3
3
|
import { createRootHooks, getQueryClient, createReactQueryUtils, createReactDecoration } from '@trpc/react-query/shared';
|
|
4
4
|
import React, { createElement, useState, useMemo } from 'react';
|
|
5
|
-
import { createFlatProxy } from '@trpc/core
|
|
5
|
+
import { createFlatProxy } from '@trpc/core';
|
|
6
6
|
|
|
7
7
|
function transformQueryOrMutationCacheErrors(result) {
|
|
8
8
|
const error = result.state.error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/next",
|
|
3
|
-
"version": "11.0.0-alpha-tmp.
|
|
3
|
+
"version": "11.0.0-alpha-tmp.213+24a3b8da5",
|
|
4
4
|
"description": "The tRPC Next.js library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -67,20 +67,21 @@
|
|
|
67
67
|
],
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@tanstack/react-query": "^5.0.0",
|
|
70
|
-
"@trpc/client": "11.0.0-alpha-tmp.
|
|
71
|
-
"@trpc/
|
|
72
|
-
"@trpc/
|
|
73
|
-
"@trpc/server": "11.0.0-alpha-tmp.198+d54dfc68a",
|
|
70
|
+
"@trpc/client": "11.0.0-alpha-tmp.213+24a3b8da5",
|
|
71
|
+
"@trpc/react-query": "11.0.0-alpha-tmp.213+24a3b8da5",
|
|
72
|
+
"@trpc/server": "11.0.0-alpha-tmp.213+24a3b8da5",
|
|
74
73
|
"next": "*",
|
|
75
74
|
"react": ">=16.8.0",
|
|
76
75
|
"react-dom": ">=16.8.0"
|
|
77
76
|
},
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@trpc/core": "11.0.0-alpha-tmp.213+24a3b8da5"
|
|
79
|
+
},
|
|
78
80
|
"devDependencies": {
|
|
79
81
|
"@tanstack/react-query": "^5.0.0",
|
|
80
|
-
"@trpc/client": "11.0.0-alpha-tmp.
|
|
81
|
-
"@trpc/
|
|
82
|
-
"@trpc/
|
|
83
|
-
"@trpc/server": "11.0.0-alpha-tmp.198+d54dfc68a",
|
|
82
|
+
"@trpc/client": "11.0.0-alpha-tmp.213+24a3b8da5",
|
|
83
|
+
"@trpc/react-query": "11.0.0-alpha-tmp.213+24a3b8da5",
|
|
84
|
+
"@trpc/server": "11.0.0-alpha-tmp.213+24a3b8da5",
|
|
84
85
|
"@types/express": "^4.17.17",
|
|
85
86
|
"@types/node": "^20.10.0",
|
|
86
87
|
"@types/react": "^18.2.33",
|
|
@@ -100,5 +101,5 @@
|
|
|
100
101
|
"funding": [
|
|
101
102
|
"https://trpc.io/sponsor"
|
|
102
103
|
],
|
|
103
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "24a3b8da51c73373bffe5f6888a23af2642c6d3c"
|
|
104
105
|
}
|
package/src/app-dir/client.ts
CHANGED
|
@@ -3,8 +3,7 @@ import {
|
|
|
3
3
|
CreateTRPCClient,
|
|
4
4
|
createTRPCUntypedClient,
|
|
5
5
|
} from '@trpc/client';
|
|
6
|
-
import { AnyRouter } from '@trpc/core';
|
|
7
|
-
import { createRecursiveProxy } from '@trpc/core/shared';
|
|
6
|
+
import { AnyRouter, createRecursiveProxy } from '@trpc/core';
|
|
8
7
|
import { CreateTRPCNextAppRouterOptions } from './shared';
|
|
9
8
|
|
|
10
9
|
export {
|
package/src/app-dir/server.ts
CHANGED
|
@@ -8,18 +8,16 @@ import {
|
|
|
8
8
|
AnyRootConfig,
|
|
9
9
|
AnyRouter,
|
|
10
10
|
CombinedDataTransformer,
|
|
11
|
+
createRecursiveProxy,
|
|
12
|
+
getErrorShape,
|
|
11
13
|
getTRPCErrorFromUnknown,
|
|
12
14
|
inferProcedureInput,
|
|
13
15
|
MaybePromise,
|
|
14
16
|
Simplify,
|
|
17
|
+
transformTRPCResponse,
|
|
15
18
|
TRPCError,
|
|
16
19
|
} from '@trpc/core';
|
|
17
20
|
import { TRPCResponse } from '@trpc/core/rpc';
|
|
18
|
-
import {
|
|
19
|
-
createRecursiveProxy,
|
|
20
|
-
getErrorShape,
|
|
21
|
-
transformTRPCResponse,
|
|
22
|
-
} from '@trpc/core/shared';
|
|
23
21
|
import { revalidateTag } from 'next/cache';
|
|
24
22
|
import { cache } from 'react';
|
|
25
23
|
import { formDataToObject } from './formDataToObject';
|
package/src/app-dir/shared.ts
CHANGED
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
AnyQueryProcedure,
|
|
9
9
|
AnyRootConfig,
|
|
10
10
|
AnyRouter,
|
|
11
|
+
createRecursiveProxy,
|
|
11
12
|
Filter,
|
|
12
13
|
inferHandlerInput,
|
|
13
14
|
ProtectedIntersection,
|
|
14
15
|
} from '@trpc/core';
|
|
15
|
-
import { createRecursiveProxy } from '@trpc/core/shared';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
package/src/createTRPCNext.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/* istanbul ignore file -- @preserve */
|
|
2
2
|
// We're testing this through E2E-testing
|
|
3
|
-
import { AnyRouter, ProtectedIntersection } from '@trpc/core';
|
|
4
|
-
import { createFlatProxy } from '@trpc/core/shared';
|
|
3
|
+
import { AnyRouter, createFlatProxy, ProtectedIntersection } from '@trpc/core';
|
|
5
4
|
import {
|
|
6
5
|
createReactDecoration,
|
|
7
6
|
createReactQueryUtils,
|