Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use closure to create multistore extension #7026

Merged
merged 15 commits into from
Feb 15, 2024

Conversation

WojtekTheWebDev
Copy link
Collaborator

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSDoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to 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

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

changeset-bot bot commented Jan 29, 2024

πŸ¦‹ Changeset detected

Latest commit: af36087

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

@WojtekTheWebDev WojtekTheWebDev marked this pull request as draft January 29, 2024 09:10
@WojtekTheWebDev WojtekTheWebDev changed the title refactor: factory pattern to create multistore extension refactor: use closure to create multistore extension Jan 29, 2024
@WojtekTheWebDev WojtekTheWebDev requested a review from a team January 29, 2024 10:38
@WojtekTheWebDev WojtekTheWebDev changed the base branch from main to feat/unified-multi-store January 29, 2024 10:41
@WojtekTheWebDev WojtekTheWebDev marked this pull request as ready for review January 29, 2024 10:43
Copy link
Contributor

@sethidden sethidden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the nits are on code that you didn't write so feel free to just merge without addressing them

packages/multistore/package.json Show resolved Hide resolved
packages/multistore/src/extension.ts Show resolved Hide resolved
packages/multistore/src/extension.ts Outdated Show resolved Hide resolved
Base automatically changed from feat/unified-multi-store to main January 31, 2024 07:18
@sethidden sethidden requested a review from a team February 6, 2024 11:19
@WojtekTheWebDev WojtekTheWebDev merged commit 8ea533e into main Feb 15, 2024
12 checks passed
@WojtekTheWebDev WojtekTheWebDev deleted the refactor/factory-multistore branch February 15, 2024 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants