@sanity/client 6.3.0 → 6.4.1-rsc.0
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/index.cjs +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -2
- package/dist/index.js.map +1 -1
- package/package.json +11 -9
- package/src/http/nodeMiddleware.ts +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/client",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.1-rsc.0",
|
|
4
4
|
"description": "Client for retrieving, creating and patching data from Sanity.io",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"require": "./dist/index.browser.cjs",
|
|
33
33
|
"import": "./dist/index.browser.js"
|
|
34
34
|
},
|
|
35
|
+
"react-server": "./dist/index.browser.js",
|
|
35
36
|
"deno": "./dist/index.browser.js",
|
|
36
37
|
"edge": "./dist/index.browser.js",
|
|
37
38
|
"edge-light": "./dist/index.browser.js",
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
"test:deno:update_import_map": "deno run --allow-read --allow-write runtimes/deno/update_import_map.ts",
|
|
79
80
|
"posttest:deno:update_import_map": "npx prettier --write runtimes/deno/import_map.json",
|
|
80
81
|
"test:edge-runtime": "npm test -- --config vitest.edge.config.ts",
|
|
82
|
+
"test:react-server": "npm test -- --config vitest.react-server.config.ts",
|
|
81
83
|
"test:node-runtimes": "node --test runtimes/node | npx faucet"
|
|
82
84
|
},
|
|
83
85
|
"browserslist": [
|
|
@@ -92,7 +94,7 @@
|
|
|
92
94
|
},
|
|
93
95
|
"dependencies": {
|
|
94
96
|
"@sanity/eventsource": "^5.0.0",
|
|
95
|
-
"get-it": "
|
|
97
|
+
"get-it": "9.0.0-rsc.2",
|
|
96
98
|
"rxjs": "^7.0.0"
|
|
97
99
|
},
|
|
98
100
|
"devDependencies": {
|
|
@@ -103,11 +105,11 @@
|
|
|
103
105
|
"@sanity/pkg-utils": "^2.3.9",
|
|
104
106
|
"@sanity/semantic-release-preset": "^4.1.2",
|
|
105
107
|
"@types/node": "^20.4.5",
|
|
106
|
-
"@typescript-eslint/eslint-plugin": "^6.2.
|
|
107
|
-
"@typescript-eslint/parser": "^6.2.
|
|
108
|
-
"@vitest/coverage-v8": "^0.
|
|
109
|
-
"eslint": "^8.
|
|
110
|
-
"eslint-config-prettier": "^8.
|
|
108
|
+
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
|
109
|
+
"@typescript-eslint/parser": "^6.2.1",
|
|
110
|
+
"@vitest/coverage-v8": "^0.34.1",
|
|
111
|
+
"eslint": "^8.46.0",
|
|
112
|
+
"eslint-config-prettier": "^8.9.0",
|
|
111
113
|
"eslint-plugin-prettier": "^5.0.0",
|
|
112
114
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
|
113
115
|
"faucet": "^0.0.4",
|
|
@@ -117,11 +119,11 @@
|
|
|
117
119
|
"prettier": "^3.0.0",
|
|
118
120
|
"prettier-plugin-packagejson": "^2.4.5",
|
|
119
121
|
"rimraf": "^5.0.1",
|
|
120
|
-
"rollup": "^3.
|
|
122
|
+
"rollup": "^3.27.0",
|
|
121
123
|
"sse-channel": "^4.0.0",
|
|
122
124
|
"terser": "^5.19.2",
|
|
123
125
|
"typescript": "^5.1.6",
|
|
124
|
-
"vitest": "^0.
|
|
126
|
+
"vitest": "^0.34.1",
|
|
125
127
|
"vitest-github-actions-reporter": "^0.10.0"
|
|
126
128
|
},
|
|
127
129
|
"engines": {
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
-
import {debug, headers} from 'get-it/middleware'
|
|
1
|
+
import {agent, debug, headers} from 'get-it/middleware'
|
|
2
2
|
|
|
3
3
|
import {name, version} from '../../package.json'
|
|
4
4
|
|
|
5
5
|
const middleware = [
|
|
6
6
|
debug({verbose: true, namespace: 'sanity:client'}),
|
|
7
7
|
headers({'User-Agent': `${name} ${version}`}),
|
|
8
|
+
|
|
9
|
+
// Enable keep-alive, and in addition limit the number of sockets that can be opened.
|
|
10
|
+
// This avoids opening too many connections to the server if someone tries to execute
|
|
11
|
+
// a bunch of requests in parallel. It's recommended to have a concurrency limit
|
|
12
|
+
// at a "higher limit" (i.e. you shouldn't actually execute hundreds of requests in parallel),
|
|
13
|
+
// and this is mainly to minimize the impact for the network and server.
|
|
14
|
+
//
|
|
15
|
+
// We're currently matching the same defaults as browsers:
|
|
16
|
+
// https://stackoverflow.com/questions/26003756/is-there-a-limit-practical-or-otherwise-to-the-number-of-web-sockets-a-page-op
|
|
17
|
+
agent({
|
|
18
|
+
keepAlive: true,
|
|
19
|
+
maxSockets: 30,
|
|
20
|
+
maxTotalSockets: 256,
|
|
21
|
+
}),
|
|
8
22
|
]
|
|
9
23
|
|
|
10
24
|
export default middleware
|