github medusajs/medusa v2.12.2
v2.12.2: Experimental backend HMR and granular queue configurations

12 hours ago

Highlights

Granular queue configurations

This release adds support for configuring the queue and workers of the Redis Workflow Engine (@medusajs/workflow-engine-redis). You can pass any options supported by BullMQ, e.g. concurrency, in the options of the module.

Here's an example configuration:

module.exports = defineConfig({
  modules: [
    {
      resolve: "@medusajs/workflow-engine-redis",
      options: {
        queueOptions: { defaultJobOptions: { removeOnComplete: 1000 } },
        workerOptions: { concurrency: 10 }
      },
    },
})

Core multi-language infrastructure

This release adds the core foundation for multi-language support. We expect to have a first testable preview version some time next week.

The scope of the first release is aimed to solve the following:

  • Allow merchants to configure multiple locales for their store
  • Allow merchants to add translations for entities in the Product Module
  • Allow storefront developers to easily retrieve localized products
  • Use translated product data in the cart and order flows, e.g. add item to cart

Although, the first release is only focused on the product-related entities, we have built the infrastructure to enable translations of any entity (core and custom). More on this later.

Backend HMR (experimental)

This release introduces experimental Hot Module Replacement (HMR) for our backend to improve the local development experience. In its current state, this feature is a work-in-progress and should be used with caution.

So far, we have added HMR support for the following files and tools:

  • API Routes (and middlewares)
  • Workflows & Steps
  • Scheduled Jobs
  • Event Subscribers
  • Modules

As well as regular files, such as types and utilities.

When HMR cannot handle a change, we fallback to restarting the server completely.

You can read more about the architecture and key features here: #14074

How to enable it
The feature is behind a feature flag. Enable it by setting:

  // medusa-config.ts
  module.exports = defineConfig({
    featureFlags: {
      backend_hmr: true
    }
  })

Features

  • feat(dashboard): Improve fully refunded order details by @NicolasGorga in #14077
  • feat(): Introduce translation module and preliminary application of them by @adrien2p in #14189
  • feat(): sync cart translation synced by @adrien2p in #14226
  • chore(): Add translations/locale integration tests and fix locale endpoint by @adrien2p in #14266
  • feat(): Pluralized props for list readonly link by @adrien2p in #14190

Bugs

  • chore(): revert route loading parallelization by @adrien2p in #14204
  • fix S3 URL escaping by @peterlgh7 in #14220
  • fix(dashboard): show correct color indicators for payment and fulfillment status columns for view_configuration feature flag by @NicolasGorga in #14215
  • fix(core-flows): refresh payment collection inside updateCartPromotionsWorkflow by @NicolasGorga in #13963
  • fix(dashboard): avoid unnecessary product relations to be returned by default by @NicolasGorga in #14175
  • fix(utils): fix error when generating migrations for a module with existing snapshot by @shahednasser in #14218
  • fix(medusa): use customer query config on delete address route by @NicolasGorga in #14238
  • fix(dashboard,order): preview pending diff summary by @fPolic in #14221
  • fix(dashboard): pass prefix to useDataTable to fix product list not paginating by @NicolasGorga in #14232
  • fix(core-flows): Access orderItem.variant safely inside convertDraftOrderWorkflow when containing custom items by @NicolasGorga in #14233
  • fix(utils): avoid inflating refundable_total for tax inclusive pricing by @NicolasGorga in #14237
  • chore(): Upgrade validator patched version by @adrien2p in #14254
  • fix(): Improve store supported locale -> locale readonly link by @adrien2p in #14269
  • fix(utils,core-flows): add events constant for translations and use it in workflows by @shahednasser in #14277
  • fix(core-flows): refresh payment collection inside updateCartPromotionsWorkflow (patch) by @NicolasGorga in #14274

Documentation

Chores

  • chore(docs): Update version in documentation (automated) by @github-actions[bot] in #14198
  • chore(docs): Updated API Reference (automated) by @github-actions[bot] in #14200
  • chore: configurable database migration in concurrency by @carlos-r-l-rodrigues in #14004
  • chore(): Run some commands in server mode only by @adrien2p in #14202
  • chore(event-bus, workflow-engine): Enable more granualar queues configuration by @adrien2p in #14201
  • Add js-sdk to resolutions in local development section by @NicolasGorga in #14197
  • chore: improvements of TSDocs of link steps by @shahednasser in #14261
  • chore(): Move event bus local logging by @adrien2p in #14244
  • chore(): Accept an extra agument 'all-or-nothing' on the migrate command by @adrien2p in #14262
  • chore(order): Remove unique index on item_id:version for order_item by @NicolasGorga in #14268
  • chore: Add locks to order edit flows by @olivermrbl in #14270

Other Changes

Full Changelog: v2.12.1...v2.12.2

Don't miss a new medusa release

NewReleases is sending notifications on new releases.