Skip to content

Releases: medusajs/medusa

v1.20.9

29 Jul 11:45
Compare
Choose a tag to compare

Fixes

Full Changelog: v1.20.8...v1.20.9

v2.0.2-preview

25 Jul 15:44
eb64ae7
Compare
Choose a tag to compare

Get started with a new project

To get started using the preview release, run the following command:

npx create-medusa-app@preview

This command will create a new Medusa project with our redesigned admin and a 2.0-compatible Next.js storefront. The Medusa application and the Next.js storefront are separate projects in separate folders.

Update existing project

Ensure your Medusa dependencies in package.json are using the preview tag:

{
  "dependencies": {
    "@medusajs/medusa": "preview",
    "@medusajs/pricing": "preview",
    "@medusajs/product": "preview",
    ...
  }
}

To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:

rm -rf node_modules
rm yarn.lock // or package-lock.json

yarn // If you are using yarn berry, you need to create the lock-file first

Highlights

Migrations and Linking CLI

We have introduced new CLI commands for generating migrations and managing links between modules. The latter is used to ensure links are in sync.

To generate migrations in your module, you can run the following command:

npx medusa migrations generate <name of module>

To sync the links between modules, you can run the following command:

npx medusa links sync

In case your links are out of sync, you'll be guided through possible actions to take.

Explore our full CLI reference in our documentation.

New Middlewares API

🚧 Breaking change

We have introduced a new way of defining middlewares for API Routes. This is a breaking change.

Instead of exporting a config from middlewares.ts, you will now need to use a new utility function defineMiddlewares.

To upgrade your project, you should apply the following changes:

- import { MiddlewareConfig } from '@medusajs/medusa'
+ import { defineMiddlewares } from '@medusajs/medusa'

- export const config: MiddlewareConfig = {
-   routes: []
- }
+ export default defineMiddlewares({
+  routes: []
+ })

Read more about the new Middlewares API in our documentation.

Tax-inclusive Pricing

We have re-introduced tax-inclusive pricing. Tax-Inclusive pricing allows you to set the final prices for products and shipping options regardless of the customer's applicable tax rates. When tax-inclusive prices are used, Medusa automatically calculates the tax amount for a given price.

Read more about tax-inclusive pricing in our documentation.

Coming soon

The following are work-in-progress and will be released soon:

  • Returns, Exchanges, and Claims of Orders
  • Export and Import of Products
  • Bulk Editor improvements
  • Digital Products and Subscription Recipes

Features

Bugs

Read more

v1.20.8

18 Jul 10:29
Compare
Choose a tag to compare

Features

Bugs

  • fix(create-medusa-app): ensure the latest create-next-app version is used by @shahednasser in #7806
  • fix: remove products from product collection type in generated references by @shahednasser in #7812
  • fix: Check if the SalesChannel FF is enabled before using it on the /admin/products/:id route by @adevinwild in #8120

Documentation

Chores

New Contributors

Full Changelog: v1.20.7...v1.20.8

v2.0.1-preview

11 Jul 14:29
b5a44ef
Compare
Choose a tag to compare

Get started with new project

To get started using the preview release, run the following command:

npx create-medusa-app@preview

This command will create a new Medusa project with our redesigned admin and a 2.0-compatible Next.js storefront. The Medusa application and the Next.js storefront are separate projects in separate folders.

Update existing project

Ensure your Medusa dependencies in package.json are using the preview tag:

{
  "dependencies": {
    "@medusajs/medusa": "preview",
    "@medusajs/pricing": "preview",
    "@medusajs/product": "preview",
    ...
  }
}

To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:

rm -rf node_modules
rm yarn.lock // or package-lock.json

yarn // If you are using yarn berry, you need to create the lock-file first

Highlights

Migrations CLI

🚧 Breaking change

The migrations workflow and CLI output have changed. Here's a summary of the changes.

  • The commands remain the same as npx medusa migrations run and npx medusa migrations revert
  • The CLI output has been changed to be more visually appealing and add separate migrations logs for each module with a line break

Breaking changes

The revert command has a breaking change that it requires one or more module names to perform the revert. It means, the action revert is not valid at the global/app level. It must be executed on a specific module.

If you are developing a custom module, you can run the revert command for it as follows:

# helloWorld is the moduleName
npx medusa migrations revert helloWorld

When-then utility for conditional execution of steps in Workflows

We have added a new when-then utility to execute steps conditionally.

Here's a basic example of its usage within a workflow:

