@viu/emporix-sdk-react 2.13.1 → 2.14.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 +16 -0
- package/dist/{chunk-SXZCM2LE.js → chunk-7F5EB5XY.js} +510 -196
- package/dist/chunk-7F5EB5XY.js.map +1 -0
- package/dist/{chunk-4YDWCA7A.js → chunk-CZDVH3WH.js} +165 -107
- package/dist/chunk-CZDVH3WH.js.map +1 -0
- package/dist/{chunk-VMDBYVWG.js → chunk-ZNLAYNF5.js} +11 -4
- package/dist/chunk-ZNLAYNF5.js.map +1 -0
- package/dist/hooks.cjs +599 -315
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.js +185 -4
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +779 -436
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -4
- package/dist/index.d.ts +38 -4
- package/dist/index.js +240 -8
- package/dist/index.js.map +1 -1
- package/dist/provider.cjs +187 -123
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +12 -3
- package/dist/provider.js.map +1 -1
- package/dist/ssr.cjs +36 -5
- package/dist/ssr.cjs.map +1 -1
- package/dist/ssr.d.cts +22 -6
- package/dist/ssr.d.ts +22 -6
- package/dist/ssr.js +54 -1
- package/dist/ssr.js.map +1 -1
- package/dist/storage.cjs +39 -9
- package/dist/storage.cjs.map +1 -1
- package/dist/storage.d.cts +5 -1
- package/dist/storage.d.ts +5 -1
- package/dist/storage.js +15 -2
- package/dist/storage.js.map +1 -1
- package/package.json +5 -4
- package/dist/chunk-4YDWCA7A.js.map +0 -1
- package/dist/chunk-SXZCM2LE.js.map +0 -1
- package/dist/chunk-TIS4BKHK.js +0 -25
- package/dist/chunk-TIS4BKHK.js.map +0 -1
- package/dist/chunk-VMDBYVWG.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @viu/emporix-sdk-react
|
|
2
2
|
|
|
3
|
+
## 2.14.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#127](https://github.com/viuteam/emporix-sdk/pull/127) [`93e3b76`](https://github.com/viuteam/emporix-sdk/commit/93e3b76131abe9f8cdc29e010b99ddc92e575e91) Thanks [@amnael1](https://github.com/amnael1)! - default the cookie storage adapter's `Secure` attribute to on for https origins. Token cookies no longer ride plain http in production by default; localhost/http dev is unaffected (protocol-sniffed). Pass `secure: false` explicitly only for non-https deployments.
|
|
8
|
+
|
|
9
|
+
- [#125](https://github.com/viuteam/emporix-sdk/pull/125) [`c5f7a7d`](https://github.com/viuteam/emporix-sdk/commit/c5f7a7d89bdd6ac44ff92719f732fbd5d95b55ee) Thanks [@amnael1](https://github.com/amnael1)! - fix logout to purge the entire `["emporix"]` query-cache namespace. Previously only the `customer` and `cart` keys were removed, so customer-scoped caches without a user discriminator (payment modes, order lists) survived logout and could be served to the next logged-in customer straight from cache.
|
|
10
|
+
|
|
11
|
+
- [#125](https://github.com/viuteam/emporix-sdk/pull/125) [`48fed7a`](https://github.com/viuteam/emporix-sdk/commit/48fed7afccb3b7146dabfa3e7d86e384b2171689) Thanks [@amnael1](https://github.com/amnael1)! - ship a `"use client"` directive in the built client entries (`.`, `./provider`, `./hooks`, `./storage`) so they load as Client Components under the Next.js App Router without every consumer having to add their own `"use client"` wrapper file. `./ssr` stays directive-free and remains importable from Server Components — in server code, import `prefetchProduct`/`prefetchCart`/`prefetchOrder` from `@viu/emporix-sdk-react/ssr`, not from the package root.
|
|
12
|
+
|
|
13
|
+
- [#127](https://github.com/viuteam/emporix-sdk/pull/127) [`1a5e1f3`](https://github.com/viuteam/emporix-sdk/commit/1a5e1f3fb6b048b9732066ba2c02dfc871e47f3b) Thanks [@amnael1](https://github.com/amnael1)! - make auth/cart state reads reactive: all render-time `storage.getCustomerToken()`/`getCartId()` reads now go through `useSyncExternalStore`-backed snapshots. Login/logout and cart-id writes immediately re-render dependent hooks — previously `enabled` gates (e.g. `usePaymentModes`, `useMyCompanies`, order hooks) stayed stale until an unrelated re-render, and sibling components could tear under concurrent rendering. Storage adapters without `subscribe`/`subscribeAll` behave as before (non-reactive).
|
|
14
|
+
|
|
15
|
+
- [#127](https://github.com/viuteam/emporix-sdk/pull/127) [`31a8183`](https://github.com/viuteam/emporix-sdk/commit/31a8183329d17fe5247f62c9c39a74beb7a1a45e) Thanks [@amnael1](https://github.com/amnael1)! - apply the provider's balanced query defaults (`staleTime: 30s`, no focus refetch, `retry: 1`) to the `["emporix"]` namespace of any QueryClient — including consumer-supplied ones, which previously ran SDK queries with React-Query factory defaults (focus-refetch storms + retry amplification against the live tenant). The provider only fills gaps: a consumer's explicit defaults win, whether set globally (`defaultOptions.queries`) or emporix-scoped (`setQueryDefaults(["emporix"], …)`), and per-hook options always win; host-app queries outside the namespace are untouched.
|
|
16
|
+
|
|
17
|
+
- [#127](https://github.com/viuteam/emporix-sdk/pull/127) [`124532f`](https://github.com/viuteam/emporix-sdk/commit/124532fef11b1a4aadf2f80e979005b036168e1c) Thanks [@amnael1](https://github.com/amnael1)! - fix the RSC/SSR prefetch pipeline and StrictMode safety: `prefetchProduct`/`prefetchCart`/`prefetchOrder` now build their query keys through the same `emporixKey` builder the hooks use (previously the keys never matched — `siteCode`/`language`/company discriminators were missing — so hydration was always a cache miss and the client refetched); new `siteCode`/`language`/`activeCompanyId` options mirror the client context. The provider's anonymous-store wiring and `initialCustomerToken` seed now re-run when the `client`/`storage` props change and no longer execute inside `useMemo`; the fallback QueryClient is held in state (a dropped memo cache could previously discard the whole query cache). CompanyContext bootstrap is cancellation-safe under StrictMode and company switches are serialized — the token-rotating refresh can no longer double-fire with the same refresh token.
|
|
18
|
+
|
|
3
19
|
## 2.13.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|