v1.12.0
Highlights
Breaking changes
In our quest to improve performance, a public method in the PriceSelectionStrategy has been updated to support bulk calculations of variant prices. Specifically, the following signatures have changed:
// Before
calculateVariantPrice(variantId: string, context: PriceSelectionContext): Promise<PriceSelectionResult>
// Now
calculateVariantPrice(data: { variantId: string; quantity?: number; }[], context: PriceSelectionContext): Promise<Map<string, PriceSelectionResult>>
Additionally (non-breaking), the following DB indexes have been added:
idx_money_amount_variant_id ON money_amount (variant_id);
idx_money_amount_region_id ON money_amount (region_id);
idx_product_option_value_variant_id ON product_option_value (variant_id);
idx_product_option_value_option_id ON product_option_value (option_id);
idx_gin_product_title ON product USING gin (title gin_trgm_ops);
idx_gin_product_description ON product USING gin (description gin_trgm_ops);
idx_gin_product_variant_title ON product_variant USING gin (title gin_trgm_ops);
idx_gin_product_variant_sku ON product_variant USING gin (sku gin_trgm_ops);
idx_gin_product_collection ON product_collection USING gin (title gin_trgm_ops);
The packages class-validator
and class-transformer
have been removed from @medusajs/utils
.
The TransactionBaseService
has been removed from @medusajs/utils
. This class should be imported from @medusajs/medusa
.
The utilities build-query
, db-aware-column
, base-entity
, and soft-deletable-entity
have been removed from @medusajs/utils
. These should be imported from @medusajs/medusa
.
Support for SQLite dropped
SQLite support was initially added to reduce friction for developers trying Medusa for the first time. It runs on most operating systems without installation, allowing you to start a Medusa starter without preparing a Postgres database.
Though, as we've added features that use more advanced database concepts, we've seen that SQLite has started to cause more harm than good. And frankly, we've not prioritized maintaining the support, as removing it was always part of our plans. SQLite still allows developers to get started very quickly. However, as soon as you start using our admin system or set up the storefront starter, issues caused by the limitations of SQLite arise. These issues are primarily centered around transaction management. A concept used extensively in our core and poorly supported by SQLite.
Therefore, as of this release, SQLite is no longer supported. The pros simply do not outweigh the cons at this point.
What does this mean for your setup?
In the highly unlikely case that you are using SQLite, this will be a breaking change. So, you'll need to set up Postgres for your Medusa server as part of bumping to this version. You can find a guide in our documentation on how to do this.
If you are not using SQLite, these changes will not affect your setup.
Reservation management
With the introduction of our Inventory Module, we added the notion of reservations. Right now, reservations are, from a store administrator perspective, limited to order items and cannot really be used outside the context of an order - unless you consume the API directly.
In this release, we ship the first elements to more extensive reservation management, including an overview of all reservations and the ability to search and edit existing reservations. The feature is still WIP, so we will hide the UI behind a new feature flag, reservations
, that you can enable as any other feature flag, if you want to start playing around with the feature now.
Features
- feat(medusa): Add location id filtering to list location levels by @pKorsholm in #4066
- allow backorder by @pKorsholm in #4051
- feat(plugins): Config Modules by @juanzgc in #4094
- feat(medusa): Remove sqlite support by @olivermrbl in #4026
- feat(medusa): Improve prices flow by @adrien2p in #3703
- feat(modules-sdk): Module as singleton instances by @carlos-r-l-rodrigues in #4065
- feat(medusa-plugin-contentful): Initial implementation of inventory module by @pKorsholm in #3991
- feat(medusa-file-local): Local file storage plugin by @olivermrbl in #4118
- feat(medusa): Revert pricing service setVariantPrices API by @adrien2p in #4130
- feat(medusa, admin-ui): Update edit allocation modal by @pKorsholm in #4071
- feat(admin-ui,medusa): Reservations management by @pKorsholm in #4081
- feat(medusa-plugin-mailchimp): Migrate to TS + add update endpoint by @tomekpur in #4040
- feat(medusa,inventory,types): Expand list-reservation capabilities by @pKorsholm in #3979
- feat(medusa, inventory): Search inventory items by title and description by @pKorsholm in #4154
- fix(medusa): Upserting tax rates (#4189) by @olivermrbl in #4189
- chore(medusa,admin-ui): Add reservations FF by @olivermrbl in #4184
Bugs
- fix(medusa-payment-stripe): Added withTransaction to capturePaymentIfNecessary by @DidierGuyon in #3930
- fix(medusa): downgrade
papaparse
version by @fPolic in #4174 - fix(admin-ui): Ensure that default invite link uses BASE if set by @kasperkristensen in #4173
- fix(admin-ui): Ensure order of variant options matches order of product options by @kasperkristensen in #4178
- fix(admin-ui): Delete variant by @olivermrbl in #4163
- fix(inventory): Use correct table name in migration by @pKorsholm in #4155
- fix(medusa): migrations cli should also pull from ${plugin}/dist by @dwene in #3956
- fix(admin-ui): Omit purchasable variant prop on duplicate by @olivermrbl in #4180
Chores
- chore(medusa): Align build query utils by @adrien2p in #4148
- chore(utils): clean util package deps by @fPolic in #4146
New Contributors
- @juanzgc made their first contribution in #4094
- @DidierGuyon made their first contribution in #3930
- @tomekpur made their first contribution in #4040
Full Changelog: v1.11.0...v1.12.0