const workflow = createWorkflow("workflow", function (input) {
    
    const result = when(input, (input) => {
      return input.someConditionalData
    }).then(() => {
      const otherResult = someStep({ ... })
      return otherResult
    })

    return someOtherStep(result)
  }
)

Tax Regions UI update

The Tax Regions domain in Medusa Admin has been revamped, improving the overall UI and UX.

Features

Bugs

Documentation

Read more

v2.0.0-preview

04 Jul 16:00
94e5fee
Compare
Choose a tag to compare

Medusa 2.0 Public Preview Release

Today, we’re excited to share a Preview Release of Medusa 2.0.

The following document covers resources, guides, and things to know about the first preview release of Medusa 2.0. It will help you get started and give you a high-level overview of your new Medusa 2.0 application and what’s still to be done.

The preview release is not ready for production and is only intended for experimentation and development of new projects.

The release candidate later this year will include more fully-fledged resources for 2.0, including an overview of breaking changes, migration guides, and much more that will ensure a smoother onboarding.

We advise against upgrading your project to 2.0 at this point, as we are still working on documentating the best possible path.

These release notes are only intended to help you start and introduce you to your new Medusa 2.0 project. For a more in-depth exploration of the major upgrade, refer to our new documentation.

We are publishing this release to solicit early user and community feedback. Please file Issues for bug reports and/or submit Discussions with input or questions.

We thank you all very much in advance.


Get started

To get started using the preview release, run the following command:

npx create-medusa-app@preview

This command will create a new Medusa project with our redesigned admin and a 2.0-compatible Next.js storefront. The Medusa application and the Next.js storefront are separate projects in separate folders.

The folder structure of Medusa projects has changed:

my-project
 ├── src
 │   ├── admin
 │   ├── api
 │   ├── jobs
 │   ├── subscribers
-│   ├── services
-│   ├── models
-│   ├── migrations
-│   ├── loaders
+│   ├── modules
+│   │   └── my-module
+│   │       ├── loaders
+│   │       ├── migrations
+│   │       ├── models
+│   │       ├── index.ts
+│   │       └── service.ts
+│   ├── workflows
 └── medusa-config.ts

The modules folder replaces a lot of folders from a 1.0 project and will contain most business logic customizations in your Medusa 2.0 application. We highly encourage you to read the section of our docs covering this new concept in detail.

The workflows folder holds your custom workflows. Workflows are a fundamental concept in cross-module operations and a core element of Medusa 2.0. Read more about workflows here.

Additionally, medusa-config.js has been cleaned up and improved with a new type-safe utility function for defining the config for your Medusa project. The file can also now live as both a JS and TS file.

export default defineConfig({
  projectConfig: {
    http: {
      storeCors: "<STORE_CORS>",
      adminCors: "<ADMIN_CORS>",
      authCors: "<AUTH_CORS>"
    },
    redisUrl: "<REDIS URL>",
    databaseUrl: "<DATABASE_URL>",
  },
  admin: {
    backendUrl: "https://my-medusa-server.medusajs.app",
  },
})

You are now ready to explore all the new features in the preview release. However, we recommend reading through our documentation to fully understand what is new in 2.0 and how it differs from 1.0.

Additionally, you can find references and code snippets for our tools in our Learning Resources.


Keeping up with preview releases

We release preview versions every three hours. We recommend setting the version of your Medusa dependencies to preview, so you can regularly update without knowing specific version numbers.

All your Medusa dependencies in package.json should look something like this:

{
  "dependencies": {
    "@medusajs/medusa": "preview",
    "@medusajs/pricing": "preview",
    "@medusajs/product": "preview",
    ...
  }
}

To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:

rm -rf node_modules
rm yarn.lock // or package-lock.json

yarn // If you are using yarn berry, you need to create the lock-file first

What’s new?

Medusa 2.0 is a huge upgrade, in fact, the biggest upgrade since we open-sourced the project four years ago. The upgrade comes with many new features and improvements, some of which are still work-in-progress. In the following sections, we will briefly cover these features and the parts of the product still subject to change. A more detailed changelog will be released as part of the release candidate and, subsequently, the official release later this year.

Admin dashboard

Our admin dashboard has been completely overhauled, improving its overall look and feel to provide end-users with a more cohesive and consistent experience.

Additionally, we have migrated away from Webpack to Vite, which improves the developer experience with features like HMR and allows us and our users to tap into a rich and flourishing community and plugin ecosystem.

Read more about the admin dashboard and its extension capabilities here.

A few admin flows have yet to be built. This is primarily around returns, exchanges, claims, and order edits. We expect to finalize these in the coming weeks.

Modules architecture

Our modules foundation has been re-architected to entirely decouple modules from one another, enabling greater composability, a new standalone usage mode, and a more approachable incremental adoption of Medusa.

Read more about the architecture refactor in our 2.0 announcement from earlier this year.

New commerce features

We saw reworking the module's architecture as an opportunity to rethink the feature set of some of the business domains in Medusa 1.x. As a result, we are excited to introduce a range of advanced capabilities across a series of modules. Here are a few noteworthy improvements:

  • Stock location: Build omnichannel experiences with new stock location features, including “Buy online, pick up in-store” options.
  • Inventory: Compose multi-part variants and share inventory across products with our new inventory management features
  • Authentication: Enable authentication with external providers, such as Google, with our new authentication and user management features
  • Promotion: Create granular promotions with our new rules engine. Use conditions to create bundled discounts, buy-get, spend-get, temporary campaigns, and more

Many other modules have also seen improvements. Browse through all of them in our learning resources.

Data modeling language

A core feature of Medusa is the ability to extend the default commerce application with additional business logic to cater to a specific use case, natively integrate with third-party providers, replace existing domains, and more.

At the core of extensions in Medusa 2.0 are modules, and at the core of modules are data models. Data models define the concepts living within your application. In our commerce modules, you find orders, products, customers, promotions, etc. By introducing your own data models, you extend this semantic layer of your application, enabling you to build features and custom workflows by integrating existing and new concepts. Because data models are at the core of every customization, we decided to make them easier to work with.

We are excited to announce a new data modeling language in Medusa 2.0 that will improve the experience of defining and working with data in your application. You can read more about the new feature here.

Below is a simple example of what data models will look like in 2.0:

Long-running Workflows

We are excited to extend our existing workflow capabilities with Long-running Workflows for processing long-running operations in the background. Instead of synchronously receiving a workflow's result, Long-running Workflows are subscribed to for status changes and execution progress. Additionally, the Long-running Workflows comes with an API for programmatically moving from one step to the next. These features make Long-running Workflows a great fit for use cases that require a human-in-the-loop or operations with a varying long-running execution time.

For example, we use Long-running Workflows extensively to build the infrastructure provisioning of Medusa Cloud.

Alongside the Long-running Workflows, we are also introducing a new admin section for managing them. Here, you can see currently executing and completed workflows, providing full transparency into your long-running operations.

Medusa 2.0 comes with much more than what is highlighted in this post. We will cover everything in-depth in the official release notes.


These release notes are published as a GitHub Discussion as well for comments and questions on the preview release.

v1.20.7

11 Jun 08:06
Compare
Choose a tag to compare

Highlights

Duplicate workflow registration no longer throws

Workflows are not utilized in v1.x, however our core package comes with a few workflows for v2.0. We are currently investigating an issue with checking for duplicate workflow registrations, but we can safely remove this check in v1.x, as it will never affect users using these versions.

Isolation level in batch job subscriber

The transaction isolation level set by the batch job processing subscriber has been changed from the default "READ COMMITTED" to "REPEATABLE READ" to ensure correct data in long-running job processors.

This was always the intention, but the "REPEATABLE READ" level set in the batch job strategies was overwritten by the default level set in the subscriber calling the strategy. This happens because the subscriber initiates a transaction with the default level that is then reused within the strategies.

Bugs

Docs

Chores

New Contributors

Full Changelog: v1.20.6...v1.20.7

v1.20.6

02 May 15:53
Compare
Choose a tag to compare

Highlights

Resolves several issues in @medusajs/admin

  • Add default value for host option in @medusjs/admin.
  • Updates the version of tailwindcss, autoprefixer, and postcss in @medusajs/admin-ui, to avoid issues when importing components using tailwindcss@4.
  • Fixes an issue in @medusajs/medusa where the develop command would throw an error when @medusajs/admin was not installed.

#7203

Bugs

Full Changelog: v1.20.5...v1.20.6

v1.20.5

01 May 08:36
Compare
Choose a tag to compare

Highlights

Preview release of Medusa 2.0 next week

We recently announced Medusa 2.0, and the majority of our time and resources are currently going into making this new major a reality as soon as possible. We will reach an important milestone next week by releasing an early preview version for experimentation and exploration. More information about the preview version will be shared alongside the release.


