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

feat(modules-sdk): Module as singleton instances #4065

Merged
merged 8 commits into from
May 18, 2023

Conversation

carlos-r-l-rodrigues
Copy link
Contributor

What:
Medusa module's instance is initialized only once

At the moment only one instance per module is allowed, in the future if we need multiple instances of the same service we can hash the declaration property of the method to identify them.

@carlos-r-l-rodrigues carlos-r-l-rodrigues requested a review from a team as a code owner May 10, 2023 11:54
@changeset-bot
Copy link

changeset-bot bot commented May 10, 2023

🦋 Changeset detected

Latest commit: e0eac8c

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

This PR includes changesets to release 18 packages
Name Type
@medusajs/modules-sdk Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/inventory Patch
medusa-plugin-algolia Patch
@medusajs/medusa Patch
@medusajs/stock-location Patch
@medusajs/admin-ui Patch
@medusajs/admin Patch
@medusajs/medusa-js Patch
medusa-payment-paypal Patch
medusa-payment-stripe Patch
medusa-plugin-restock-notification Patch
medusa-react Patch
@medusajs/medusa-oas-cli Patch
@medusajs/oas-github-ci Patch

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

@vercel
Copy link

vercel bot commented May 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2023 7:48am

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

LGTM, should we add some test along it?

Copy link
Contributor

@fPolic fPolic left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@olivermrbl olivermrbl left a comment

Choose a reason for hiding this comment

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

LGTM, with minor comments :)

@olivermrbl olivermrbl changed the title chore: module as singleton instances feat(modules-sdk): Module as singleton instances May 18, 2023
@olivermrbl olivermrbl merged commit e73c3e5 into develop May 18, 2023
@olivermrbl olivermrbl deleted the feat/modules-sdk-singleton branch May 18, 2023 08:12
This was referenced May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants