Change log: @vue-storefront/nuxt
6.1.0ri:link
Minor Changesri:link
- CHANGED
defaultMethodsRequestConfig
, so thegetCategory
, andgetPage
methods will useGET
request as a default.
6.0.2ri:link
Patch Changesri:link
- CHANGED the package
@vue-storefront/sdk
is now a peer dependency instead of dependency
6.0.1ri:link
Patch Changesri:link
FIXED Removed backquote from defineSdkConfig.template
6.0.0ri:link
Major Changesri:link
- BREAKING: Added functionality that automatically configures the proper URLs for SSR & SPA modes when mutlistore mode is enabled. Left your environment variables like in normal mode, just set
NUXT_PUBLIC_ALOKAI_MULTISTORE_ENABLED
totrue
.
5.0.0ri:link
Major Changesri:link
- ADDED global state management with Pinia. This will allow you to keep your global state in a more organized way. It shares the data about:
- cart
- customer
- currency
- locale
This change will require you to refactor your composables to make use of the introduced state manager. As this is only a state management, you will still need to use the composables to fetch the data and put it into the state.
Every part of global state can now be used as refs so reading and writing to them is more straightforward.
Example of usage:
<template>
<div>
<p>Cart total: {{ cart.total }}</p>
<p>Customer name: {{ customer.firstName }} {{ customer.lastName }}</p>
<p>Currency: {{ currency }}</p>
<p>Locale: {{ locale }}</p>
</div>
</template>
<script setup>
const { cart, customer, currency, currencies, locale, locales } =
storeToRefs(useSfState());
// updating the currency state
currency.value = "USD";
// updating the cart state
onMounted(async () => {
cart.value = await useSdk().unified.getCart();
});
</script>
- BREAKING CHANGED module configKey is changed from
vsf
toalokai
. Also, the support for thevsf
key in Runtime Envs has been changed toalokai
.
meta: {
name: "@vue-storefront/nuxt",
- configKey: "vsf",
+ configKey: "alokai",
compatibility: {
nuxt: "^3.0.0",
},
nuxt.options.runtimeConfig.public.alokai = defu(
- nuxt.options.runtimeConfig.public?.vsf as any,
+ nuxt.options.runtimeConfig.public?.alokai as any,
options
);
Patch Changesri:link
- Updated dependencies:
- @vue-storefront/sdk@3.2.0
4.1.1ri:link
Patch Changesri:link
FIXED: Added getCurrencies unified endpoint to be fetch by HTTP GET. This change enable caching this endpoint on CDN.
4.1.0ri:link
Minor Changesri:link
ADDED: Using the GIT_SHA
environment variable as secondary input for cdnCacheBustingId
option. You can still override this value through NUXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID
.
ADDED Value of Busting ID for CDN Cache. You can access it via config.cdnCacheBustingId
.
CHANGED Deprecated middlewareUrl
in defineSdkConfig
context. Use config.middlewareUrl
instead.
CHANGED Deprecated defaults
in defineSdkConfig
context. Use config.defaultMethodsRequestConfig
instead.
CHANGED Depreacted vsf
key in RuntimeConfig. Use alokai
instead. You should change you environment variables. Example: Change from NUXT_PUBLIC_VSF_MIDDLEWARE_API_URL
to NUXT_PUBLIC_ALOKAI_MIDDLEWARE_API_URL
.
CHANGED Internal naming changed from VSF to Alokai. For e.g. we inject the SDK into the $alokai
key in Nuxt App instead of $vsf
as in previous versions.
4.0.1ri:link
Patch Changesri:link
- CHANGED shared package wasn't being bundled with the release of the package
4.0.0ri:link
Major Changesri:link
- CHANGED Updated core sdk dependency to latest version
- ADDED Added .config parameter in createSdk callback
Patch Changesri:link
- Updated dependencies:
- @vue-storefront/sdk@3.1.0
3.1.1ri:link
Patch Changesri:link
- FIXED Using the runtime config is now working properly. You can use
NUXT_PUBLIC_VSF_MIDDLEWARE_API_URL
,NUXT_PUBLIC_VSF_MIDDLEWARE_SSR_API_URL
andNUXT_PUBLIC_VSF_MULTISTORE_ENABLED
environments variables to define config in the runtime.
3.1.0ri:link
- ADDED
middlewareModule
todefineSdkConfig
params.
- import { UnifiedApiExtension } from "storefront-middleware/types"
+ import { UnifiedEndpoints } from "storefront-middleware/types"
export default defineSdkConfig(
- ({ buildModule, middlewareUrl, getRequestHeaders }) => ({
- commerce: buildModule(unifiedModule<UnifiedApiExtension>, {
- apiUrl: `${middlewareUrl}/commerce`,
- requestOptions: { headers: getRequestHeaders },
+ ({ buildModule, middlewareModule, middlewareUrl, getRequestHeaders }) => ({
+ commerce: buildModule(middlewareModule<UnifiedEndpoints>, {
+ apiUrl: `${middlewareUrl}/commerce`,
+ defaultRequestConfig: { headers: getRequestHeaders() },
}),
})
);
- CHANGED deprecate
getCookieHeader
, usegetRequestHeaders
instead
export default defineSdkConfig(
- ({ buildModule, middlewareModule, middlewareUrl, getCookieHeader }) => ({
+ ({ buildModule, middlewareModule, middlewareUrl, getRequestHeaders }) => ({
commerce: buildModule(middlewareModule<UnifiedEndpoints>, {
apiUrl: `${middlewareUrl}/commerce`,
- defaultRequestConfig: { headers: getCookieHeader() }, // Only cookie header is included.
+ defaultRequestConfig: { headers: getRequestHeaders() }, // All headers are included.
}),
})
);
3.0.3ri:link
- CHANGED
@nuxt/kit
locked3.7.4
version to@nuxt/kit@^3.7.4
3.0.2ri:link
- FIXED Multi-store URL calculation, now working correctly in the browser.
3.0.1ri:link
- CHANGED Set
@vue-storefront/sdk
as a dependency instead of a peer dependency
3.0.0ri:link
- BREAKING Rewritten from scratch. Now the package exports a Nuxt module which allows to initialize the Vue Storefront SDK.