@akinon/next 1.95.0-snapshot-ZERO-3586-20250901140025 → 1.95.0-snapshot-ZERO-3586-20250901142729
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/CHANGELOG.md +1 -1
- package/lib/cache-handler.mjs +6 -38
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
package/lib/cache-handler.mjs
CHANGED
|
@@ -9,23 +9,15 @@ let zstd;
|
|
|
9
9
|
try {
|
|
10
10
|
const { compress, decompress } = await import('@mongodb-js/zstd');
|
|
11
11
|
zstd = { compress, decompress, type: 'native' };
|
|
12
|
-
console.
|
|
12
|
+
console.warn(
|
|
13
13
|
'[Cache Handler] ✅ Native @mongodb-js/zstd loaded successfully'
|
|
14
14
|
);
|
|
15
15
|
} catch (error) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} catch (wasmError) {
|
|
22
|
-
console.warn(
|
|
23
|
-
'[Cache Handler] ❌ Both native and WASM zstd failed to load:',
|
|
24
|
-
error.message,
|
|
25
|
-
wasmError.message
|
|
26
|
-
);
|
|
27
|
-
zstd = false;
|
|
28
|
-
}
|
|
16
|
+
console.warn(
|
|
17
|
+
'[Cache Handler] ❌ @mongodb-js/zstd failed to load, fallback to uncompressed:',
|
|
18
|
+
error.message
|
|
19
|
+
);
|
|
20
|
+
zstd = false;
|
|
29
21
|
}
|
|
30
22
|
})();
|
|
31
23
|
|
|
@@ -62,14 +54,8 @@ const compressValue = async (value) => {
|
|
|
62
54
|
zstdLib.compress.constructor.name === 'AsyncFunction'
|
|
63
55
|
) {
|
|
64
56
|
compressed = await zstdLib.compress(inputBuffer, 3);
|
|
65
|
-
console.log(
|
|
66
|
-
`[Cache Handler] 🚀 Compressed with native zstd: ${inputBuffer.length} → ${compressed.length} bytes`
|
|
67
|
-
);
|
|
68
57
|
} else {
|
|
69
58
|
compressed = zstdLib.compress(inputBuffer, 3);
|
|
70
|
-
console.log(
|
|
71
|
-
`[Cache Handler] 🌐 Compressed with WASM zstd: ${inputBuffer.length} → ${compressed.length} bytes`
|
|
72
|
-
);
|
|
73
59
|
}
|
|
74
60
|
} else {
|
|
75
61
|
return {
|
|
@@ -156,14 +142,8 @@ const compressValue = async (value) => {
|
|
|
156
142
|
zstdLib.compress.constructor.name === 'AsyncFunction'
|
|
157
143
|
) {
|
|
158
144
|
compressed = await zstdLib.compress(inputBuffer, 3);
|
|
159
|
-
console.log(
|
|
160
|
-
`[Cache Handler] 🚀 Compressed with native zstd: ${inputBuffer.length} → ${compressed.length} bytes`
|
|
161
|
-
);
|
|
162
145
|
} else {
|
|
163
146
|
compressed = zstdLib.compress(inputBuffer, 3);
|
|
164
|
-
console.log(
|
|
165
|
-
`[Cache Handler] 🌐 Compressed with WASM zstd: ${inputBuffer.length} → ${compressed.length} bytes`
|
|
166
|
-
);
|
|
167
147
|
}
|
|
168
148
|
} else {
|
|
169
149
|
if (
|
|
@@ -235,16 +215,10 @@ const decompressValue = async (compressedData) => {
|
|
|
235
215
|
compressedBuffer
|
|
236
216
|
);
|
|
237
217
|
decompressed = decompressedBuffer.toString('utf8');
|
|
238
|
-
console.log(
|
|
239
|
-
`[Cache Handler] 🚀 Decompressed with native zstd: ${compressedBuffer.length} → ${decompressedBuffer.length} bytes`
|
|
240
|
-
);
|
|
241
218
|
} else {
|
|
242
219
|
decompressed = zstdLib
|
|
243
220
|
.decompress(compressedBuffer)
|
|
244
221
|
.toString('utf8');
|
|
245
|
-
console.log(
|
|
246
|
-
`[Cache Handler] 🌐 Decompressed with WASM zstd: ${compressedBuffer.length} → ${decompressed.length} bytes`
|
|
247
|
-
);
|
|
248
222
|
}
|
|
249
223
|
} else {
|
|
250
224
|
throw new Error('zstd not available for decompression');
|
|
@@ -276,16 +250,10 @@ const decompressValue = async (compressedData) => {
|
|
|
276
250
|
compressedBuffer
|
|
277
251
|
);
|
|
278
252
|
decompressed = decompressedBuffer.toString('utf8');
|
|
279
|
-
console.log(
|
|
280
|
-
`[Cache Handler] 🚀 Decompressed with native zstd: ${compressedBuffer.length} → ${decompressedBuffer.length} bytes`
|
|
281
|
-
);
|
|
282
253
|
} else {
|
|
283
254
|
decompressed = zstdLib
|
|
284
255
|
.decompress(compressedBuffer)
|
|
285
256
|
.toString('utf8');
|
|
286
|
-
console.log(
|
|
287
|
-
`[Cache Handler] 🌐 Decompressed with WASM zstd: ${compressedBuffer.length} → ${decompressed.length} bytes`
|
|
288
|
-
);
|
|
289
257
|
}
|
|
290
258
|
} else {
|
|
291
259
|
throw new Error('zstd not available for decompression');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akinon/next",
|
|
3
3
|
"description": "Core package for Project Zero Next",
|
|
4
|
-
"version": "1.95.0-snapshot-ZERO-3586-
|
|
4
|
+
"version": "1.95.0-snapshot-ZERO-3586-20250901142729",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"test": "jest"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@bokuweb/zstd-wasm": "^0.0.27",
|
|
21
20
|
"@mongodb-js/zstd": "^2.0.1",
|
|
22
21
|
"@neshca/cache-handler": "1.9.0",
|
|
23
22
|
"@opentelemetry/exporter-trace-otlp-http": "0.46.0",
|
|
@@ -36,7 +35,7 @@
|
|
|
36
35
|
"set-cookie-parser": "2.6.0"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@akinon/eslint-plugin-projectzero": "1.95.0-snapshot-ZERO-3586-
|
|
38
|
+
"@akinon/eslint-plugin-projectzero": "1.95.0-snapshot-ZERO-3586-20250901142729",
|
|
40
39
|
"@babel/core": "7.26.10",
|
|
41
40
|
"@babel/preset-env": "7.26.9",
|
|
42
41
|
"@babel/preset-typescript": "7.27.0",
|