Remove useToast hook from @medusajs/ui

🚧 Breaking change

The useToast hook has been removed. Users should instead use the toast function that is exported from the @medusajs/ui package. This function can be used to show toasts in your application. For more information on how to use the toast function, please refer to the documentation.

The Toaster component is still available but the options for the component have changed. The default position has been changed to bottom-right. For more information on the Toaster component, please refer to the documentation.

Order totals account for deleted discounts

An issue with order totals not accounting for deleted discounts has been resolved.

#6837

Resolve node-gyp installation issue in @medusajs/admin

An issue with node-gyp in a dependency of a dependency has been resolved. The solution should, for the time being, be considered temporary.

#6952

Expose backend URL for admin in local development

The forced backend URL for admin in local development has been removed in favor of a plugin configuration.

You can now specify a host value:

// medusa-config.js
const plugins = [
  ...
  {
    resolve: "@medusajs/admin",
    options: {
      // other options...
      develop: {
        port: 7000,
        host: "example.com",
      },
    },
  },
]

#7128

Features

Read more

v1.20.4

26 Mar 17:46
2524a9d
Compare
Choose a tag to compare

Highlights

Introducing Worker Mode

This release ships Worker Mode, a new runtime mode for Medusa instances.

Worker Mode allows you to start a Medusa instance in a process separate from the main application process. An instance running in Worker Mode is useful for executing long-running or resource-heavy tasks in the background. Those tasks are offloaded to a separate process and will not affect the performance of the main application. Examples of tasks are importing data or updating a search index. While Worker Mode is especially good for resource-intensive tasks, we recommend always starting an instance in this mode if possible.

Worker Mode introduces three new runtime modes for your Medusa instance:

  • server: API Routes are registered, and no workers are started.
  • worker: API Routes are not registered, and workers are started.
  • shared: API routes are registered, and workers are started (the regular runtime mode + default).

The worker mode is configured in medusa-config.js:

// medusa-config.js
const projectConfig = {
  ...,
  database_url: "...",
  worker_mode: "worker",
};

In this release, the Redis Event Bus has been updated to leverage the worker architecture. Instantiating a Medusa instance with worker_mode: "server" and a different one with worker_mode: "worker" will separate background job processing from the public-facing main application, given that the Redis Event Bus module is installed.

Features

Bugs

Chores

  • chore: Deprecate extra in favor of driver options by @adrien2p in #6772
  • chore: merge money amounts and price set money amounts by @riqwan in #6768
  • chore: pricing models uses standardized relationships attributes by @riqwan in #6767
  • chore: update naming in abstract service to dto specifics by @riqwan in #6763
  • chore: add TSDocs to the API Key Module by @shahednasser in #6785
  • chore(docs): Updated UI Reference by @github-actions in #6754

Documentation

New Contributors

Full Changelog: v1.20.3...v1.20.4

v1.20.3

20 Mar 11:25
a859b78
Compare
Choose a tag to compare

Highlights

Medusa 2.0 update

Most of the changes in this release are related to Medusa 2.0 and will not affect any users' setup. The expected date for a 2.0 release candidate is early summer. You can track the progress in our high-level roadmap.

The larger remaining todos are:

  • Convert Rest API to use Workflows, new modules, and API routes
  • Migrate Admin to use 2.0
  • Documentation
  • Migration guide
  • Cleanup/housekeeping

Admin Redesign update

Aside from changes for Medusa 2.0, this release also contains work for the Admin Redesign, set to be released in beta at the beginning of April. The redesign will significantly improve the UX and UI of our admin dashboard and make the overall look and feel much more consistent.

Others

Additionally, this release squashes some minor bugs in Medusa 1.*.

Make medusaClient optional in MedusaProvider

The property medusaClient on the type MedusaProviderProps in medusa-react has been updated to be optional.

Using the MedusaProvider without the medusaClient will initialize and use a new default client under the hood:

<MedusaProvider
  baseUrl={process.env.MEDUSA_BASE_URL}
  ...
>
    {children}
</MedusaProvider>

#6363

Add Product Categories to search subscriber

Product categories are included in search indexing on product updates and creations if the product categories feature flag is enabled.

#6555

Update index on customer table

The multicolumn uniqueness index on the customer table (email, has_account) has been updated to only apply to rows where deleted_at is null. This is to allow for the creation of customers that were previously soft-deleted.

#6631

Features

Read more