@scayle/storefront-nuxt 8.31.0 โ 8.32.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/CHANGELOG.md +131 -106
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @scayle/storefront-nuxt
|
|
2
2
|
|
|
3
|
+
## 8.32.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependency `@scayle/storefront-core@8.31.0` to `@scayle/storefront-core@8.32.0`
|
|
8
|
+
|
|
9
|
+
**Dependencies**
|
|
10
|
+
|
|
11
|
+
**@scayle/storefront-core v8.32.1**
|
|
12
|
+
|
|
13
|
+
- No changes in this release.
|
|
14
|
+
|
|
15
|
+
## 8.32.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
**Dependencies**
|
|
20
|
+
|
|
21
|
+
**@scayle/storefront-core v8.32.0**
|
|
22
|
+
|
|
23
|
+
- Minor
|
|
24
|
+
- 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.
|
|
25
|
+
- Patch
|
|
26
|
+
- Fixed the `getFilters` RPC method to properly apply `minReduction` and `maxReduction` filter parameters when fetching product counts.
|
|
27
|
+
|
|
3
28
|
## 8.31.0
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
|
@@ -13,23 +38,23 @@
|
|
|
13
38
|
- 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
39
|
|
|
15
40
|
```ts
|
|
16
|
-
const { data } = useRpc(
|
|
41
|
+
const { data } = useRpc("getFilters", "getFiltersKey", () => ({
|
|
17
42
|
where: {
|
|
18
43
|
minReduction: 10,
|
|
19
44
|
maxReduction: 20,
|
|
20
45
|
},
|
|
21
|
-
}))
|
|
46
|
+
}));
|
|
22
47
|
|
|
23
48
|
const { data } = useRpc(
|
|
24
|
-
|
|
25
|
-
|
|
49
|
+
"getProductsByCategory",
|
|
50
|
+
"getProductsByCategoryKey",
|
|
26
51
|
() => ({
|
|
27
52
|
where: {
|
|
28
53
|
minReduction: 10,
|
|
29
54
|
maxReduction: 20,
|
|
30
55
|
},
|
|
31
56
|
}),
|
|
32
|
-
)
|
|
57
|
+
);
|
|
33
58
|
```
|
|
34
59
|
|
|
35
60
|
## 8.30.3
|
|
@@ -81,28 +106,28 @@
|
|
|
81
106
|
|
|
82
107
|
```ts
|
|
83
108
|
export const existingHandlerWithoutParams = async (_context: RpcContext) => {
|
|
84
|
-
return
|
|
85
|
-
}
|
|
109
|
+
return "existing handler";
|
|
110
|
+
};
|
|
86
111
|
|
|
87
112
|
export const existingHandlerWithParams = async (
|
|
88
113
|
{ name }: { name: string },
|
|
89
114
|
_context: RpcContext,
|
|
90
115
|
) => {
|
|
91
|
-
return name
|
|
92
|
-
}
|
|
116
|
+
return name;
|
|
117
|
+
};
|
|
93
118
|
|
|
94
119
|
// will become
|
|
95
120
|
|
|
96
121
|
export const existingHandlerWithoutParams = defineRpcHandler(
|
|
97
122
|
async (_context: RpcContext) => {
|
|
98
|
-
return
|
|
123
|
+
return "existing handler";
|
|
99
124
|
},
|
|
100
|
-
)
|
|
125
|
+
);
|
|
101
126
|
export const existingHandlerWithParams = defineRpcHandler(
|
|
102
127
|
async ({ name }: { name: string }, _context: RpcContext) => {
|
|
103
|
-
return name
|
|
128
|
+
return name;
|
|
104
129
|
},
|
|
105
|
-
)
|
|
130
|
+
);
|
|
106
131
|
```
|
|
107
132
|
|
|
108
133
|
- Patch
|
|
@@ -124,15 +149,15 @@
|
|
|
124
149
|
- 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
150
|
|
|
126
151
|
```ts
|
|
127
|
-
import { rpcMethods } from
|
|
152
|
+
import { rpcMethods } from "@scayle/storefront-core";
|
|
128
153
|
|
|
129
|
-
rpcMethods.getCategoryTree({ hideEmptyCategories: true }, rpcContext)
|
|
154
|
+
rpcMethods.getCategoryTree({ hideEmptyCategories: true }, rpcContext);
|
|
130
155
|
```
|
|
131
156
|
|
|
132
157
|
or
|
|
133
158
|
|
|
134
159
|
```ts
|
|
135
|
-
import { useCategoryTree } from
|
|
160
|
+
import { useCategoryTree } from "#storefront/composables";
|
|
136
161
|
|
|
137
162
|
const { data: rootCategories, status } = useCategoryTree(
|
|
138
163
|
{
|
|
@@ -140,8 +165,8 @@
|
|
|
140
165
|
hideEmptyCategories: true,
|
|
141
166
|
},
|
|
142
167
|
},
|
|
143
|
-
|
|
144
|
-
)
|
|
168
|
+
"category-navigation-tree",
|
|
169
|
+
);
|
|
145
170
|
```
|
|
146
171
|
|
|
147
172
|
## 8.28.7
|
|
@@ -238,9 +263,9 @@
|
|
|
238
263
|
params: {
|
|
239
264
|
children: 10,
|
|
240
265
|
includeHidden: true,
|
|
241
|
-
properties: { withName: [
|
|
266
|
+
properties: { withName: ["sale"] },
|
|
242
267
|
},
|
|
243
|
-
})
|
|
268
|
+
});
|
|
244
269
|
```
|
|
245
270
|
|
|
246
271
|
### Patch Changes
|
|
@@ -411,16 +436,16 @@
|
|
|
411
436
|
nitro: {
|
|
412
437
|
storage: {
|
|
413
438
|
redis: {
|
|
414
|
-
driver:
|
|
415
|
-
host:
|
|
439
|
+
driver: "redis",
|
|
440
|
+
host: "localhost",
|
|
416
441
|
},
|
|
417
442
|
db: {
|
|
418
|
-
driver:
|
|
419
|
-
base:
|
|
443
|
+
driver: "fs",
|
|
444
|
+
base: "./.data/db",
|
|
420
445
|
},
|
|
421
446
|
},
|
|
422
447
|
},
|
|
423
|
-
})
|
|
448
|
+
});
|
|
424
449
|
```
|
|
425
450
|
|
|
426
451
|
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 +518,9 @@
|
|
|
493
518
|
```typescript
|
|
494
519
|
const idp = useIDP({
|
|
495
520
|
authUrlParameters: {
|
|
496
|
-
theme:
|
|
521
|
+
theme: "dark",
|
|
497
522
|
},
|
|
498
|
-
})
|
|
523
|
+
});
|
|
499
524
|
```
|
|
500
525
|
|
|
501
526
|
### Patch Changes
|
|
@@ -637,11 +662,11 @@
|
|
|
637
662
|
storefront: {
|
|
638
663
|
redirects: {
|
|
639
664
|
enabled: true,
|
|
640
|
-
strategy:
|
|
665
|
+
strategy: "on-missing",
|
|
641
666
|
},
|
|
642
667
|
},
|
|
643
668
|
},
|
|
644
|
-
})
|
|
669
|
+
});
|
|
645
670
|
```
|
|
646
671
|
|
|
647
672
|
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 +680,7 @@
|
|
|
655
680
|
If the request handler returns a `Response` object with a `status` of 404, a 404 response will be returned to the client.
|
|
656
681
|
|
|
657
682
|
```typescript
|
|
658
|
-
return new Response(null, { status: 404 })
|
|
683
|
+
return new Response(null, { status: 404 });
|
|
659
684
|
```
|
|
660
685
|
|
|
661
686
|
3. Thrown H3Error with 404 status
|
|
@@ -663,8 +688,8 @@
|
|
|
663
688
|
If the request handler throws an H3Error with a `statusCode` 404, a 404 response will be returned to the client.
|
|
664
689
|
|
|
665
690
|
```typescript
|
|
666
|
-
import { createError } from
|
|
667
|
-
throw createError({ statusCode: 404 })
|
|
691
|
+
import { createError } from "h3";
|
|
692
|
+
throw createError({ statusCode: 404 });
|
|
668
693
|
```
|
|
669
694
|
|
|
670
695
|
### Patch Changes
|
|
@@ -1106,28 +1131,28 @@
|
|
|
1106
1131
|
**rpc-methods.ts**
|
|
1107
1132
|
|
|
1108
1133
|
```typescript
|
|
1109
|
-
import type { RpcContext, RpcHandler } from
|
|
1134
|
+
import type { RpcContext, RpcHandler } from "@scayle/storefront-nuxt";
|
|
1110
1135
|
|
|
1111
1136
|
export const foo: RpcHandler<string, number> = function testing(
|
|
1112
1137
|
param: string,
|
|
1113
1138
|
_: RpcContext,
|
|
1114
1139
|
) {
|
|
1115
|
-
return param.length
|
|
1116
|
-
}
|
|
1140
|
+
return param.length;
|
|
1141
|
+
};
|
|
1117
1142
|
```
|
|
1118
1143
|
|
|
1119
1144
|
**module.ts**
|
|
1120
1145
|
|
|
1121
1146
|
```typescript
|
|
1122
1147
|
function setup() {
|
|
1123
|
-
const resolver = createResolver(import.meta.url)
|
|
1148
|
+
const resolver = createResolver(import.meta.url);
|
|
1124
1149
|
|
|
1125
|
-
nuxt.hook(
|
|
1150
|
+
nuxt.hook("storefront:custom-rpc:extend", (customRpcImports) => {
|
|
1126
1151
|
customRpcImports.push({
|
|
1127
|
-
source: resolver.resolve(
|
|
1128
|
-
names: [
|
|
1129
|
-
})
|
|
1130
|
-
})
|
|
1152
|
+
source: resolver.resolve("./rpc-methods.ts"),
|
|
1153
|
+
names: ["foo"],
|
|
1154
|
+
});
|
|
1155
|
+
});
|
|
1131
1156
|
}
|
|
1132
1157
|
```
|
|
1133
1158
|
|
|
@@ -1349,23 +1374,23 @@
|
|
|
1349
1374
|
storefront: {
|
|
1350
1375
|
// ...
|
|
1351
1376
|
redis: {
|
|
1352
|
-
host:
|
|
1377
|
+
host: "localhost",
|
|
1353
1378
|
port: 6379,
|
|
1354
|
-
prefix:
|
|
1355
|
-
user:
|
|
1356
|
-
password:
|
|
1379
|
+
prefix: "",
|
|
1380
|
+
user: "",
|
|
1381
|
+
password: "",
|
|
1357
1382
|
sslTransit: false,
|
|
1358
1383
|
},
|
|
1359
1384
|
// ...
|
|
1360
1385
|
session: {
|
|
1361
1386
|
// ...
|
|
1362
|
-
provider:
|
|
1387
|
+
provider: "redis",
|
|
1363
1388
|
},
|
|
1364
1389
|
},
|
|
1365
1390
|
// ...
|
|
1366
1391
|
},
|
|
1367
1392
|
// ...
|
|
1368
|
-
})
|
|
1393
|
+
});
|
|
1369
1394
|
```
|
|
1370
1395
|
|
|
1371
1396
|
- _Current Unified Storage Approach (`nuxt.config.ts`):_
|
|
@@ -1379,13 +1404,13 @@
|
|
|
1379
1404
|
// ...
|
|
1380
1405
|
storage: {
|
|
1381
1406
|
cache: {
|
|
1382
|
-
driver:
|
|
1383
|
-
host:
|
|
1407
|
+
driver: "redis",
|
|
1408
|
+
host: "localhost",
|
|
1384
1409
|
port: 6379,
|
|
1385
1410
|
},
|
|
1386
1411
|
session: {
|
|
1387
|
-
driver:
|
|
1388
|
-
host:
|
|
1412
|
+
driver: "redis",
|
|
1413
|
+
host: "localhost",
|
|
1389
1414
|
port: 6379,
|
|
1390
1415
|
},
|
|
1391
1416
|
// ...
|
|
@@ -1395,7 +1420,7 @@
|
|
|
1395
1420
|
// ...
|
|
1396
1421
|
},
|
|
1397
1422
|
// ...
|
|
1398
|
-
})
|
|
1423
|
+
});
|
|
1399
1424
|
```
|
|
1400
1425
|
|
|
1401
1426
|
- **\[๐ฅ BREAKING\]** The composable `useSearch` has been replaced by `useStorefrontSearch`, consolidating and transitioning to SCAYLE Search v2.
|
|
@@ -1462,9 +1487,9 @@
|
|
|
1462
1487
|
|
|
1463
1488
|
```ts
|
|
1464
1489
|
const { activeFilters, applyFilters, resetFilterUrl, productConditions } =
|
|
1465
|
-
useQueryFilterState()
|
|
1490
|
+
useQueryFilterState();
|
|
1466
1491
|
|
|
1467
|
-
applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 })
|
|
1492
|
+
applyFilters({ brand: 23, sale: true, maxPrice: 100, minPrice: 0 });
|
|
1468
1493
|
```
|
|
1469
1494
|
|
|
1470
1495
|
- _Current Usage of `useFilter` and `useAppliedFilters`:_
|
|
@@ -1477,20 +1502,20 @@
|
|
|
1477
1502
|
resetFilters,
|
|
1478
1503
|
resetPriceFilter,
|
|
1479
1504
|
resetFilter,
|
|
1480
|
-
} = useFilter()
|
|
1505
|
+
} = useFilter();
|
|
1481
1506
|
|
|
1482
|
-
applyPriceFilter([0, 100])
|
|
1483
|
-
applyBooleanFilter(
|
|
1484
|
-
applyAttributeFilter(
|
|
1507
|
+
applyPriceFilter([0, 100]);
|
|
1508
|
+
applyBooleanFilter("sale", true);
|
|
1509
|
+
applyAttributeFilter("brand", 23);
|
|
1485
1510
|
|
|
1486
|
-
const route = useRoute()
|
|
1511
|
+
const route = useRoute();
|
|
1487
1512
|
const {
|
|
1488
1513
|
appliedFilter,
|
|
1489
1514
|
appliedFiltersCount,
|
|
1490
1515
|
appliedAttributeValues,
|
|
1491
1516
|
appliedBooleanValues,
|
|
1492
1517
|
areFiltersApplied,
|
|
1493
|
-
} = useAppliedFilters(route)
|
|
1518
|
+
} = useAppliedFilters(route);
|
|
1494
1519
|
```
|
|
1495
1520
|
|
|
1496
1521
|
- **\[๐ฅ BREAKING\]** The `getBadgeLabel` helper function has been removed, giving you more control over badge label display.
|
|
@@ -1500,43 +1525,43 @@
|
|
|
1500
1525
|
|
|
1501
1526
|
```ts
|
|
1502
1527
|
const BadgeLabel = {
|
|
1503
|
-
NEW:
|
|
1504
|
-
SOLD_OUT:
|
|
1505
|
-
ONLINE_EXCLUSIVE:
|
|
1506
|
-
SUSTAINABLE:
|
|
1507
|
-
PREMIUM:
|
|
1508
|
-
DEFAULT:
|
|
1509
|
-
} as const
|
|
1528
|
+
NEW: "new",
|
|
1529
|
+
SOLD_OUT: "sold_out",
|
|
1530
|
+
ONLINE_EXCLUSIVE: "online_exclusive",
|
|
1531
|
+
SUSTAINABLE: "sustainable",
|
|
1532
|
+
PREMIUM: "premium",
|
|
1533
|
+
DEFAULT: "",
|
|
1534
|
+
} as const;
|
|
1510
1535
|
|
|
1511
1536
|
type BadgeLabelParamsKeys =
|
|
1512
|
-
|
|
|
1513
|
-
|
|
|
1514
|
-
|
|
|
1515
|
-
|
|
|
1516
|
-
|
|
|
1517
|
-
type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean
|
|
1537
|
+
| "isNew"
|
|
1538
|
+
| "isSoldOut"
|
|
1539
|
+
| "isOnlineOnly"
|
|
1540
|
+
| "isSustainable"
|
|
1541
|
+
| "isPremium";
|
|
1542
|
+
type BadgeLabelParams = Partial<Record<BadgeLabelParamsKeys, boolean>>;
|
|
1518
1543
|
|
|
1519
1544
|
const getBadgeLabel = (params: BadgeLabelParams = {}): string => {
|
|
1520
1545
|
if (!params) {
|
|
1521
|
-
return BadgeLabel.DEFAULT
|
|
1546
|
+
return BadgeLabel.DEFAULT;
|
|
1522
1547
|
}
|
|
1523
1548
|
const { isNew, isSoldOut, isOnlineOnly, isSustainable, isPremium } =
|
|
1524
|
-
params
|
|
1549
|
+
params;
|
|
1525
1550
|
|
|
1526
1551
|
if (isNew) {
|
|
1527
|
-
return BadgeLabel.NEW
|
|
1552
|
+
return BadgeLabel.NEW;
|
|
1528
1553
|
} else if (isSoldOut) {
|
|
1529
|
-
return BadgeLabel.SOLD_OUT
|
|
1554
|
+
return BadgeLabel.SOLD_OUT;
|
|
1530
1555
|
} else if (isOnlineOnly) {
|
|
1531
|
-
return BadgeLabel.ONLINE_EXCLUSIVE
|
|
1556
|
+
return BadgeLabel.ONLINE_EXCLUSIVE;
|
|
1532
1557
|
} else if (isSustainable) {
|
|
1533
|
-
return BadgeLabel.SUSTAINABLE
|
|
1558
|
+
return BadgeLabel.SUSTAINABLE;
|
|
1534
1559
|
} else if (isPremium) {
|
|
1535
|
-
return BadgeLabel.PREMIUM
|
|
1560
|
+
return BadgeLabel.PREMIUM;
|
|
1536
1561
|
} else {
|
|
1537
|
-
return BadgeLabel.DEFAULT
|
|
1562
|
+
return BadgeLabel.DEFAULT;
|
|
1538
1563
|
}
|
|
1539
|
-
}
|
|
1564
|
+
};
|
|
1540
1565
|
```
|
|
1541
1566
|
|
|
1542
1567
|
- **\[๐ฅ 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 +1585,7 @@
|
|
|
1560
1585
|
// ...
|
|
1561
1586
|
},
|
|
1562
1587
|
// ...
|
|
1563
|
-
})
|
|
1588
|
+
});
|
|
1564
1589
|
```
|
|
1565
1590
|
|
|
1566
1591
|
- _Previous Environment Variables for Store Configuration:_
|
|
@@ -1589,7 +1614,7 @@
|
|
|
1589
1614
|
// ...
|
|
1590
1615
|
},
|
|
1591
1616
|
// ...
|
|
1592
|
-
})
|
|
1617
|
+
});
|
|
1593
1618
|
```
|
|
1594
1619
|
|
|
1595
1620
|
- _Current Environment Variables for Shops Configuration:_
|
|
@@ -1609,8 +1634,8 @@
|
|
|
1609
1634
|
```ts
|
|
1610
1635
|
useProduct({
|
|
1611
1636
|
// ...
|
|
1612
|
-
key:
|
|
1613
|
-
})
|
|
1637
|
+
key: "productKey",
|
|
1638
|
+
});
|
|
1614
1639
|
```
|
|
1615
1640
|
|
|
1616
1641
|
- _Current `key` as dedicated composables argument:_
|
|
@@ -1620,8 +1645,8 @@
|
|
|
1620
1645
|
{
|
|
1621
1646
|
// ...
|
|
1622
1647
|
},
|
|
1623
|
-
|
|
1624
|
-
)
|
|
1648
|
+
"productKey",
|
|
1649
|
+
);
|
|
1625
1650
|
```
|
|
1626
1651
|
|
|
1627
1652
|
- **\[๐ฅ 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 +1663,27 @@
|
|
|
1638
1663
|
- _Previous Usage of `handleIDPLoginCallback`:_
|
|
1639
1664
|
|
|
1640
1665
|
```ts
|
|
1641
|
-
const { handleIDPLoginCallback } = await useIDP()
|
|
1666
|
+
const { handleIDPLoginCallback } = await useIDP();
|
|
1642
1667
|
|
|
1643
1668
|
watch(
|
|
1644
1669
|
() => route.query,
|
|
1645
1670
|
async (query) => {
|
|
1646
1671
|
if (query.code && isString(query.code)) {
|
|
1647
|
-
await handleIDPLoginCallback(query.code)
|
|
1672
|
+
await handleIDPLoginCallback(query.code);
|
|
1648
1673
|
}
|
|
1649
1674
|
},
|
|
1650
1675
|
{ immediate: true },
|
|
1651
|
-
)
|
|
1676
|
+
);
|
|
1652
1677
|
```
|
|
1653
1678
|
|
|
1654
1679
|
- _Current Usage of `loginIDP`:_
|
|
1655
1680
|
|
|
1656
1681
|
```ts
|
|
1657
|
-
const { loginIDP } = useAuthentication(
|
|
1682
|
+
const { loginIDP } = useAuthentication("login");
|
|
1658
1683
|
|
|
1659
1684
|
onMounted(async () => {
|
|
1660
|
-
await loginIDP(props.code)
|
|
1661
|
-
})
|
|
1685
|
+
await loginIDP(props.code);
|
|
1686
|
+
});
|
|
1662
1687
|
```
|
|
1663
1688
|
|
|
1664
1689
|
- **\[๐งน 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 +1693,17 @@
|
|
|
1668
1693
|
- _Previous `useRpc` with `autoFetch`:_
|
|
1669
1694
|
|
|
1670
1695
|
```ts
|
|
1671
|
-
useRpc(
|
|
1696
|
+
useRpc("rpcMethod", key, params, { autoFetch: true });
|
|
1672
1697
|
|
|
1673
|
-
useUser({ autoFetch: true })
|
|
1698
|
+
useUser({ autoFetch: true });
|
|
1674
1699
|
```
|
|
1675
1700
|
|
|
1676
1701
|
- _Current `useRpc` with `immediate`:_
|
|
1677
1702
|
|
|
1678
1703
|
```ts
|
|
1679
|
-
useRpc(
|
|
1704
|
+
useRpc("rpcMethod", key, params, { immediate: true });
|
|
1680
1705
|
|
|
1681
|
-
useUser({ immediate: true })
|
|
1706
|
+
useUser({ immediate: true });
|
|
1682
1707
|
```
|
|
1683
1708
|
|
|
1684
1709
|
- **\[๐ฅ BREAKING\]** The attribute `isCmsPreview` has been removed from `RpcContext`.
|
|
@@ -1698,18 +1723,18 @@
|
|
|
1698
1723
|
getSearchSuggestions,
|
|
1699
1724
|
fetching,
|
|
1700
1725
|
...searchData
|
|
1701
|
-
} = useStorefrontSearch(searchQuery, { key })
|
|
1726
|
+
} = useStorefrontSearch(searchQuery, { key });
|
|
1702
1727
|
|
|
1703
|
-
fetching.value // true or false
|
|
1728
|
+
fetching.value; // true or false
|
|
1704
1729
|
```
|
|
1705
1730
|
|
|
1706
1731
|
- _Current `useStorefrontSearch` returning `status`:_
|
|
1707
1732
|
|
|
1708
1733
|
```ts
|
|
1709
1734
|
const { data, resolveSearch, getSearchSuggestions, status, ...searchData } =
|
|
1710
|
-
useStorefrontSearch(searchQuery, {}, key)
|
|
1735
|
+
useStorefrontSearch(searchQuery, {}, key);
|
|
1711
1736
|
|
|
1712
|
-
status.value // 'idle', 'pending', 'error' or 'success'
|
|
1737
|
+
status.value; // 'idle', 'pending', 'error' or 'success'
|
|
1713
1738
|
```
|
|
1714
1739
|
|
|
1715
1740
|
- **\[๐ฅ 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 +1759,7 @@
|
|
|
1734
1759
|
// ...
|
|
1735
1760
|
},
|
|
1736
1761
|
// ...
|
|
1737
|
-
})
|
|
1762
|
+
});
|
|
1738
1763
|
```
|
|
1739
1764
|
|
|
1740
1765
|
- _Current `enableDefaultGetCachedDataOverride`in `nuxt.config.ts`:_
|
|
@@ -1759,7 +1784,7 @@
|
|
|
1759
1784
|
// ...
|
|
1760
1785
|
},
|
|
1761
1786
|
// ...
|
|
1762
|
-
})
|
|
1787
|
+
});
|
|
1763
1788
|
```
|
|
1764
1789
|
|
|
1765
1790
|
- **\[๐ฅ 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 +1806,7 @@
|
|
|
1781
1806
|
function myCustomRpc() {
|
|
1782
1807
|
// ...
|
|
1783
1808
|
|
|
1784
|
-
throw new BaseError(404)
|
|
1809
|
+
throw new BaseError(404);
|
|
1785
1810
|
}
|
|
1786
1811
|
```
|
|
1787
1812
|
|
|
@@ -1791,7 +1816,7 @@
|
|
|
1791
1816
|
function myCustomRpc() {
|
|
1792
1817
|
// ...
|
|
1793
1818
|
|
|
1794
|
-
return new Response(null, { status: 404 })
|
|
1819
|
+
return new Response(null, { status: 404 });
|
|
1795
1820
|
}
|
|
1796
1821
|
```
|
|
1797
1822
|
|
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.1",
|
|
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.1",
|
|
68
68
|
"@scayle/unstorage-compression-driver": "^1.0.0",
|
|
69
69
|
"@vercel/nft": "0.29.4",
|
|
70
70
|
"@vueuse/core": "13.4.0",
|
|
@@ -86,19 +86,19 @@
|
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@arethetypeswrong/cli": "0.18.2",
|
|
88
88
|
"@eslint/eslintrc": "3.3.1",
|
|
89
|
-
"@nuxt/eslint": "1.
|
|
89
|
+
"@nuxt/eslint": "1.5.0",
|
|
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",
|