@scayle/storefront-nuxt 8.31.0 โ 8.32.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/CHANGELOG.md +119 -106
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.32.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
**Dependencies**
|
|
8
|
+
|
|
9
|
+
**@scayle/storefront-core v8.32.0**
|
|
10
|
+
|
|
11
|
+
- Minor
|
|
12
|
+
- Added `minReduction` and `maxReduction` filter parameters to the `FetchProductsCountParams.where` type and updated the `getProductsCount` RPC method to accept and handle these new reduction-based filtering conditions.
|
|
13
|
+
- Patch
|
|
14
|
+
- Fixed the `getFilters` RPC method to properly apply `minReduction` and `maxReduction` filter parameters when fetching product counts.
|
|
15
|
+
|
|
3
16
|
## 8.31.0
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -13,23 +26,23 @@
|
|
|
13
26
|
- Added `minReduction` and `maxReduction` filter parameters to `FetchProductsByCategoryParams.where` and `FetchFiltersParams.where` types, and updated the `getProductsByCategory` and `getFilters` RPC methods to accept and handle these new reduction-based filtering conditions.
|
|
14
27
|
|
|
15
28
|
```ts
|
|
16
|
-
const { data } = useRpc(
|
|
29
|
+
const { data } = useRpc("getFilters", "getFiltersKey", () => ({
|
|
17
30
|
where: {
|
|
18
31
|
minReduction: 10,
|
|
19
32
|
maxReduction: 20,
|
|
20
33
|
},
|
|
21
|
-
}))
|
|
34
|
+
}));
|
|
22
35
|
|
|
23
36
|
const { data } = useRpc(
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
"getProductsByCategory",
|
|
38
|
+
"getProductsByCategoryKey",
|
|
26
39
|
() => ({
|
|
27
40
|
where: {
|
|
28
41
|
minReduction: 10,
|
|
29
42
|
maxReduction: 20,
|
|
30
43
|
},
|
|
31
44
|
}),
|
|
32
|
-
)
|
|
45
|
+
);
|
|
33
46
|
```
|
|
34
47
|
|
|
35
48
|
## 8.30.3
|
|
@@ -81,28 +94,28 @@
|
|
|
81
94
|
|
|
82
95
|
```ts
|
|
83
96
|
export const existingHandlerWithoutParams = async (_context: RpcContext) => {
|
|
84
|
-
return
|
|
85
|
-
}
|
|
97
|
+
return "existing handler";
|
|
98
|
+
};
|
|
86
99
|
|
|
87
100
|
export const existingHandlerWithParams = async (
|
|
88
101
|
{ name }: { name: string },
|
|
89
102
|
_context: RpcContext,
|
|
90
103
|
) => {
|
|
91
|
-
return name
|
|
92
|
-
}
|
|
104
|
+
return name;
|
|
105
|
+
};
|
|
93
106
|
|
|
94
107
|
// will become
|
|
95
108
|
|
|
96
109
|
export const existingHandlerWithoutParams = defineRpcHandler(
|
|
97
110
|
async (_context: RpcContext) => {
|
|
98
|
-
return
|
|
111
|
+
return "existing handler";
|
|
99
112
|
},
|
|
100
|
-
)
|
|
113
|
+
);
|
|
101
114
|
export const existingHandlerWithParams = defineRpcHandler(
|
|
102
115
|
async ({ name }: { name: string }, _context: RpcContext) => {
|
|
103
|
-
return name
|
|
116
|
+
return name;
|
|
104
117
|
},
|
|
105
|
-
)
|
|
118
|
+
);
|
|
106
119
|
```
|
|
107
120
|
|
|
108
121
|
- Patch
|
|
@@ -124,15 +137,15 @@
|
|
|
124
137
|
- Added an optional `hideEmptyCategories` parameter to `getCategoryTree`. When enabled, the product count for each category is retrieved, and categories (including their children) without any products are removed. Enabling this option may increase response times, especially for large category trees.
|
|
125
138
|
|
|
126
139
|
```ts
|
|
127
|
-
import { rpcMethods } from
|
|
140
|
+
import { rpcMethods } from "@scayle/storefront-core";
|
|
128
141
|
|
|
129
|
-
rpcMethods.getCategoryTree({ hideEmptyCategories: true }, rpcContext)
|
|
142
|
+
rpcMethods.getCategoryTree({ hideEmptyCategories: true }, rpcContext);
|
|
130
143
|
```
|
|
131
144
|
|
|
132
145
|
or
|
|
133
146
|
|
|
134
147
|
```ts
|
|
135
|
-
import { useCategoryTree } from
|
|
148
|
+
import { useCategoryTree } from "#storefront/composables";
|
|
136
149
|
|
|
137
150
|
const { data: rootCategories, status } = useCategoryTree(
|
|
138
151
|
{
|
|
@@ -140,8 +153,8 @@
|
|
|
140
153
|
hideEmptyCategories: true,
|
|
141
154
|
},
|
|
142
155
|
},
|
|
143
|
-
|
|
144
|
-
)
|
|
156
|
+
"category-navigation-tree",
|
|
157
|
+
);
|
|
145
158
|
```
|
|
146
159
|
|
|
147
160
|
## 8.28.7
|
|
@@ -238,9 +251,9 @@
|
|
|
238
251
|
params: {
|
|
239
252
|
children: 10,
|
|
240
253
|
includeHidden: true,
|
|
241
|
-
properties: { withName: [
|
|
254
|
+
properties: { withName: ["sale"] },
|
|
242
255
|
},
|
|
243
|
-
})
|
|
256
|
+
});
|
|
244
257
|
```
|
|
245
258
|
|
|
246
259
|
### Patch Changes
|
|
@@ -411,16 +424,16 @@
|
|
|
411
424
|
nitro: {
|
|
412
425
|
storage: {
|
|
413
426
|
redis: {
|
|
414
|
-
driver:
|
|
415
|
-
host:
|
|
427
|
+
driver: "redis",
|
|
428
|
+
host: "localhost",
|
|
416
429
|
},
|
|
417
430
|
db: {
|
|
418
|
-
driver:
|
|
419
|
-
base:
|
|
431
|
+
driver: "fs",
|
|
432
|
+
base: "./.data/db",
|
|
420
433
|
},
|
|
421
434
|
},
|
|
422
435
|
},
|
|
423
|
-
})
|
|
436
|
+
});
|
|
424
437
|
```
|
|
425
438
|
|
|
426
439
|
With the introduction of the new approach for configuring storefront storage mounts, the global and shop-specific `storage` option within the `@scayle/storefront-nuxt` runtime configuration has been deprecated.
|
|
@@ -493,9 +506,9 @@
|
|
|
493
506
|
```typescript
|
|
494
507
|
const idp = useIDP({
|
|
495
508
|
authUrlParameters: {
|
|
496
|
-
theme:
|
|
509
|
+
theme: "dark",
|
|
497
510
|
},
|
|
498
|
-
})
|
|
511
|
+
});
|
|
499
512
|
```
|
|
500
513
|
|
|
501
514
|
### Patch Changes
|
|
@@ -637,11 +650,11 @@
|
|
|
637
650
|
storefront: {
|
|
638
651
|
redirects: {
|
|
639
652
|
enabled: true,
|
|
640
|
-
strategy:
|
|
653
|
+
strategy: "on-missing",
|
|
641
654
|
},
|
|
642
655
|
},
|
|
643
656
|
},
|
|
644
|
-
})
|
|
657
|
+
});
|
|
645
658
|
```
|
|
646
659
|
|
|
647
660
|
Also, keep in mind that when this option is enabled, the redirect logic will only be executed when the request would otherwise result in a 404. There are three ways in which a 404 can occur.
|
|
@@ -655,7 +668,7 @@
|
|
|
655
668
|
If the request handler returns a `Response` object with a `status` of 404, a 404 response will be returned to the client.
|
|
656
669
|
|
|
657
670
|
```typescript
|
|
658
|
-
return new Response(null, { status: 404 })
|
|
671
|
+
return new Response(null, { status: 404 });
|
|
659
672
|
```
|
|
660
673
|
|
|
661
674
|
3. Thrown H3Error with 404 status
|
|
@@ -663,8 +676,8 @@
|
|
|
663
676
|
If the request handler throws an H3Error with a `statusCode` 404, a 404 response will be returned to the client.
|
|
664
677
|
|
|
665
678
|
```typescript
|
|
666
|
-
import { createError } from
|
|
667
|
-
throw createError({ statusCode: 404 })
|
|
679
|
+
import { createError } from "h3";
|
|
680
|
+
throw createError({ statusCode: 404 });
|
|
668
681
|
```
|
|
669
682
|
|
|
670
683
|
### Patch Changes
|
|
@@ -1106,28 +1119,28 @@
|
|
|
1106
1119
|
**rpc-methods.ts**
|
|
1107
1120
|
|
|
1108
1121
|
```typescript
|
|
1109
|
-
import type { RpcContext, RpcHandler } from
|
|
1122
|
+
import type { RpcContext, RpcHandler } from "@scayle/storefront-nuxt";
|
|
1110
1123
|
|
|
1111
1124
|
export const foo: RpcHandler<string, number> = function testing(
|
|
1112
1125
|
param: string,
|
|
1113
1126
|
_: RpcContext,
|
|
1114
1127
|
) {
|
|
1115
|
-
return param.length
|
|
1116
|
-
}
|
|
1128
|
+
return param.length;
|
|
1129
|
+
};
|
|
1117
1130
|
```
|
|
1118
1131
|
|
|
1119
1132
|
**module.ts**
|
|
1120
1133
|
|
|
1121
1134
|
```typescript
|
|
1122
1135
|
function setup() {
|
|
1123
|
-
const resolver = createResolver(import.meta.url)
|
|
1136
|
+
const resolver = createResolver(import.meta.url);
|
|
1124
1137
|
|
|
1125
|
-
nuxt.hook(
|
|
1138
|
+
nuxt.hook("storefront:custom-rpc:extend", (customRpcImports) => {
|
|
1126
1139
|
customRpcImports.push({
|
|
1127
|
-
source: resolver.resolve(
|
|
1128
|
-
names: [
|
|
1129
|
-
})
|
|
1130
|
-
})
|
|
1140
|
+
source: resolver.resolve("./rpc-methods.ts"),
|
|
1141
|
+
names: ["foo"],
|
|
1142
|
+
});
|
|
1143
|
+
});
|
|
1131
1144
|
}
|
|
1132
1145
|
```
|
|
1133
1146
|
|
|
@@ -1349,23 +1362,23 @@
|
|
|
1349
1362
|
storefront: {
|
|
1350
1363
|
// ...
|
|
1351
1364
|
redis: {
|
|
1352
|
-
host:
|
|
1365
|
+
host: "localhost",
|
|
1353
1366
|
port: 6379,
|
|
1354
|
-
prefix:
|
|
1355
|
-
user:
|
|
1356
|
-
password:
|
|
1367
|
+
prefix: "",
|
|
1368
|
+
user: "",
|
|
1369
|
+
password: "",
|
|
1357
1370
|
sslTransit: false,
|
|
1358
1371
|
},
|
|
1359
1372
|
// ...
|
|
1360
1373
|
session: {
|
|
1361
1374
|
// ...
|
|
1362
|
-
provider:
|
|
1375
|
+
provider: "redis",
|
|
1363
1376
|
},
|
|
1364
1377
|
},
|
|
1365
1378
|
// ...
|
|
1366
1379
|
},
|
|
1367
1380
|
// ...
|
|
1368
|
-
})
|
|
1381
|
+
});
|
|
1369
1382
|
```
|
|
1370
1383
|
|
|
1371
1384
|
- _Current Unified Storage Approach (`nuxt.config.ts`):_
|
|
@@ -1379,13 +1392,13 @@
|
|
|
1379
1392
|
// ...
|
|
1380
1393
|
storage: {
|
|
1381
1394
|
cache: {
|
|
1382
|
-
driver:
|
|
1383
|
-
host:
|
|
1395
|
+
driver: "redis",
|
|
1396
|
+
host: "localhost",
|
|
1384
1397
|
port: 6379,
|
|
1385
1398
|
},
|
|
1386
1399
|
session: {
|
|
1387
|
-
driver:
|
|
1388
|
-
host:
|
|
1400
|
+
driver: "redis",
|
|
1401
|
+
host: "localhost",
|
|
1389
1402
|
port: 6379,
|
|
1390
1403
|
},
|
|
1391
1404
|
// ...
|
|
@@ -1395,7 +1408,7 @@
|
|
|
1395
1408
|
// ...
|
|
1396
1409
|
},
|
|
1397
1410
|
// ...
|
|
1398
|
-
})
|
|
1411
|
+
});
|
|
1399
1412
|
```
|
|
1400
1413
|
|
|
1401
1414
|
- **\[๐ฅ BREAKING\]** The composable `useSearch` has been replaced by `useStorefrontSearch`, consolidating and transitioning to SCAYLE Search v2.
|
|
@@ -1462,9 +1475,9 @@
|
|
|
1462
1475
|
|
|
1463
1476
|
```ts
|
|
1464
1477
|
const { activeFilters, applyFilters, resetFilterUrl, productConditions } =
|
|
1465
|
-
useQueryFilterState()
|
|
1478
|
+
useQueryFilterState();
|
|
1466
1479
|
|
|
1467
|
-
applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 })
|
|
1480
|
+
applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 });
|
|
1468
1481
|
```
|
|
1469
1482
|
|
|
1470
1483
|
- _Current Usage of `useFilter` and `useAppliedFilters`:_
|
|
@@ -1477,20 +1490,20 @@
|
|
|
1477
1490
|
resetFilters,
|
|
1478
1491
|
resetPriceFilter,
|
|
1479
1492
|
resetFilter,
|
|
1480
|
-
} = useFilter()
|
|
1493
|
+
} = useFilter();
|
|
1481
1494
|
|
|
1482
|
-
applyPriceFilter([0, 100])
|
|
1483
|
-
applyBooleanFilter(
|
|
1484
|
-
applyAttributeFilter(
|
|
1495
|
+
applyPriceFilter([0, 100]);
|
|
1496
|
+
applyBooleanFilter("sale", true);
|
|
1497
|
+
applyAttributeFilter("brand", 23);
|
|
1485
1498
|
|
|
1486
|
-
const route = useRoute()
|
|
1499
|
+
const route = useRoute();
|
|
1487
1500
|
const {
|
|
1488
1501
|
appliedFilter,
|
|
1489
1502
|
appliedFiltersCount,
|
|
1490
1503
|
appliedAttributeValues,
|
|
1491
1504
|
appliedBooleanValues,
|
|
1492
1505
|
areFiltersApplied,
|
|
1493
|
-
} = useAppliedFilters(route)
|
|
1506
|
+
} = useAppliedFilters(route);
|
|
1494
1507
|
```
|
|
1495
1508
|
|
|
1496
1509
|
- **\[๐ฅ BREAKING\]** The `getBadgeLabel` helper function has been removed, giving you more control over badge label display.
|
|
@@ -1500,43 +1513,43 @@
|
|
|
1500
1513
|
|
|
1501
1514
|
```ts
|
|
1502
1515
|
const BadgeLabel = {
|
|
1503
|
-
NEW:
|
|
1504
|
-
SOLD_OUT:
|
|
1505
|
-
ONLINE_EXCLUSIVE:
|
|
1506
|
-
SUSTAINABLE:
|
|
1507
|
-
PREMIUM:
|
|
1508
|
-
DEFAULT:
|
|
1509
|
-
} as const
|
|
1516
|
+
NEW: "new",
|
|
1517
|
+
SOLD_OUT: "sold_out",
|
|
1518
|
+
ONLINE_EXCLUSIVE: "online_exclusive",
|
|
1519
|
+
SUSTAINABLE: "sustainable",
|
|
1520
|
+
PREMIUM: "premium",
|
|
1521
|
+
DEFAULT: "",
|
|
1522
|
+
} as const;
|
|
1510
1523
|
|
|
1511
1524
|
type BadgeLabelParamsKeys =
|
|
1512
|
-
|
|
|
1513
|
-
|
|
|
1514
|
-
|
|
|
1515
|
-
|
|
|
1516
|
-
|
|
|
1517
|
-
type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean
|
|
1525
|
+
| "isNew"
|
|
1526
|
+
| "isSoldOut"
|
|
1527
|
+
| "isOnlineOnly"
|
|
1528
|
+
| "isSustainable"
|
|
1529
|
+
| "isPremium";
|
|
1530
|
+
type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean>>;
|
|
1518
1531
|
|
|
1519
1532
|
const getBadgeLabel = (params: BadgeLabelParams = {}): string => {
|
|
1520
1533
|
if (!params) {
|
|
1521
|
-
return BadgeLabel.DEFAULT
|
|
1534
|
+
return BadgeLabel.DEFAULT;
|
|
1522
1535
|
}
|
|
1523
1536
|
const { isNew, isSoldOut, isOnlineOnly, isSustainable, isPremium } =
|
|
1524
|
-
params
|
|
1537
|
+
params;
|
|
1525
1538
|
|
|
1526
1539
|
if (isNew) {
|
|
1527
|
-
return BadgeLabel.NEW
|
|
1540
|
+
return BadgeLabel.NEW;
|
|
1528
1541
|
} else if (isSoldOut) {
|
|
1529
|
-
return BadgeLabel.SOLD_OUT
|
|
1542
|
+
return BadgeLabel.SOLD_OUT;
|
|
1530
1543
|
} else if (isOnlineOnly) {
|
|
1531
|
-
return BadgeLabel.ONLINE_EXCLUSIVE
|
|
1544
|
+
return BadgeLabel.ONLINE_EXCLUSIVE;
|
|
1532
1545
|
} else if (isSustainable) {
|
|
1533
|
-
return BadgeLabel.SUSTAINABLE
|
|
1546
|
+
return BadgeLabel.SUSTAINABLE;
|
|
1534
1547
|
} else if (isPremium) {
|
|
1535
|
-
return BadgeLabel.PREMIUM
|
|
1548
|
+
return BadgeLabel.PREMIUM;
|
|
1536
1549
|
} else {
|
|
1537
|
-
return BadgeLabel.DEFAULT
|
|
1550
|
+
return BadgeLabel.DEFAULT;
|
|
1538
1551
|
}
|
|
1539
|
-
}
|
|
1552
|
+
};
|
|
1540
1553
|
```
|
|
1541
1554
|
|
|
1542
1555
|
- **\[๐ฅ BREAKING\]** The `store` option in the module configuration has been removed. `ลscayle/storefront-nuxt@7.84.0` introduced the `shops` option as a replacement, but maintained backward compatibility with the `store` option. Going forward, configuring shops must be done using the `shops` keyword.
|
|
@@ -1560,7 +1573,7 @@
|
|
|
1560
1573
|
// ...
|
|
1561
1574
|
},
|
|
1562
1575
|
// ...
|
|
1563
|
-
})
|
|
1576
|
+
});
|
|
1564
1577
|
```
|
|
1565
1578
|
|
|
1566
1579
|
- _Previous Environment Variables for Store Configuration:_
|
|
@@ -1589,7 +1602,7 @@
|
|
|
1589
1602
|
// ...
|
|
1590
1603
|
},
|
|
1591
1604
|
// ...
|
|
1592
|
-
})
|
|
1605
|
+
});
|
|
1593
1606
|
```
|
|
1594
1607
|
|
|
1595
1608
|
- _Current Environment Variables for Shops Configuration:_
|
|
@@ -1609,8 +1622,8 @@
|
|
|
1609
1622
|
```ts
|
|
1610
1623
|
useProduct({
|
|
1611
1624
|
// ...
|
|
1612
|
-
key:
|
|
1613
|
-
})
|
|
1625
|
+
key: "productKey",
|
|
1626
|
+
});
|
|
1614
1627
|
```
|
|
1615
1628
|
|
|
1616
1629
|
- _Current `key` as dedicated composables argument:_
|
|
@@ -1620,8 +1633,8 @@
|
|
|
1620
1633
|
{
|
|
1621
1634
|
// ...
|
|
1622
1635
|
},
|
|
1623
|
-
|
|
1624
|
-
)
|
|
1636
|
+
"productKey",
|
|
1637
|
+
);
|
|
1625
1638
|
```
|
|
1626
1639
|
|
|
1627
1640
|
- **\[๐ฅ BREAKING\]** Introducing a new feature flag `storefront.legacy.enableSessionMigration` to control the automatic migration of legacy session data, set to `false` by default. Starting with `@scayle/storefront-nuxt@7.68.0` Storefront uses unique session cookie names for each shop, simplifying implementation and enhancing stability.
|
|
@@ -1638,27 +1651,27 @@
|
|
|
1638
1651
|
- _Previous Usage of `handleIDPLoginCallback`:_
|
|
1639
1652
|
|
|
1640
1653
|
```ts
|
|
1641
|
-
const { handleIDPLoginCallback } = await useIDP()
|
|
1654
|
+
const { handleIDPLoginCallback } = await useIDP();
|
|
1642
1655
|
|
|
1643
1656
|
watch(
|
|
1644
1657
|
() => route.query,
|
|
1645
1658
|
async (query) => {
|
|
1646
1659
|
if (query.code && isString(query.code)) {
|
|
1647
|
-
await handleIDPLoginCallback(query.code)
|
|
1660
|
+
await handleIDPLoginCallback(query.code);
|
|
1648
1661
|
}
|
|
1649
1662
|
},
|
|
1650
1663
|
{ immediate: true },
|
|
1651
|
-
)
|
|
1664
|
+
);
|
|
1652
1665
|
```
|
|
1653
1666
|
|
|
1654
1667
|
- _Current Usage of `loginIDP`:_
|
|
1655
1668
|
|
|
1656
1669
|
```ts
|
|
1657
|
-
const { loginIDP } = useAuthentication(
|
|
1670
|
+
const { loginIDP } = useAuthentication("login");
|
|
1658
1671
|
|
|
1659
1672
|
onMounted(async () => {
|
|
1660
|
-
await loginIDP(props.code)
|
|
1661
|
-
})
|
|
1673
|
+
await loginIDP(props.code);
|
|
1674
|
+
});
|
|
1662
1675
|
```
|
|
1663
1676
|
|
|
1664
1677
|
- **\[๐งน NON-BREAKING\]** Addressed various type resolution errors that were present when using the `@scayle/storefront-nuxt` package with different Node.js versions and module systems. These errors manifested as internal resolution errors or ESM dynamic import only warnings. With this fix, the package now more consistently resolves types correctly across Node.js 16 (CJS and ESM), and bundlers, ensuring a smoother developer experience.
|
|
@@ -1668,17 +1681,17 @@
|
|
|
1668
1681
|
- _Previous `useRpc` with `autoFetch`:_
|
|
1669
1682
|
|
|
1670
1683
|
```ts
|
|
1671
|
-
useRpc(
|
|
1684
|
+
useRpc("rpcMethod", key, params, { autoFetch: true });
|
|
1672
1685
|
|
|
1673
|
-
useUser({ autoFetch: true })
|
|
1686
|
+
useUser({ autoFetch: true });
|
|
1674
1687
|
```
|
|
1675
1688
|
|
|
1676
1689
|
- _Current `useRpc` with `immediate`:_
|
|
1677
1690
|
|
|
1678
1691
|
```ts
|
|
1679
|
-
useRpc(
|
|
1692
|
+
useRpc("rpcMethod", key, params, { immediate: true });
|
|
1680
1693
|
|
|
1681
|
-
useUser({ immediate: true })
|
|
1694
|
+
useUser({ immediate: true });
|
|
1682
1695
|
```
|
|
1683
1696
|
|
|
1684
1697
|
- **\[๐ฅ BREAKING\]** The attribute `isCmsPreview` has been removed from `RpcContext`.
|
|
@@ -1698,18 +1711,18 @@
|
|
|
1698
1711
|
getSearchSuggestions,
|
|
1699
1712
|
fetching,
|
|
1700
1713
|
...searchData
|
|
1701
|
-
} = useStorefrontSearch(searchQuery, { key })
|
|
1714
|
+
} = useStorefrontSearch(searchQuery, { key });
|
|
1702
1715
|
|
|
1703
|
-
fetching.value // true or false
|
|
1716
|
+
fetching.value; // true or false
|
|
1704
1717
|
```
|
|
1705
1718
|
|
|
1706
1719
|
- _Current `useStorefrontSearch` returning `status`:_
|
|
1707
1720
|
|
|
1708
1721
|
```ts
|
|
1709
1722
|
const { data, resolveSearch, getSearchSuggestions, status, ...searchData } =
|
|
1710
|
-
useStorefrontSearch(searchQuery, {}, key)
|
|
1723
|
+
useStorefrontSearch(searchQuery, {}, key);
|
|
1711
1724
|
|
|
1712
|
-
status.value // 'idle', 'pending', 'error' or 'success'
|
|
1725
|
+
status.value; // 'idle', 'pending', 'error' or 'success'
|
|
1713
1726
|
```
|
|
1714
1727
|
|
|
1715
1728
|
- **\[๐ฅ BREAKING\]** We've simplified composable caching and clarified the control you have over shared state behavior. The configuration option `disableDefaultGetCachedDataOverride` has been replaced with `legacy.enableDefaultGetCachedDataOverride`, and its logic has been reversed. Now, when `legacy.enableDefaultGetCachedDataOverride` is not set or set to `false`, the default behavior maintains the shared state functionality of `useRpc`, where multiple calls with the same key use the same cached data. Setting the option to `true` bypasses this shared caching, providing data isolation between calls. To maintain your existing caching behavior, simply change the value of `disableDefaultGetCachedDataOverride` to its opposite in your `nuxt.config.ts` file.
|
|
@@ -1734,7 +1747,7 @@
|
|
|
1734
1747
|
// ...
|
|
1735
1748
|
},
|
|
1736
1749
|
// ...
|
|
1737
|
-
})
|
|
1750
|
+
});
|
|
1738
1751
|
```
|
|
1739
1752
|
|
|
1740
1753
|
- _Current `enableDefaultGetCachedDataOverride`in `nuxt.config.ts`:_
|
|
@@ -1759,7 +1772,7 @@
|
|
|
1759
1772
|
// ...
|
|
1760
1773
|
},
|
|
1761
1774
|
// ...
|
|
1762
|
-
})
|
|
1775
|
+
});
|
|
1763
1776
|
```
|
|
1764
1777
|
|
|
1765
1778
|
- **\[๐ฅ BREAKING\]** The `useRpc` composable has been updated to provide a more modern and robust data fetching experience, aligning its interface with the current and underlying [Nuxt 3 `useAsyncData`.](https://nuxt.com/docs/api/composables/use-async-data#return-values).
|
|
@@ -1781,7 +1794,7 @@
|
|
|
1781
1794
|
function myCustomRpc() {
|
|
1782
1795
|
// ...
|
|
1783
1796
|
|
|
1784
|
-
throw new BaseError(404)
|
|
1797
|
+
throw new BaseError(404);
|
|
1785
1798
|
}
|
|
1786
1799
|
```
|
|
1787
1800
|
|
|
@@ -1791,7 +1804,7 @@
|
|
|
1791
1804
|
function myCustomRpc() {
|
|
1792
1805
|
// ...
|
|
1793
1806
|
|
|
1794
|
-
return new Response(null, { status: 404 })
|
|
1807
|
+
return new Response(null, { status: 404 });
|
|
1795
1808
|
}
|
|
1796
1809
|
```
|
|
1797
1810
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-nuxt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.32.0",
|
|
5
5
|
"description": "Nuxt integration for the SCAYLE Commerce Engine and Storefront API",
|
|
6
6
|
"author": "SCAYLE Commerce Engine",
|
|
7
7
|
"license": "MIT",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@opentelemetry/api": "^1.9.0",
|
|
66
66
|
"@scayle/h3-session": "0.6.1",
|
|
67
|
-
"@scayle/storefront-core": "8.
|
|
67
|
+
"@scayle/storefront-core": "8.32.0",
|
|
68
68
|
"@scayle/unstorage-compression-driver": "^1.0.0",
|
|
69
69
|
"@vercel/nft": "0.29.4",
|
|
70
70
|
"@vueuse/core": "13.4.0",
|
|
@@ -90,15 +90,15 @@
|
|
|
90
90
|
"@nuxt/kit": "3.16.2",
|
|
91
91
|
"@nuxt/module-builder": "1.0.1",
|
|
92
92
|
"@nuxt/schema": "3.16.2",
|
|
93
|
-
"@nuxt/test-utils": "3.
|
|
94
|
-
"@scayle/eslint-config-storefront": "4.5.
|
|
93
|
+
"@nuxt/test-utils": "3.19.2",
|
|
94
|
+
"@scayle/eslint-config-storefront": "4.5.12",
|
|
95
95
|
"@scayle/eslint-plugin-vue-composable": "0.2.1",
|
|
96
96
|
"@scayle/unstorage-scayle-kv-driver": "1.0.2",
|
|
97
|
-
"@types/node": "22.15.
|
|
97
|
+
"@types/node": "22.15.34",
|
|
98
98
|
"@vitest/coverage-v8": "3.2.4",
|
|
99
|
-
"dprint": "0.50.
|
|
99
|
+
"dprint": "0.50.1",
|
|
100
100
|
"eslint-formatter-gitlab": "6.0.1",
|
|
101
|
-
"eslint": "9.
|
|
101
|
+
"eslint": "9.30.0",
|
|
102
102
|
"fishery": "2.3.1",
|
|
103
103
|
"h3": "1.15.3",
|
|
104
104
|
"nitro-test-utils": "0.9.2",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"vue": "^3.4.0"
|
|
123
123
|
},
|
|
124
124
|
"volta": {
|
|
125
|
-
"node": "22.
|
|
125
|
+
"node": "22.17.0"
|
|
126
126
|
},
|
|
127
127
|
"scripts": {
|
|
128
128
|
"build": "nuxt-module-build build",
|