Highlights
Improved Stripe plugin architecture + webhook
🚧 Breaking change in
medusa-plugin-stripe
Two important changes have been introduced to the Stripe plugin, one of which is breaking.
The endpoints and subscribers in the plugin have been migrated to use our new API Routes and Subscribers. This significantly lowers the code footprint of the package and makes it easier to maintain.
The webhook event management has changed significantly from in-band processing of the event to now using our Event Bus to process it as a background job. There were several motivations for this change: 1) it is deemed best practice to respond with a 200 immediately upon receiving a webhook request, 2) it allows for our retry mechanism to kick in in case the processing fails, and 3) it gives us more control of how the event is processed.
One example of the latter, effective from this release, is that we've added a 5s delay on processing events to avoid conflicts stemming from race conditions between the webhook and client requests.
Changed service checks from an instance of
to a static property check
🚧 Breaking change
Several issues have been filed related to failing registrations of different types of services, such as payment providers, fulfillment providers, and similar. The culprit to these issues was found in how we check the type of the service class.
Until now, we've relied on instance of
to perform the check:
export function isPaymentProcessor(obj: unknown): boolean {
return obj instanceof AbstractPaymentProcessor
}
However, if you have a version mismatch in your packages, the instance of
check will fail even though the services are seemingly the expected type.
With this release, the service class type checks are now performed with static properties to eliminate this issue:
static isPaymentProcessor(object): boolean {
return object?.constructor?._isPaymentProcessor
}
More robust and reliable cart completion
🚧 Important change
Our cart completion API has been updated to increase robustness and reliability - especially under high load. The update includes removing serializable transactions from the API and generally refactoring our transaction management.
As a positive side effect, the changes have also made for a more performant API.
Database schema changes
Minor changes to the schema of table publishable_api_key_sales_channel
have been introduced.
Please, apply the new migration by running the following command in your Medusa project after having updated:
npx @medusajs/medusa-cli migrations run
order by
queries on deeply nested relations
An issue with duplicated rows in the result set in order by
queries on deeply nested relations has been resolved.
Read more about the change in the PR description.
API reference for medusa-react
An API reference and examples for our medusa-react
library have been introduced to our documentation.
Admin translations
With this release, the following languages are supported in Medusa Admin: Simplified Chinese, Bulgarian, Slovenian, Czech, and Japanese.
Features
- feat(medusa): add currency to region responses by @riqwan in #5857
- feat(medusa): Update shipping option price type by @pKorsholm in #5895
- feat(medusa, link-modules): sales channel <> product module link by @fPolic in #5450
- feat(admin): Added Simplified Chinese support by @chrislaai in #5798
- feat(admin): Bulgarian language support by @edisaso in #5786
- feat(medusa): Slovenian(sl) translation by @glomon in #5828
- feat(workflows-sdk): Configurable retries upon step creation by @adrien2p in #5728
- feat(medusa): Prevent cart completion conflict by @adrien2p in #5814
- feat(admin): Add Czech language support by @hexrw in #5822
- feat(admin): Add Japanese language support by @hmmhmmhm in #5795
- feat(medusa-payment-stripe): Add delay to Stripe webhook by @olivermrbl in #5838
- feat(orchestration, workflows-sdk): Add events management and implementation to manage async workflows by @adrien2p in #5951
- feat(medusa, link-modules): sales channel <> pubkey link by @fPolic in #5820
- feat(pricing, types, utils): Soft delete pricing entities by @pKorsholm in #5858
- feat(medusa, link-modules): sales channel <> order link by @fPolic in #5810
- feat(types,utils): added promotion create with rules and application target rules by @riqwan in #5957
- feat(cart): Add cart module package by @olivermrbl in #5982
- Feat(medusa-test-utils, utils, pricing, product, link-modules): upgrade mikro orm version to latest by @pKorsholm in #5985
- feat(medusa, link-modules): sales channel <> cart link by @fPolic in #5459
- feat(workflows-sdk): Allow primitive values to be passed as well as WorkflowDataProperties by @adrien2p in #5953
- feat(types,utils): add promotions create with application method by @riqwan in #5945
- feat(workflows-sdk): Allow a step to not define an expected input by @adrien2p in #5775
- feat(types,modules-sdk): basic module setup for promotions by @riqwan in #5920
- feat(types,module-sdk): setup authentication module skeleton by @pKorsholm in #5943
- feat(types): promotion delete / update / retrieve / add/remove-rules by @riqwan in #5988
- feat(cart): Data models by @olivermrbl in #5986
- feat(admin): Add Libya admin region and set Libya to formal name by @abusaidm in #6001
- feat(authentication): Load auth providers by @pKorsholm in #6023
Bugs
- fix: redis_options for job scheduler by @kstoklosa in #5894
- fix(medusa): Passport loader resolving to early by @adrien2p in #5901
- fix: Typo in documentation by @aldo-roman in #5933
- fix(medusa, medusa-js): publishable api key bugs by @olivermrbl in #5926
- fix(medusa, pricing, types): pass dates as Date-objects rather than strings to the pricing module by @pKorsholm in #5768
- fix(utils): More resilient object from string path by @adrien2p in #5929
- fix(medusa-js): remove unnecessary
query
field inAdminInventoryItemsResource.deleteLocationLevel
method by @shahednasser in #5941 - fix(medusa): add payments default relation to getTotalsRelations by @cyf0e in #5875
- fix(medusa): Resolve babel executable with
npx
by @olivermrbl in #5952 - fix(medusa): Update cart sales channel should not remove all line items by @adrien2p in #5980
- fix(medusa-payment-stripe): fix error handling by @adrien2p in #5991
- fix(medusa): cart completion payment sessions by @adrien2p in #5995
- fix(medusa): Ordering management using joins and pagination by @adrien2p in #5990
- fix(medusa): Fix typo in discounts error message by @Sajarin-M in #5853
- fix(medusa-payment-stripe): change webhook environment variables to plugin options by@shahednasser in #6034
Chores
- chore(medusa, interfaces): Uniformise class checks by @adrien2p in #5869
- chore: refactored docs-util by @shahednasser in #5876
- chore(workflows): Use Node 16.14 in CLI workflow by @olivermrbl in #5993
- chore: move next admin packages to core repo by @kasperkristensen in #5983
- chore: add vercel config by @kasperkristensen in #6018
- chore(medusa, orchestration, utils, workflows-sdk): add transaction options support and cleanup by @adrien2p in #6020
- chore(docs-util): update typedoc to v0.25.7 by @shahednasser in #6032
Documentation
- docs: updates for v1.19 by @shahednasser in #5868
- docs: update docs changes for rules_count from number_rules by @riqwan in #5855
- docs: Add discount created event by @Arsenalist in #5850
- docs: fix upgrade guide release notes link by @shahednasser in #5879
- docs: update documentation websites by @shahednasser in #5882
- docs: added missing service method in digital products recipe by @shahednasser in #5899
- docs: updated digital ocean spaces guide by @shahednasser in #5900
- docs: update Railway pricing info in deploy guide by @dinesh-58 in #5908
- docs: fix wishlist route by @shahednasser in #5914
- docs: add TSDoc for payment processor + generate docs by @shahednasser in #5917
- docs: set rejectUnauthorized based on condition by @dinesh-58 in #5907
- docs: fix medusa-react guide + specify react-query version by @shahednasser in #5918
- docs: Update minimum node version requirement by @olivermrbl in #5994
- docs: generate medusa-react reference by @shahednasser in #6004
- docs: rename
EVENT_REDIS_URL
by @dinesh-58 in #5948 - docs: fix file name for scheduled jobs by @shahednasser in #5972
- docs: Update create.md by @minhtungo in #5978
- docs: fixes to digital products recipe by @shahednasser in #5897
- docs; Update meilisearch.md by @pepiyu in #6026
New Contributors
- @dinesh-58 made their first contribution in #5908
- @IdekDude made their first contribution in #5823
- @edisaso made their first contribution in #5786
- @glomon made their first contribution in #5828
- @kstoklosa made their first contribution in #5894
- @hexrw made their first contribution in #5822
- @hmmhmmhm made their first contribution in #5795
- @aldo-roman made their first contribution in #5933
- @cyf0e made their first contribution in #5875
- @abusaidm made their first contribution in #6001
Full Changelog: v1.19.0...v1.20.0