Skip to content

v1.20.0

Compare
Choose a tag to compare
@olivermrbl olivermrbl released this 09 Jan 18:05
· 913 commits to develop since this release

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 in AdminInventoryItemsResource.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

Documentation

New Contributors

Full Changelog: v1.19.0...v1.20.0