@weaverse/hydrogen 2.7.1-pre.2 → 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 +2 -32
- package/dist/index.mjs +2 -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: {
|
|
@@ -400,7 +400,6 @@ var WeaverseClient = class {
|
|
|
400
400
|
} = options;
|
|
401
401
|
let res = this.withCache(cacheKey, strategy, async () => {
|
|
402
402
|
let cacheControlHeader = (0, import_hydrogen.generateCacheControlHeader)(strategy);
|
|
403
|
-
console.log("cacheControlHeader1", cacheControlHeader);
|
|
404
403
|
let response = await fetch(url, { ...reqInit, headers: {
|
|
405
404
|
"Cache-Control": cacheControlHeader,
|
|
406
405
|
...reqInit.headers
|
|
@@ -414,34 +413,6 @@ var WeaverseClient = class {
|
|
|
414
413
|
});
|
|
415
414
|
return res;
|
|
416
415
|
};
|
|
417
|
-
// incrementCacheHits = async () => {
|
|
418
|
-
// if (!this.cache) {
|
|
419
|
-
// return '1'
|
|
420
|
-
// }
|
|
421
|
-
// // Increment the cacheHits count in the cache
|
|
422
|
-
// const currentHitsResponse = await this.cache.match(CACHE_HITS_KEY)
|
|
423
|
-
// const currentHits = currentHitsResponse
|
|
424
|
-
// ? parseInt(await currentHitsResponse.text())
|
|
425
|
-
// : 0
|
|
426
|
-
// const newHitsCount = currentHits + 1
|
|
427
|
-
// const newHitsResponse = new Response(newHitsCount.toString(), {
|
|
428
|
-
// headers: {
|
|
429
|
-
// 'Cache-Control': 'max-age=3600',
|
|
430
|
-
// },
|
|
431
|
-
// })
|
|
432
|
-
//
|
|
433
|
-
// await this.cache.put(CACHE_HITS_KEY, newHitsResponse)
|
|
434
|
-
//
|
|
435
|
-
// return newHitsCount.toString()
|
|
436
|
-
// }
|
|
437
|
-
// resetCacheHits = async () => {
|
|
438
|
-
// if (!this.cache) {
|
|
439
|
-
// return
|
|
440
|
-
// }
|
|
441
|
-
// // Reset the cacheHits count in the cache
|
|
442
|
-
// const resetHitsResponse = new Response('0')
|
|
443
|
-
// await this.cache.put(CACHE_HITS_KEY, resetHitsResponse)
|
|
444
|
-
// }
|
|
445
416
|
loadThemeSettings = async (strategy) => {
|
|
446
417
|
try {
|
|
447
418
|
let { API, configs } = this;
|
|
@@ -517,7 +488,6 @@ var WeaverseClient = class {
|
|
|
517
488
|
} else {
|
|
518
489
|
payload = await this.fetchWithCache(url, {
|
|
519
490
|
...reqInit,
|
|
520
|
-
// headers,
|
|
521
491
|
strategy
|
|
522
492
|
});
|
|
523
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: {
|
|
@@ -366,7 +366,6 @@ var WeaverseClient = class {
|
|
|
366
366
|
} = options;
|
|
367
367
|
let res = this.withCache(cacheKey, strategy, async () => {
|
|
368
368
|
let cacheControlHeader = generateCacheControlHeader(strategy);
|
|
369
|
-
console.log("cacheControlHeader1", cacheControlHeader);
|
|
370
369
|
let response = await fetch(url, { ...reqInit, headers: {
|
|
371
370
|
"Cache-Control": cacheControlHeader,
|
|
372
371
|
...reqInit.headers
|
|
@@ -380,34 +379,6 @@ var WeaverseClient = class {
|
|
|
380
379
|
});
|
|
381
380
|
return res;
|
|
382
381
|
};
|
|
383
|
-
// incrementCacheHits = async () => {
|
|
384
|
-
// if (!this.cache) {
|
|
385
|
-
// return '1'
|
|
386
|
-
// }
|
|
387
|
-
// // Increment the cacheHits count in the cache
|
|
388
|
-
// const currentHitsResponse = await this.cache.match(CACHE_HITS_KEY)
|
|
389
|
-
// const currentHits = currentHitsResponse
|
|
390
|
-
// ? parseInt(await currentHitsResponse.text())
|
|
391
|
-
// : 0
|
|
392
|
-
// const newHitsCount = currentHits + 1
|
|
393
|
-
// const newHitsResponse = new Response(newHitsCount.toString(), {
|
|
394
|
-
// headers: {
|
|
395
|
-
// 'Cache-Control': 'max-age=3600',
|
|
396
|
-
// },
|
|
397
|
-
// })
|
|
398
|
-
//
|
|
399
|
-
// await this.cache.put(CACHE_HITS_KEY, newHitsResponse)
|
|
400
|
-
//
|
|
401
|
-
// return newHitsCount.toString()
|
|
402
|
-
// }
|
|
403
|
-
// resetCacheHits = async () => {
|
|
404
|
-
// if (!this.cache) {
|
|
405
|
-
// return
|
|
406
|
-
// }
|
|
407
|
-
// // Reset the cacheHits count in the cache
|
|
408
|
-
// const resetHitsResponse = new Response('0')
|
|
409
|
-
// await this.cache.put(CACHE_HITS_KEY, resetHitsResponse)
|
|
410
|
-
// }
|
|
411
382
|
loadThemeSettings = async (strategy) => {
|
|
412
383
|
try {
|
|
413
384
|
let { API, configs } = this;
|
|
@@ -483,7 +454,6 @@ var WeaverseClient = class {
|
|
|
483
454
|
} else {
|
|
484
455
|
payload = await this.fetchWithCache(url, {
|
|
485
456
|
...reqInit,
|
|
486
|
-
// headers,
|
|
487
457
|
strategy
|
|
488
458
|
});
|
|
489
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": {
|