Vue Storefront is now Alokai! Learn More
Alokai Changelog

Alokai Changelog

0.1.0

Minor Changes

  • ADDED Alokai ecosystem versioning: Each release of a core package now includes a version bump for the entire ecosystem, simplifying tracking of changes and ensuring compatibility between packages. Core packages include:
    • @vue-storefront/middleware
    • @vue-storefront/multistore
    • @vue-storefront/unified-data-model
    • @vue-storefront/sdk
    • @vue-storefront/nuxt
    • @vue-storefront/next Compatibility matrix for the entire ecosystem is available here.
  • CHANGED @vue-storefront/nuxt version updated to v7.0.0.
  • CHANGED from now on getSdk is available instead of sdk property on global NuxtApp.$alokai object.
  • CHANGED You should now ensure that environment variables NEXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL (for Next.js apps) and NUXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL (for Nuxt apps) are set in your file both locally and in your deployed application.

Patch Changes

  • FIXED Nuxt App - useLazyProduct composable merged product data wrongly.
  • FIXED Nuxt App - localization plugin need to set locale cookie directly in the plugin initialization.
  • FIXED Next App - the initial page load with a locale in the URL, different from the previously set one, now correctly fetches data in the right language from the server.

Migration guide (Next.js)

The changes below are only relevant for Next apps. If you are using Next.js, you can skip this section.

  1. Set the NEXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL environment variable in your .env file.
+ NEXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL=http://localhost:4000
  1. Set the NEXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL environment variable to http://additional-app-middleware:4000 in your deployed application.
  2. Use cookies from next/headers in your getSdk function to fix the issue with the initial page load with a locale in the URL, different from the previously set one.
import {
  headers,
+  cookies,
} from 'next/headers;
import { getSdk } from './sdk.server';

// ...

getSdk({
-  getRequestHeaders: () => headers
+  getRequestHeaders: () => ({
+    headers: headers(),
+    cookies: cookies(),
+  }),
});

Migration guide (Nuxt)

The changes below are only relevant for Nuxt apps. If you are using Next.js, you can skip this section.

  1. Set the NUXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL environment variable in your .env file.
+ NUXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL=http://localhost:4000
  1. Set the NUXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL environment variable to http://additional-app-middleware:4000 in your deployed application.
  2. Modify localization plugin to set locale cookie directly in the plugin initialization.
apps/storefront-unified-nuxt/plugins/localization.ts
+ import type { Composer } from '#i18n';
// ...
- nuxtApp.hook('vue:setup', () => {
-  const { locale: i18nLocale, locales: i18nLocales } = useI18n();
+ const { locale: i18nLocale, locales: i18nLocales } = (nuxtApp as unknown as { $i18n: Composer }).$i18n;
// ...
- });
  1. Update @vue-storefront/nuxt package to v7.0.0.
- "@vue-storefront/nuxt": "6.x.x",
+ "@vue-storefront/nuxt": "7.0.0",
  1. Update the way you get the SDK instance.
// get sdk instance
- const { sdk } = useNuxtApp().$alokai;
+ const sdk = useNuxtApp().$alokai.getSdk();

// fetch some data
sdk.unified.getProducts();