@weaverse/hydrogen 2.7.1-pre.1 → 2.7.1
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.js +3 -32
- package/dist/index.mjs +3 -32
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -257,7 +257,7 @@ var package_default = {
|
|
|
257
257
|
name: "@weaverse/hydrogen",
|
|
258
258
|
author: "Weaverse Team",
|
|
259
259
|
description: "Components, hooks, and utilities for building Shopify Hydrogen websites with Weaverse",
|
|
260
|
-
version: "2.7.1
|
|
260
|
+
version: "2.7.1",
|
|
261
261
|
license: "MIT",
|
|
262
262
|
main: "dist/index.js",
|
|
263
263
|
typings: "dist/index.d.ts",
|
|
@@ -295,7 +295,7 @@ var package_default = {
|
|
|
295
295
|
singleQuote: true
|
|
296
296
|
},
|
|
297
297
|
dependencies: {
|
|
298
|
-
"@weaverse/react": "2.
|
|
298
|
+
"@weaverse/react": "2.7.1",
|
|
299
299
|
"react-error-boundary": "^4.0.11"
|
|
300
300
|
},
|
|
301
301
|
devDependencies: {
|
|
@@ -393,13 +393,13 @@ var WeaverseClient = class {
|
|
|
393
393
|
let {
|
|
394
394
|
strategy = this.storefront.CacheCustom({
|
|
395
395
|
maxAge: 5,
|
|
396
|
+
sMaxAge: 5,
|
|
396
397
|
staleWhileRevalidate: 82800
|
|
397
398
|
}),
|
|
398
399
|
...reqInit
|
|
399
400
|
} = options;
|
|
400
401
|
let res = this.withCache(cacheKey, strategy, async () => {
|
|
401
402
|
let cacheControlHeader = (0, import_hydrogen.generateCacheControlHeader)(strategy);
|
|
402
|
-
console.log("cacheControlHeader1", cacheControlHeader);
|
|
403
403
|
let response = await fetch(url, { ...reqInit, headers: {
|
|
404
404
|
"Cache-Control": cacheControlHeader,
|
|
405
405
|
...reqInit.headers
|
|
@@ -413,34 +413,6 @@ var WeaverseClient = class {
|
|
|
413
413
|
});
|
|
414
414
|
return res;
|
|
415
415
|
};
|
|
416
|
-
// incrementCacheHits = async () => {
|
|
417
|
-
// if (!this.cache) {
|
|
418
|
-
// return '1'
|
|
419
|
-
// }
|
|
420
|
-
// // Increment the cacheHits count in the cache
|
|
421
|
-
// const currentHitsResponse = await this.cache.match(CACHE_HITS_KEY)
|
|
422
|
-
// const currentHits = currentHitsResponse
|
|
423
|
-
// ? parseInt(await currentHitsResponse.text())
|
|
424
|
-
// : 0
|
|
425
|
-
// const newHitsCount = currentHits + 1
|
|
426
|
-
// const newHitsResponse = new Response(newHitsCount.toString(), {
|
|
427
|
-
// headers: {
|
|
428
|
-
// 'Cache-Control': 'max-age=3600',
|
|
429
|
-
// },
|
|
430
|
-
// })
|
|
431
|
-
//
|
|
432
|
-
// await this.cache.put(CACHE_HITS_KEY, newHitsResponse)
|
|
433
|
-
//
|
|
434
|
-
// return newHitsCount.toString()
|
|
435
|
-
// }
|
|
436
|
-
// resetCacheHits = async () => {
|
|
437
|
-
// if (!this.cache) {
|
|
438
|
-
// return
|
|
439
|
-
// }
|
|
440
|
-
// // Reset the cacheHits count in the cache
|
|
441
|
-
// const resetHitsResponse = new Response('0')
|
|
442
|
-
// await this.cache.put(CACHE_HITS_KEY, resetHitsResponse)
|
|
443
|
-
// }
|
|
444
416
|
loadThemeSettings = async (strategy) => {
|
|
445
417
|
try {
|
|
446
418
|
let { API, configs } = this;
|
|
@@ -516,7 +488,6 @@ var WeaverseClient = class {
|
|
|
516
488
|
} else {
|
|
517
489
|
payload = await this.fetchWithCache(url, {
|
|
518
490
|
...reqInit,
|
|
519
|
-
// headers,
|
|
520
491
|
strategy
|
|
521
492
|
});
|
|
522
493
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -223,7 +223,7 @@ var package_default = {
|
|
|
223
223
|
name: "@weaverse/hydrogen",
|
|
224
224
|
author: "Weaverse Team",
|
|
225
225
|
description: "Components, hooks, and utilities for building Shopify Hydrogen websites with Weaverse",
|
|
226
|
-
version: "2.7.1
|
|
226
|
+
version: "2.7.1",
|
|
227
227
|
license: "MIT",
|
|
228
228
|
main: "dist/index.js",
|
|
229
229
|
typings: "dist/index.d.ts",
|
|
@@ -261,7 +261,7 @@ var package_default = {
|
|
|
261
261
|
singleQuote: true
|
|
262
262
|
},
|
|
263
263
|
dependencies: {
|
|
264
|
-
"@weaverse/react": "2.
|
|
264
|
+
"@weaverse/react": "2.7.1",
|
|
265
265
|
"react-error-boundary": "^4.0.11"
|
|
266
266
|
},
|
|
267
267
|
devDependencies: {
|
|
@@ -359,13 +359,13 @@ var WeaverseClient = class {
|
|
|
359
359
|
let {
|
|
360
360
|
strategy = this.storefront.CacheCustom({
|
|
361
361
|
maxAge: 5,
|
|
362
|
+
sMaxAge: 5,
|
|
362
363
|
staleWhileRevalidate: 82800
|
|
363
364
|
}),
|
|
364
365
|
...reqInit
|
|
365
366
|
} = options;
|
|
366
367
|
let res = this.withCache(cacheKey, strategy, async () => {
|
|
367
368
|
let cacheControlHeader = generateCacheControlHeader(strategy);
|
|
368
|
-
console.log("cacheControlHeader1", cacheControlHeader);
|
|
369
369
|
let response = await fetch(url, { ...reqInit, headers: {
|
|
370
370
|
"Cache-Control": cacheControlHeader,
|
|
371
371
|
...reqInit.headers
|
|
@@ -379,34 +379,6 @@ var WeaverseClient = class {
|
|
|
379
379
|
});
|
|
380
380
|
return res;
|
|
381
381
|
};
|
|
382
|
-
// incrementCacheHits = async () => {
|
|
383
|
-
// if (!this.cache) {
|
|
384
|
-
// return '1'
|
|
385
|
-
// }
|
|
386
|
-
// // Increment the cacheHits count in the cache
|
|
387
|
-
// const currentHitsResponse = await this.cache.match(CACHE_HITS_KEY)
|
|
388
|
-
// const currentHits = currentHitsResponse
|
|
389
|
-
// ? parseInt(await currentHitsResponse.text())
|
|
390
|
-
// : 0
|
|
391
|
-
// const newHitsCount = currentHits + 1
|
|
392
|
-
// const newHitsResponse = new Response(newHitsCount.toString(), {
|
|
393
|
-
// headers: {
|
|
394
|
-
// 'Cache-Control': 'max-age=3600',
|
|
395
|
-
// },
|
|
396
|
-
// })
|
|
397
|
-
//
|
|
398
|
-
// await this.cache.put(CACHE_HITS_KEY, newHitsResponse)
|
|
399
|
-
//
|
|
400
|
-
// return newHitsCount.toString()
|
|
401
|
-
// }
|
|
402
|
-
// resetCacheHits = async () => {
|
|
403
|
-
// if (!this.cache) {
|
|
404
|
-
// return
|
|
405
|
-
// }
|
|
406
|
-
// // Reset the cacheHits count in the cache
|
|
407
|
-
// const resetHitsResponse = new Response('0')
|
|
408
|
-
// await this.cache.put(CACHE_HITS_KEY, resetHitsResponse)
|
|
409
|
-
// }
|
|
410
382
|
loadThemeSettings = async (strategy) => {
|
|
411
383
|
try {
|
|
412
384
|
let { API, configs } = this;
|
|
@@ -482,7 +454,6 @@ var WeaverseClient = class {
|
|
|
482
454
|
} else {
|
|
483
455
|
payload = await this.fetchWithCache(url, {
|
|
484
456
|
...reqInit,
|
|
485
|
-
// headers,
|
|
486
457
|
strategy
|
|
487
458
|
});
|
|
488
459
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@weaverse/hydrogen",
|
|
3
3
|
"author": "Weaverse Team",
|
|
4
4
|
"description": "Components, hooks, and utilities for building Shopify Hydrogen websites with Weaverse",
|
|
5
|
-
"version": "2.7.1
|
|
5
|
+
"version": "2.7.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"typings": "dist/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"singleQuote": true
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@weaverse/react": "2.
|
|
43
|
+
"@weaverse/react": "2.7.1",
|
|
44
44
|
"react-error-boundary": "^4.0.11"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|