Releases: medusajs/medusa
v1.9.0
Breaking changes
A minor breaking change has been introduced to the events system. The EventBusModule
interface has been updated with a new method, retrieveSubscribers
. The method is used in the core EventBusService
to fetch subscribers to a given event upon emitting one or multiple events. If no subscribers exist to an event, we do not insert a staged job in the database which means the event will not be sent for processing in the event bus module.
Features
- feat(medusa): Add purchasable prop on variants when setting availability by @pKorsholm in #3811
- feat(admin-ui): Implement allocations on draft orders by @StephixOne in #3753
- feat(medusa-file-s3,medusa-file-minio): Upgrade to TypeScript by @dwene in #3740
- feat(medusa, medusa-plugin-brightpearl): Inventory management for Brightpearl by @pKorsholm in #3192
- feat(medusa-plugin-meilisearch): Update meilisearch library dependency by @pevey in #3898
- feat(admin-ui): Add Sales Channel filter by @olivermrbl in #3897
- feat(medusa): Middleware to add default SC on query if no SC already exist on it by @StephixOne in #3694
Bugs
- fix(admin-ui): password reset flip rendering condition by @nowseemee in #3864
- fix(inventory): Add missing context arguments by @olivermrbl in #3863
- fix(medusa): Add missing relations when creating return by @olivermrbl in #3870
- fix(medusa): Bulk create variant + pass transaction to the inventory service context methods by @adrien2p in #3835
- fix(medusa): Correct inventory quantity calculation by @pKorsholm in #3881
- fix(medusa-plugin-ip-lookup): Remove outdated Typeorm usage by @olivermrbl in #3884
- fix(admin-ui): Check for undefined categories by @olivermrbl in #3886
- fix(inventory): Minor fixes to upserting inventory items by @olivermrbl in #3883
- fix(medusa,medusa-fulfillment-webshipper): Add default values in Webshipper service by @olivermrbl in #3879
- fix(admin-ui): Add guard for null
product_id
by @pKorsholm in #3894 - fix(medusa,utils): Searching indexing product subscriber by @olivermrbl in #3905
- fix(admin): display correct items in the timeline after OE by @fPolic in #3895
- fix(medusa): category list api bug where limit skews results by @riqwan in #3914
- fix(medusa): Reduce joins in cart retrieval by @olivermrbl in #3909
Chores
New Contributors
- @nowseemee made their first contribution in #3864
Full Changelog: v1.8.2...v1.9.0
v1.8.2
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
- docs: Adding Microtica as a deployment option by @naumovskamarija in #3802
New Contributors
- @naumovskamarija made their first contribution in #3802
v1.8.1
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
- @lnxcz made their first contribution in #3707
- @thephpguy made their first contribution in #3679
v1.8.0
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 [email protected]
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...
v1.8.0-rc.8
v1.8.0-rc.7
v1.8.0-rc.6
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
Features
- feat(admin-ui): Make number input increment/decrement buttons not tabbable-to (#3645) @StephixOne
- feat(admin-ui, medusa): admin UI metadata (#3644) @kasperkristensen
- feat(admin-ui): Add new feature badge for categories and inventory (#3657) @StephixOne
Bugs
- fix(admin-ui): Collapse categories by default (#3637) @olivermrbl
- fix(admin-ui): Always show categories in product page (#3655) @olivermrbl
v1.8.0-rc.4
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
- fix(admin-ui): delete inventory item when variant is deleted (#3585) @pKorsholm
- fix(admin-ui): Fix team table filter dropdown transparency (#3625) @StephixOne
- fix(medusa): execSync stdio (#3633) @carlos-r-l-rodrigues
- fix(oas:test): Augment jest timeout from 30 to 60 sec (#3631) @patrick-medusajs
- fix(medusa): Fix hanging inventory item migration script (#3624) @pKorsholm
- fix(admin-ui): Eliminate purple from most-visible components (#3639) @olivermrbl
Chores
- chore(admin-ui): Update favicon (#3640) @olivermrbl
v1.8.0-rc.3
Bugs
- fix(modules-sdk): check if dependency is registered (#3620) @carlos-r-l-rodrigues
- fix(medusa-cli): add semver dependency (#3603) @kasperkristensen
- fix(medusa, admin-ui): List all inventory levels (#3552) @pKorsholm
Chores
- chore: Merge master to develop and manage conflict (#3570) @adrien2p
- chore(medusa): EOL causing logging to hang (#3622) @olivermrbl