vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.59k stars 2.08k forks source link

refactor: use closure to create multistore extension #7026

Closed WojtekTheWebDev closed 7 months ago

WojtekTheWebDev commented 8 months ago

πŸ”— Linked issue

❓ Type of change

πŸ“š Description

[CHANGED] We standardized the way of creating and configuring multistore extension. Previously, the extension was created by importing multistoreExtension from @vue-storefront/multistore and passing it to the extensions function. Configuration was passed to the extension by adding multistore property to the configuration object. Now, the extension is created by calling createMultistoreExtension from @vue-storefront/multistore and passing the multistore configuration to it.

- import { multistoreExtension } from "@vue-storefront/multistore";
+ import { createMultistoreExtension } from "@vue-storefront/multistore";
import { multistoreConfig } from "./multistore.config";

export default {
  integrations: {
    sapcc: {
      location: "@vue-storefront/sapcc-api/server",
      configuration: {
        // ...
-        multistore: multistoreConfig,
      },
      extensions: (predefinedExtensions) => [
        ...predefinedExtensions,
-        multistoreExtension,
+        createMultistoreExtension(multistoreConfig),
      ],
    },
  },
};

πŸ“ Checklist

changeset-bot[bot] commented 8 months ago

πŸ¦‹ Changeset detected

Latest commit: af36087308dcda666c150b23a0dd4c848f12e3da

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------------------- | ----- | | @vue-storefront/multistore | Major |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR