Skip to content

Releases: medusajs/medusa

v1.8.2

14 Apr 09:26
0f51e3a
Compare
Choose a tag to compare

Features

  • feat(oas): new medusa-oas docs for Redocly and circular references by @patrick-medusajs in #3745
  • feat(medusa,utils): add server level configurable http compression by @riqwan in #3785
  • feat(medusa): allow category list api to be filtered by handle by @riqwan in #3825

Bugs

Docs

New Contributors

v1.8.1

12 Apr 09:43
3efe13e
Compare
Choose a tag to compare

Features

  • feat(tests): harmonize and clean-up yarn test commands convention by @patrick-medusajs in #3695
  • feat(medusa, admin-ui): add description field to product categories by @riqwan in #3768

Bugs

  • fix(react): Fix input type on useAdminUpdateReservation mutation hook by @StephixOne in #3732
  • fix(admin-ui): display SC update notification by @fPolic in #3755
  • fix(medusa-react): update customer hook payload type by @fPolic in #3752
  • fix(admin-ui): "cancel fulfillment" notification text by @fPolic in #3750
  • fix(medusa): export product prices in human-readable format by @fPolic in #3739
  • fix(medusa): Throw on line item generation if variant does not have a price by @adrien2p in #3766
  • fix(medusa-plugin-economic,medusa-plugin-mailchimp,medusa-plugin-restock-notification,medusa-plugin-sendgrid,medusa-plugin-wishlist): Temporarily remove payload validation in some plugins by @StephixOne in #3763
  • fix(medusa): Add totals when retrieving order by cart id by @olivermrbl in #3777
  • fix(medusa): validate customer for group discount by @fPolic in #3797

Chores

  • chores(medusa): cleanup registrations life time by @adrien2p in #3699
  • chore(medusa): Migrate product type repository by @adrien2p in #3727
  • chore(medusa): Migrate product tag repository by @adrien2p in #3726
  • chore(medusa): Migrate payment collection repository api by @adrien2p in #3724
  • chore(medusa): migrate SalesChannel / ProductCategory repository by @riqwan in #3728
  • chore(medusa, utils): rename buildLegacyFieldsListFrom to objectToStringPath by @riqwan in #3738
  • chore(medusa): Migrate price list repository by @adrien2p in #3725
  • chore(medusa): Upgrade ioredis-mock by @olivermrbl in #3704
  • chore: Bump Typeorm by @olivermrbl in #3778

New Contributors

v1.8.0

04 Apr 16:52
Compare
Choose a tag to compare

Preface

You will find that version 1.8 introduces breaking changes, which might cause you to wonder; why is this not considered a major version?

As we've mentioned in the past, we are currently not following strict semantic versioning. Instead, we use minor versions for breaking changes and patches for all else - and we will continue to do so for the time being.

We apologize in advance for the inconvenience this may cause to your setup.


Introduction

Today, we’re excited to announce the release of Medusa 1.8.

This release comes with many new features while introducing architectural changes contributing toward making Medusa more modular and portable to new, modern environments.

We’ve added multi-warehouse capabilities and support for nested categories, introduced a new payment processor interface (and migrated the most used plugins Stripe and Paypal), moved Medusa Admin to our mono-repository, and revamped it to be shipped as an npm package (like all other packages), expanded our OpenAPI Spec tooling and added dedicated types packages for client applications, upgraded Typeorm, and created a range of new modules leveraging our Modules API.

The overall theme of this release has been modularity. All changes introduced in 1.8 are dedicated to making Medusa a toolbox for developers to create rich commerce applications. We are enabling a future for commerce businesses where they can focus on innovation and differentiating – without having to worry about re-platforming or hacky workarounds.

Our packages are all open-source, free, and extensible.

Get Started

It's recommended to use yarn when updating the following dependency to avoid any unexpected errors.

To get started using Medusa 1.8, you can create a new project using our Quickstart guide or follow the steps outlined below:

First, upgrade your version of Typeorm:

yarn add typeorm@0.3.11

The dependency on Typeorm has been upgraded from 0.2.31 to 0.3.11, that comes with significant breaking changes. Follow Typeorm's upgrade guide to refactor your custom code.

Install the 1.8 version of the core:

yarn add @medusajs/medusa@latest

The core engine doesn't come with a Redis caching mechanism and Redis events system any longer. Instead, the core relies on the Module API for those two sub-systems.

As a result, you must install and use those modules to ensure your application works as expected.

Install the new Redis cache module with the following command:

yarn add @medusajs/cache-redis@latest

Install the new Redis event bus module with the following command:

yarn add @medusajs/event-bus-redis@latest

Then, add both modules to the exported configuration in medusa-config.js:

module.exports = {
  // ...
  modules: {
    eventBus: {
      resolve: "@medusajs/event-bus-redis",
      options: {
        redisUrl: "your-redis-url"
      }
    },
    cacheService: {
      resolve: "@medusajs/cache-redis",
      options: {
        redisUrl: "your-redis-url"
      }
    }
  }
}

Replace your-redis-url with the URL to your Redis instance.

Finally, run migrations to ensure your database is up to date with our schema changes:

medusa migrations run

You are now set up to start using 1.8.

There are plenty of other features and improvements to leverage in your project. Those are covered in the following sections.

But before that, here’s a non-exhaustive overview of what’s new in Medusa 1.8:

  • Multi-warehouse
  • Nested Categories
  • Medusa Admin plugin
  • Payment Processors
  • Event Bus module
  • Cache module
  • Inventory module
  • Stock Location module
  • OAS Tooling and client types packages
  • Types and Utils packages
  • Search plugins update
  • Performance improvements
  • Typeorm update

What’s new in 1.8?

Feature flags

You'll find the following feature flags in 1.8:

Name Flag Description Default value
Order Editing order_editing  Allows you to edit Orders after having been placed  true
Product Categories product_categories  Organize your products to provide customers with a better browsing experience as they navigate your catalog.  false
Sales Channels sales_channels  Group your products in and receive Orders from different channels  true
Tax-inclusive Pricing tax_inclusive_pricing  Specify prices with tax included  false

Modules

The terms modules and Modules API are used extensively throughout these release notes, so we want to preface the features overview with a short explanation of the concept. Refer to the product announcement and our documentation for more elaborate walkthroughs.

As mentioned, the overall theme of this release has been modularity. We have started breaking up our monolithic core into modules. These modules are isolated bundles of code encapsulating a specific domain. Domain in this context refers to an area in your application that is logically coherent e.g. users, products, cart, etc.

The modules separate the concerns in Medusa at an architectural level and pave the way for more extensibility and customizability of your setup. Furthermore, the modules live separately from the core, allowing developers to run them independently from the main application.

As such, applying these architectural changes across all domains will make almost any part of Medusa entirely replaceable and capable of running on infrastructure in isolation from each other e.g. in a serverless environment, on edge, etc.

In 1.8, the usage of our Modules API is rather simple. We are introducing four modules; events, caching, inventory, and stock location. Initially, these modules live up to one of the two characteristics mentioned. They are entirely replaceable.

A module comes with a definition containing information about its configuration and capabilities. These definitions can be found in the new Modules SDK package, @medusajs/modules-sdk, in the file definitions.ts.

Let's take the event bus module definition as an example to describe the properties:

{
    key: "eventBus",
    registrationName: "eventBusModuleService",
    defaultPackage: "@medusajs/event-bus-local",
    label: "EventBusModuleService",
    canOverride: true,
    isRequired: true,
    defaultModuleDeclaration: {
      scope: MODULE_SCOPE.INTERNAL,
      resources: MODULE_RESOURCE_TYPE.SHARED,
    },
  },
Property Description
key The key to register a module in your medusa-config.js. As you did with the event bus module in the Get Started section above.
registrationName The name of the main service of the module and its registration in the Awilix dependency container.
defaultPackage If the module comes with a default package, it will be added directly in the definition. If there's no default package, this value is false.
label Readable label to identify the module
canOverride If true, the module is replaceable
isRequired If true, the module is required
defaultModuleDeclaration.scope The module can be internal or external. An internal module communicates with other services part of the same application. An external module communicates with other services via a separate protocol e.g. HTTP, rpc, etc.
defaultModuleDeclaration.resources The module can share resources with the core. A module that shares resources with the core uses the same database connection in the core. A module that does not share resources with the core establishes a separate connection or uses a different data store.

Modules are loaded similarly to plugins. Upon server start, we look for modules in your medusa-config.js and register them, given they are correctly configured.

In medusa-config.js, modules are registered as shown previously:

module.exports = {
  projectConfig,
  plugins,
  modules: {
    eventBus: {
      resolve: "@medusajs/event-bus-redis",
      options: {
        redisUrl: "your-redis-url"
      }
    }
  }
}

In the example above, we override the default event bus module with a Redis implementation. The resolve property of the module configuration can point to a package on npm or a local folder/file. The options are injected into the module upon initializing it. You can find more on this in our documentation.

