Medusa 1.7.0: Performance Improvement, B2B Launch, and more!
Tags: opensource, news, showdev, javascript
Published: 2022-12-16 16:29:46

Time for another release of Medusa!

Version 1.7 introduces a massive performance improvement, Module Resolution API, migrating the Medusa admin to Vite, and more!

Keep reading below to learn more about all the new changes in this release!

## How to Update Medusa?

### Medusa Server

You can update your Medusa server using the following command:

```bash
npm install @medusajs/medusa@latest @medusajs/medusa-cli@latest medusa-interfaces@latest
```

Make sure to update any other Medusa plugins or packages you use!

You can check out [the upgrade guide](https://docs.medusajs.com/advanced/backend/upgrade-guides/1-7-0) for breaking changes in this version and how to resolve them.

### Medusa Admin

You can also update the Medusa Admin by pulling changes from the [GitHub repository](https://github.com/medusajs/admin).

You can check out [the upgrade guide](https://docs.medusajs.com/advanced/backend/upgrade-guides/admin/admin-vite) for breaking changes in this new update and how to resolve them.

## Performance Improvement

Medusa servers that have large traffic and carts with a lot of products previously suffered from a decrease in performance. This is due to issues related to algorithm complexity, event loop bottleneck, and a large number of calls to external API during the checkout flow.

This version fixes all these issues and more, which leads to a huge performance improvement of the entire core engine! After updating your server, the checkout flow on your store will be much faster, providing your customers with a better user experience.

## Allow Customers to Claim Orders

When a guest customer places an order, then registers, they can now claim the order they placed as a guest by providing the order ID.

An email is then sent to the email address associated with the order with a link to confirm the customer’s request to claim the order.

You can learn more about implementing this flow in our documentation:

- [How to Implement Claim Order Flow](https://docs.medusajs.com/advanced/storefront/implement-claim-order)
- [How to Handle Order Claim Event](https://docs.medusajs.com/advanced/ecommerce/handle-order-claim-event)

## Introducing Module Resolution API

The Module Resolution API allows even more customization capabilities within Medusa. Modules represent function areas in the core engine, such as Inventory Management, Events system, Cache mechanism, etc…

This new API would allow developers to replace an entire domain to change how that domain works in Medusa.

The current version introduces the first steps in allowing customizations with Modules. Future versions would support replacing different function areas in the core.

## Allow Regular Expressions in CORS Configurations

Starting from version 1.7, you can use regular expression patterns for admin and storefront CORS configurations.

For example, you can use `*.example.com` to allow all subdomains of `example.com` to send requests to the server.

You can learn more in [this documentation](https://docs.medusajs.com/usage/configurations#cors-configurations).

## Migrate Medusa Admin from Gatsby to Vite

Medusa Admin was previously built with Gatsby. Gatsby is a great choice for building storefronts and websites in general. However, for the Medusa Admin, we weren’t fully utilizing its super powers. This took a toll on developer experience due to slow build processes.

We’ve now migrated from using Gatsby to using Vite 3 with React. This reduced the local build time by more than 10x the original time.

You can check [the upgrade guide](https://docs.medusajs.com/advanced/backend/upgrade-guides/admin/admin-vite) for details on breaking changes after this update and how to resolve them.

## Documentation Changes

Aside from the major redesign of our documentation website, we have added more documentation pages. Some of the important ones are:

- [Deploy Your Medusa Server to Railway](https://docs.medusajs.com/deployments/server/deploying-on-railway)
- [Discounts Architecture Overview](https://docs.medusajs.com/advanced/backend/discounts/)
- [Manage Discounts using Admin APIs](https://docs.medusajs.com/advanced/admin/manage-discounts)
- [Use Discounts in Checkout](https://docs.medusajs.com/advanced/storefront/use-discounts-in-checkout)
- [How to Use CustomerGroup APIs](https://docs.medusajs.com/advanced/admin/use-customergroups-api)

## Use Medusa for B2B Ecommerce

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/czg2kn1x5x4o95fau9e6.jpeg)

This week, we heavily focused our content on showcasing Medusa as a B2B ecommerce platform. As Medusa supports all B2B essential ecommerce features, and as Medusa is currently the #1 Node.js ecommerce server, it is one of the top B2B ecommerce platforms currently available.

This week, we’ve shared:

- [B2B Perspective report](https://medusajs.com/pdf/B2B-OS-Perspective.pdf)
- [2-series tutorial](https://medusajs.com/blog/medusa-b2b-part-1) on how to create a B2B ecommerce platform with Medusa
- [Comparison between top 5 B2B ecommerce platforms](https://medusajs.com/blog/top-5-open-source-ecommerce-platforms)
- [9 UX tips from the best B2B ecommerce website](https://medusajs.com/blog/9-best-ecommerce-ux-practices-with-examples) (as crowned by HackerNews)

Next week we’ll be sharing more tips for B2B ecommerce businesses. Be sure to look out for our new content! You can also subscribe to our newsletter [here](https://ky5eo2x1u81.typeform.com/newsletter).

> Should you have any issues or questions related to Medusa, then feel free to reach out to the Medusa team via [Discord](https://discord.gg/F87eGuwkTp).