@trpc/server 11.0.0-rc.797 → 11.0.0-rc.798
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/bundle-analysis.json +22 -22
- package/dist/unstable-core-do-not-import/stream/utils/disposable.d.ts.map +1 -1
- package/dist/unstable-core-do-not-import/stream/utils/disposable.js +10 -8
- package/dist/unstable-core-do-not-import/stream/utils/disposable.mjs +10 -8
- package/package.json +2 -2
- package/src/unstable-core-do-not-import/stream/utils/disposable.ts +14 -12
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundleSize":
|
|
3
|
-
"bundleOrigSize":
|
|
4
|
-
"bundleReduction": 13.
|
|
2
|
+
"bundleSize": 198987,
|
|
3
|
+
"bundleOrigSize": 230694,
|
|
4
|
+
"bundleReduction": 13.74,
|
|
5
5
|
"modules": [
|
|
6
6
|
{
|
|
7
7
|
"id": "/src/unstable-core-do-not-import/http/resolveResponse.ts",
|
|
@@ -489,8 +489,8 @@
|
|
|
489
489
|
},
|
|
490
490
|
{
|
|
491
491
|
"id": "/src/unstable-core-do-not-import/stream/utils/disposable.ts",
|
|
492
|
-
"size":
|
|
493
|
-
"origSize":
|
|
492
|
+
"size": 1755,
|
|
493
|
+
"origSize": 1836,
|
|
494
494
|
"renderedExports": [
|
|
495
495
|
"makeResource",
|
|
496
496
|
"makeAsyncResource"
|
|
@@ -505,7 +505,7 @@
|
|
|
505
505
|
"/src/unstable-core-do-not-import/stream/utils/timerResource.ts"
|
|
506
506
|
],
|
|
507
507
|
"percent": 0.88,
|
|
508
|
-
"reduction":
|
|
508
|
+
"reduction": 4.41
|
|
509
509
|
},
|
|
510
510
|
{
|
|
511
511
|
"id": "/src/unstable-core-do-not-import/rpc/parseTRPCMessage.ts",
|
|
@@ -882,9 +882,9 @@
|
|
|
882
882
|
"reduction": 100
|
|
883
883
|
},
|
|
884
884
|
{
|
|
885
|
-
"id": "/src/
|
|
885
|
+
"id": "/src/shared.ts",
|
|
886
886
|
"size": 0,
|
|
887
|
-
"origSize":
|
|
887
|
+
"origSize": 653,
|
|
888
888
|
"renderedExports": [],
|
|
889
889
|
"removedExports": [],
|
|
890
890
|
"dependents": [],
|
|
@@ -892,9 +892,9 @@
|
|
|
892
892
|
"reduction": 100
|
|
893
893
|
},
|
|
894
894
|
{
|
|
895
|
-
"id": "/src/
|
|
895
|
+
"id": "/src/rpc.ts",
|
|
896
896
|
"size": 0,
|
|
897
|
-
"origSize":
|
|
897
|
+
"origSize": 36,
|
|
898
898
|
"renderedExports": [],
|
|
899
899
|
"removedExports": [],
|
|
900
900
|
"dependents": [],
|
|
@@ -909,9 +909,9 @@
|
|
|
909
909
|
"removedExports": [],
|
|
910
910
|
"dependents": [
|
|
911
911
|
"/src/adapters/express.ts",
|
|
912
|
-
"/src/adapters/next.ts",
|
|
913
912
|
"/src/adapters/ws.ts",
|
|
914
913
|
"/src/adapters/standalone.ts",
|
|
914
|
+
"/src/adapters/next.ts",
|
|
915
915
|
"/src/adapters/node-http/nodeHTTPRequestHandler.ts",
|
|
916
916
|
"/src/adapters/next-app-dir/nextAppDirCaller.ts",
|
|
917
917
|
"/src/adapters/node-http/writeResponse.ts"
|
|
@@ -941,16 +941,6 @@
|
|
|
941
941
|
"percent": 0,
|
|
942
942
|
"reduction": 100
|
|
943
943
|
},
|
|
944
|
-
{
|
|
945
|
-
"id": "/src/adapters/fastify/index.ts",
|
|
946
|
-
"size": 0,
|
|
947
|
-
"origSize": 78,
|
|
948
|
-
"renderedExports": [],
|
|
949
|
-
"removedExports": [],
|
|
950
|
-
"dependents": [],
|
|
951
|
-
"percent": 0,
|
|
952
|
-
"reduction": 100
|
|
953
|
-
},
|
|
954
944
|
{
|
|
955
945
|
"id": "/src/adapters/fetch/index.ts",
|
|
956
946
|
"size": 0,
|
|
@@ -969,13 +959,23 @@
|
|
|
969
959
|
"removedExports": [],
|
|
970
960
|
"dependents": [
|
|
971
961
|
"/src/adapters/express.ts",
|
|
972
|
-
"/src/adapters/next.ts",
|
|
973
962
|
"/src/adapters/ws.ts",
|
|
974
963
|
"/src/adapters/standalone.ts",
|
|
964
|
+
"/src/adapters/next.ts",
|
|
975
965
|
"/src/adapters/fastify/fastifyRequestHandler.ts"
|
|
976
966
|
],
|
|
977
967
|
"percent": 0,
|
|
978
968
|
"reduction": 100
|
|
969
|
+
},
|
|
970
|
+
{
|
|
971
|
+
"id": "/src/adapters/fastify/index.ts",
|
|
972
|
+
"size": 0,
|
|
973
|
+
"origSize": 78,
|
|
974
|
+
"renderedExports": [],
|
|
975
|
+
"removedExports": [],
|
|
976
|
+
"dependents": [],
|
|
977
|
+
"percent": 0,
|
|
978
|
+
"reduction": 100
|
|
979
979
|
}
|
|
980
980
|
],
|
|
981
981
|
"moduleCount": 63
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../../../../src/unstable-core-do-not-import/stream/utils/disposable.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,CAAC,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"disposable.d.ts","sourceRoot":"","sources":["../../../../src/unstable-core-do-not-import/stream/utils/disposable.ts"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,IAAI,GAAG,CAAC,GAAG,UAAU,CAa7E;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAC3B,CAAC,GAAG,eAAe,CAarB"}
|
|
@@ -16,11 +16,12 @@ _Symbol1;
|
|
|
16
16
|
*/ function makeResource(thing, dispose) {
|
|
17
17
|
const it = thing;
|
|
18
18
|
// eslint-disable-next-line no-restricted-syntax
|
|
19
|
-
|
|
20
|
-
throw new Error('Symbol.dispose already exists');
|
|
21
|
-
}
|
|
19
|
+
const existing = it[Symbol.dispose];
|
|
22
20
|
// eslint-disable-next-line no-restricted-syntax
|
|
23
|
-
it[Symbol.dispose] =
|
|
21
|
+
it[Symbol.dispose] = ()=>{
|
|
22
|
+
dispose();
|
|
23
|
+
existing?.();
|
|
24
|
+
};
|
|
24
25
|
return it;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
@@ -32,11 +33,12 @@ _Symbol1;
|
|
|
32
33
|
*/ function makeAsyncResource(thing, dispose) {
|
|
33
34
|
const it = thing;
|
|
34
35
|
// eslint-disable-next-line no-restricted-syntax
|
|
35
|
-
|
|
36
|
-
throw new Error('Symbol.asyncDispose already exists');
|
|
37
|
-
}
|
|
36
|
+
const existing = it[Symbol.asyncDispose];
|
|
38
37
|
// eslint-disable-next-line no-restricted-syntax
|
|
39
|
-
it[Symbol.asyncDispose] =
|
|
38
|
+
it[Symbol.asyncDispose] = async ()=>{
|
|
39
|
+
await dispose();
|
|
40
|
+
await existing?.();
|
|
41
|
+
};
|
|
40
42
|
return it;
|
|
41
43
|
}
|
|
42
44
|
|
|
@@ -14,11 +14,12 @@ _Symbol1;
|
|
|
14
14
|
*/ function makeResource(thing, dispose) {
|
|
15
15
|
const it = thing;
|
|
16
16
|
// eslint-disable-next-line no-restricted-syntax
|
|
17
|
-
|
|
18
|
-
throw new Error('Symbol.dispose already exists');
|
|
19
|
-
}
|
|
17
|
+
const existing = it[Symbol.dispose];
|
|
20
18
|
// eslint-disable-next-line no-restricted-syntax
|
|
21
|
-
it[Symbol.dispose] =
|
|
19
|
+
it[Symbol.dispose] = ()=>{
|
|
20
|
+
dispose();
|
|
21
|
+
existing?.();
|
|
22
|
+
};
|
|
22
23
|
return it;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
@@ -30,11 +31,12 @@ _Symbol1;
|
|
|
30
31
|
*/ function makeAsyncResource(thing, dispose) {
|
|
31
32
|
const it = thing;
|
|
32
33
|
// eslint-disable-next-line no-restricted-syntax
|
|
33
|
-
|
|
34
|
-
throw new Error('Symbol.asyncDispose already exists');
|
|
35
|
-
}
|
|
34
|
+
const existing = it[Symbol.asyncDispose];
|
|
36
35
|
// eslint-disable-next-line no-restricted-syntax
|
|
37
|
-
it[Symbol.asyncDispose] =
|
|
36
|
+
it[Symbol.asyncDispose] = async ()=>{
|
|
37
|
+
await dispose();
|
|
38
|
+
await existing?.();
|
|
39
|
+
};
|
|
38
40
|
return it;
|
|
39
41
|
}
|
|
40
42
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trpc/server",
|
|
3
|
-
"version": "11.0.0-rc.
|
|
3
|
+
"version": "11.0.0-rc.798+5cf2f3e17",
|
|
4
4
|
"description": "The tRPC server library",
|
|
5
5
|
"author": "KATT",
|
|
6
6
|
"license": "MIT",
|
|
@@ -152,5 +152,5 @@
|
|
|
152
152
|
"peerDependencies": {
|
|
153
153
|
"typescript": ">=5.7.2"
|
|
154
154
|
},
|
|
155
|
-
"gitHead": "
|
|
155
|
+
"gitHead": "5cf2f3e1780f8bfaf43ba564c91a8b428af7cf2d"
|
|
156
156
|
}
|
|
@@ -14,17 +14,18 @@ Symbol.asyncDispose ??= Symbol();
|
|
|
14
14
|
* @returns The original value with Symbol.dispose method added
|
|
15
15
|
*/
|
|
16
16
|
export function makeResource<T>(thing: T, dispose: () => void): T & Disposable {
|
|
17
|
-
const it = thing as T & Disposable
|
|
17
|
+
const it = thing as T & Partial<Disposable>;
|
|
18
18
|
|
|
19
19
|
// eslint-disable-next-line no-restricted-syntax
|
|
20
|
-
|
|
21
|
-
throw new Error('Symbol.dispose already exists');
|
|
22
|
-
}
|
|
20
|
+
const existing = it[Symbol.dispose];
|
|
23
21
|
|
|
24
22
|
// eslint-disable-next-line no-restricted-syntax
|
|
25
|
-
it[Symbol.dispose] =
|
|
23
|
+
it[Symbol.dispose] = () => {
|
|
24
|
+
dispose();
|
|
25
|
+
existing?.();
|
|
26
|
+
};
|
|
26
27
|
|
|
27
|
-
return it;
|
|
28
|
+
return it as T & Disposable;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -38,15 +39,16 @@ export function makeAsyncResource<T>(
|
|
|
38
39
|
thing: T,
|
|
39
40
|
dispose: () => Promise<void>,
|
|
40
41
|
): T & AsyncDisposable {
|
|
41
|
-
const it = thing as T & AsyncDisposable
|
|
42
|
+
const it = thing as T & Partial<AsyncDisposable>;
|
|
42
43
|
|
|
43
44
|
// eslint-disable-next-line no-restricted-syntax
|
|
44
|
-
|
|
45
|
-
throw new Error('Symbol.asyncDispose already exists');
|
|
46
|
-
}
|
|
45
|
+
const existing = it[Symbol.asyncDispose];
|
|
47
46
|
|
|
48
47
|
// eslint-disable-next-line no-restricted-syntax
|
|
49
|
-
it[Symbol.asyncDispose] =
|
|
48
|
+
it[Symbol.asyncDispose] = async () => {
|
|
49
|
+
await dispose();
|
|
50
|
+
await existing?.();
|
|
51
|
+
};
|
|
50
52
|
|
|
51
|
-
return it;
|
|
53
|
+
return it as T & AsyncDisposable;
|
|
52
54
|
}
|