What's to come

We are actively working toward making modules capable of booting up outside of the core in complete isolation hereby living up to the second of the two characteristics.

To give you an idea of what we are building, consider the following handler:

import { initialize } from "@medusajs/cart"
import { NextApiRequest, NextApiResponse } from "next"

const cartService = await initialize()

export default async (req: NextApiRequest, res: NextApiResponse) => {
  const { cart_id } = req.query
  const { quantity, variant_id } = req.body

  try {
    const cart = await cartService.addLineItem(cart_id, { quantity, variant_id })

    res.json({ cart })
  } catch (e) {
    res.status(400).json({ error: e.message })
  }
}

Now, please don't get caught up in the details. The above code snippet is not necessarily exactly what it will look like but merely an example to communicate the road ahead for modules.

This way of working with modules is exceptionally flexible. It equips developers with a powerful toolkit to build commerce applications similar to how you build other applications in...

Read more

v1.8.0-rc.8

04 Apr 15:46
Compare
Choose a tag to compare
v1.8.0-rc.8 Pre-release
Pre-release

Bugs

v1.8.0-rc.7

04 Apr 14:09
Compare
Choose a tag to compare
v1.8.0-rc.7 Pre-release
Pre-release

Bugs

v1.8.0-rc.6

03 Apr 16:10
Compare
Choose a tag to compare
v1.8.0-rc.6 Pre-release
Pre-release

Features

  • feat: Initialize method for modules (#3649)

Bugs

  • fix(admin-ui): Make copy on manage locations modal better when no locations (#3666)
  • fix(admin-ui, medusa): Require name in create stock location (#3670)
  • fix(medusa, admin-ui, medusa-react): Gift Card update fixes and admin UI cleanup (#3676)
  • fix(medusa): stocked quantity counting when listing products (#3684)
  • fix(medusa-react): Query key invalidation (#3686)
  • fix(medusa-react): export product-categories store hooks (#3689)

Chores

  • chore(medusa-cli): Add missing utils dep (#3688)

v1.8.0-rc.5

31 Mar 11:30
Compare
Choose a tag to compare
v1.8.0-rc.5 Pre-release
Pre-release

Features

Bugs

v1.8.0-rc.4

30 Mar 15:13
Compare
Choose a tag to compare
v1.8.0-rc.4 Pre-release
Pre-release

Features

  • feat(admin-ui): move inventory item fields into manage inventory modal (#3591) @pKorsholm
  • feat(medusa): remove created reservations on subsequent failure for cart completion (#3554) @pKorsholm
  • feat(medusa): Remove reservations for all line items when an order edit is accepted (#3544) @pKorsholm

Bugs

Chores

v1.8.0-rc.3

29 Mar 11:44
Compare
Choose a tag to compare
v1.8.0-rc.3 Pre-release
Pre-release

Bugs

Chores

v1.8.0-rc.2

28 Mar 19:09
Compare
Choose a tag to compare
v1.8.0-rc.2 Pre-release
Pre-release

Features

  • feat(admin-ui): Request return flow warnings and errors (#3473) @pKorsholm
  • feat(oas-cli): output better error when no command is provided (#3559) @patrick-medusajs
  • feat(admin-ui, medusa): Improve fulfillment validation (#3541) @pKorsholm
  • feat(medusa): invalidate price selection caching within update request (#3553) @fPolic
  • feat(medusa): Categories - Adds indexes + remove soft delete (#3589) @riqwan
  • feat(medusa-payment-paypal): Migrate to the new payment processor API (#3414) @adrien2p

Bugs

  • fix(event-bus-local): Error handling (#3575) @adrien2p
  • fix(admin-ui): multi warehouse minor fixes (#3540) @pKorsholm
  • fix(admin): OrderEdit display of difference due with refund (#3487) @fPolic
  • fix(admin-ui): Fix effect check in inventory table and overflow UI (#3577) @StephixOne
  • fix(admin-ui): Hide inventory quantity field in variant stock form if SL module enabled (#3592) @StephixOne
  • fix(medusa-file-s3): Update key formation to use timestamp (#3601) @IgorKhomenko
  • fix(medusa): Include inventory quantity when listing products (#3586) @pKorsholm
  • fix(admin-ui): disallow creating OE if there is no changes (#3604) @fPolic
  • fix(admin-ui): Create fulfillment (#3607) @pKorsholm
  • fix(admin-ui): Update order edit variants table to fit longer content (#3608) @StephixOne

Chores