Releases: medusajs/medusa
v1.20.5
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.
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.
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",
},
},
},
]
Features
- feat(medusa): add list location levels endpoint in api v2 by @pKorsholm in #6741
- feat: API key sales channel link by @olivermrbl in #6851
- feat: Modify the abstract repository upsert to handle subresources as per convention by @sradevski in #6813
- feat(medusa, stock-location-next): add list-stock-locations endpoint to api-v2 by @pKorsholm in #6788
- feat(admin-next): Email password invite flow in admin 2.0 by @olivermrbl in #6821
- feat: Refactor the product module definitions and implementation by @sradevski in #6866
- feat(modules-sdk): remote query retrieve by @carlos-r-l-rodrigues in #6849
- feat: Implemented price set update with prices and aligned pricing API by @sradevski in #6872
- feat(medusa-react,medusa,types,dashboard): added empty state + table for promotions list page by @riqwan in #6827
- feat: Remove sales channels from pub keys by @olivermrbl in #6876
- feat: Add v2 product types endpoints by @sradevski in #6880
- feat(dashboard): admin 3.0 order refund form by @fPolic in #6850
- feat(create-medusa-app): Add a
--verbose
option. by @shahednasser in #6027 - feat: Pricing update and refactor product API tests to not rely on internals by @sradevski in #6892
- feat: Admin V2 users domain by @olivermrbl in #6844
- feat(dashboard): Variant edit form by @kasperkristensen in #6870
- feat: Correctly define all product module models and SQL migration script by @sradevski in #6906
- feat: add sales channel management by @olivermrbl in #6761
- feat(link-module, core-flows, medusa): Add sales channel location management by @pKorsholm in #6905
- feat(workflows-sdk,orchestration): async step as background task by @carlos-r-l-rodrigues in #6886
- feat(dashboard): Update v2 store domain to follow conventions, and abstract some logic by @kasperkristensen in #6927
- feat(medusa): added endpoints for rule attribute/operator/values options by @riqwan in #6911
- feat: Add some of the missing pieces in the create product form by @sradevski in #6918
- feat(dashboard): Setup V2 Collections domain by @kasperkristensen in #6935
- feat(dashboard): admin locations v2 by @pKorsholm in #6868
- feat(dashboard): Add forms for edit and create product options by @kasperkristensen in #6907
- feat: region payment providers management workflows/api by @adrien2p in #6864
- feat: Normalize known DB errors to a MedusaError when possible by @sradevski in #6922
- feat(dashboard): Setup workflows in V2 routes by @kasperkristensen in #6939
- feat(dashboard): Edit variant options + create option callback for combobox by @kasperkristensen in #6920
- feat: Admin V2 API keys by @olivermrbl in #6883
- feat: Add boilerplate for the file module by @sradevski in #6956
- feat(utils): Support free text configuration by @adrien2p in #6942
- feat: Shipping options API by @adrien2p in #6957
- feat: Add zod middleware by @olivermrbl in #6961
- feat(dashboard): Migrate to new hooks and API client by @kasperkristensen in #6963
- feat(product): return parents tree by @carlos-r-l-rodrigues in #6944
- feat: Add create location fulfillment set flow + API by @olivermrbl in #6945
- feat: Add generic link filter middleware by @olivermrbl in #6969
- feat: Add product routes and components to v2 in admin-next by @sradevski in #6958
- feat(dashboard): added details page for promotions + edit sliders by @riqwan in #6882
- feat: Create shipping options workflow by @adrien2p in #6962
- feat: Switch to zod for the product API and implement missing primitives by @sradevski in #6978
- Feat: draft order api by @carlos-r-l-rodrigues in #6797
- feat(dashboard): regions v2 by @fPolic in #6943
- feat: Bring back API key sales channel management by @olivermrbl in #6976
- feat: Clean up shipping options management by @adrien2p in #6977
- feat: Add support for defining options when creating product by @sradevski in #6981
- feat(medusa, core-flows): Create service zones by @olivermrbl in #6979
- feat: Delete service zone by @olivermrbl in #6984
- feat: Add support for setting sales channel when creating a product by @sradevski in #6986
- feat: Add tax regions table by @olivermrbl in #6983
- feat: Revamp product details page and several product fixes and cleanups by @sradevski in #6988
- feat: Add decimal digits and rounding info to currencies by @sradevski in #6991
- feat: Totals calculation by @carlos-r-l-rodrigues in #6980
- feat: Update service zone by @olivermrbl in #6990
- feat: Improvements to the products details page in the admin by @sradevski in #6994
- feat(*): shipping options update API by @adrien2p in #6987
- feat: Admin V2 Customers by @olivermrbl in #6998
- feat: Add variant creation and editing in the products UI by @sradevski in #6997
- feat: Improve how options are defined and handled for product by @sradevski in #7007
- feat: Make tags unique, clean up searchability of product entities by @sradevski in #7014
- feat: Categories retrieve + list API by @olivermrbl in #7009
- feat(dashboard): Initial pricing domain by @kasperkristensen in #6996
- feat: Add support for loading file providers to file module by @sradevski in https://github.com...
v1.20.4
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
- feat: Update the signatures for variants and options to follow convention by @sradevski in #6748
- feat(fulfillment): Events management by @adrien2p in #6730
- feat: Init. v2 implementation in admin by @olivermrbl in #6715
- feat(medusa, core-flows): add Update inventory item endpoint in api-v2 by @pKorsholm in #6735
- feat(utils): autogenerates create and update methods when dto is provided by @riqwan in #6751
- feat: Align the product module HTTP API to follow our conventions by @sradevski in #6759
- feat(pricing): pricing models are made soft deletable by @riqwan in #6732
- Feat(workflows-sdk): additional properties to context by @carlos-r-l-rodrigues in #6760
- feat: shard modules and API integration tests by @riqwan in #6775
- feat: v2 - add worker mode by @srindom in #6739
- Feat(user): Invite expiration fix by @pKorsholm in #6758
- feat: List products middleware by @olivermrbl in #6769
- feat(core-flows): Use remote link methods to dismiss all links related to inventory item by @pKorsholm in #6737
- Feat(orchestration,workflows-sdk,core-flows): workflow cancel by @carlos-r-l-rodrigues in #6778
- feat(dashboard) admin 3.0 return creation by @fPolic in #6713
- feat(core-flows, types, medusa): Add Update location level endpoint for api-v2 by @pKorsholm in #6743
- feat: Add
successRedirectUrl
to auth options by @olivermrbl in #6792 - update prefix for inventory-next reservation item by @pKorsholm in #6816
- feat(dashboard): Price List configurations section by @kasperkristensen in #6663
- feat(dashboard, ui): Product image modals by @kasperkristensen in #6779
- feat(core-flows, medusa): add create stock location endpoint for api-v2 by @pKorsholm in #6787
- feat(create-medusa-app): Added --v2 option by @shahednasser in #6729
- feat(core-flows,medusa,types,utils): rename psma to prices by @riqwan in #6796
- feat(medusa-payment-paypal,medusa-payment-stripe): speed up unit tests in CI by @riqwan in #6806
- feat(dashboard): Order timeline by @kasperkristensen in #6815
- feat(types, medusa, core-flows): add delete-stock-location endpoint to api-v2 by @pKorsholm in #6801
- feat(medusa, core-flows): add retrieve stock location endpoint to api-v2 by @pKorsholm in #6791
- feat(dashboard): Draft orders create by @kasperkristensen in #6680
- feat(medusa): migrate medusa unit tests / plugins integration tests to swc jest by @riqwan in #6820
- feat: Create user account by @olivermrbl in #6819
- chore(dashboard): render main layout as home page for v2 by @riqwan in #6823
Bugs
- fix(orchestration): Properly handle select all by @adrien2p in #6742
- fix(link-modules): recreate dismissed link by @carlos-r-l-rodrigues in #6764
- fix: revert no server start by @srindom in #6790
- fix: make module test runner configurable by @srindom in #6803
- fix(medusa-oas-cli): fix tool not working in Medusa backends by @shahednasser in #6812
- Fix/pricing create price lists by @adrien2p in #6818
- fix(medusa): migrate with feature flag by @srindom in #6771
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
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>
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.
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.
Features
- feat: Add BigNumber implementation by @olivermrbl in #6253
- feat(region): Add admin region get + list endpoints by @olivermrbl in #6322
- feat(fulfillment): Init dtos work by @adrien2p in #6329
- feat(dashboard,medusa,ui): Manual gift cards + cleanup by @kasperkristensen in #6380
- feat(payment): provider service by @fPolic in #6308
- feat(region): Add store region get + list endpoints by @olivermrbl in #6342
- feat(medusa): workflow engine api by @carlos-r-l-rodrigues in #6330
- feat(region): Create region with countries by @olivermrbl in #6372
- feat(user, types): add invite and user properties + migration by @pKorsholm in #6327
- feat(cart):
POST /store/carts/:id
by @olivermrbl in #6274 - feat(medusa, types, core-flows): Add invite endpoints for api-v2 by @pKorsholm in #6395
- feat(fulfillment): Module service implementation first iteration by @adrien2p in #6381
- feat(order): module foundation by @carlos-r-l-rodrigues in #6399
- feat(tax): tax module scaffolding by @srindom in #6417
- feat: CartRegion link, definition + workflow by @olivermrbl in #6392
- feat: Cart SalesChannel link + clean-up by @olivermrbl in #6418
- feat(tax): Add TaxRegion by @srindom in #6421
- Feat(medusa, user, core-flows): User creation with invites by @pKorsholm in #6413
- feat: Cart Customer link + create cart with customer by @olivermrbl in #6426
- feat(core-flow, medusa): Create cart with Sales Channel by @olivermrbl in #6427
- feat(fulfillment): implementation part 2 by @adrien2p in #6408
- feat(region): Region create, delete, update admin endpoints by @olivermrbl in #6332
- feat(regions): Add support for updating countries in a region by @sradevski in #6432
- feat: Add skeleton for api key module by @sradevski in #6451
- feat(tax): introduce tax override data models by @srindom in #6422
- Feat(order): order changes by @carlos-r-l-rodrigues in #6435
- feat(dashboard, medusa, medusa-js, medusa-react, icons): DataGrid, partial Product domain, and ProductVariant hook by @kasperkristensen in #6428
- feat(api-key): Add CRUD functionalities to the api key module by @sradevski in #6463
- chore(utils): Move generic utils from region module to utils by @sradevski in #6466
- feat(dashboard): Rework route modals by @kasperkristensen in #6459
- feat(tax): adds getItemTaxLines by @srindom in #6440
- feat(utils): Fix big number decorator and cleanup by @adrien2p in #6473
- feat(modules-sdk, types, user, utils):init user module events by @pKorsholm in #6431
- feat(api-key): Add the endpoints and workflows for api key module by @sradevski in #6471
- feat(fulfillment): Shipping options, rules CRUD + rules based context filtering by @adrien2p in #6455
- feat: Update signature of region module to match latest spec by @sradevski in #6487
- feat(tax): singular creates and deletes of regions, rates, rules by @srindom in #6464
- feat(tax): soft deletes by @srindom in #6486
- feat: Add skeleton for Store module by @sradevski in #6506
- feat(workflows-sdk,core-flows,medusa,types): add workflow to update promotions to cart by @riqwan in #6474
- feat: Create cart with line items by @olivermrbl in #6449
- feat: Add basic CRUD functionality to store module by @sradevski in #6510
- feat(fulfillment): List shipping options filtered by context anmd rules by @adrien2p in #6507
- feat(payment, payment-stripe): Add Stripe module provider by @olivermrbl in #6311
- feat(tax): add tax provider support by @srindom in #6492
- feat: Update authentication middleware by @pKorsholm in #6447
- feat: Refresh invite by @pKorsholm in #6469
- feat(tax): normalize country and province code by @srindom in #6513
- feat(tax): add support for updating tax rates by @srindom in #6516
- feat(api-key): Allow revoking in the future, and enforce the secret key by @sradevski in #6484
- feat(user): standardize events emitted for token generation by @pKorsholm in #6520
- feat(admin-next) discounts list page by @fPolic in #6490
- feat(core-flows,medusa,types,utils): adds update cart API with promotions by @riqwan in #6514
- feat: Line Items API Routes by @olivermrbl in #6478
- feat(api-key): Add api-key authentication to middleware by @sradevski in #6521
- feat(payment): Add migration by @olivermrbl in #6509
- feat: Add basic endpoints and workflows for Store module by @sradevski in #6515
- feat(types): add util to transform get response to an update request by @riqwan in #6289
- feat(types): promotion module uses big number by @riqwan in #6522
- feat(tax): migration file by @srindom in #6523
- feat(medusa,core-flows): update cart adjustments on item updates by @riqwan in #6539
- feat(dashboard,medusa): Update Pub. API key table and add query params to endpoint by @kasperkristensen in #6483
- feat(tax): add endpoints to create tax regions and tax rates by @srindom in #6533
- feat(tax): add support for updating tax rates by @srindom in #6537
- feat(tax): v2 api tax rates and regions deletes by @srindom in #6541
- feat(utils): consolidate promotion utils + refactor + fixes by @riqwan in #6531
- feat(dashboard): Regions domain by @kasperkristensen in #6534
- feat: Add currency module and remove currency models from region and pricing modules by @sradevski in https:/...
v1.20.2
Highlights
Improve error messaging
We have improved error messaging for missing exports of custom services. Until now, the following non-descriptive message was logged:
In 1.20.2, the same error will now log to the console:
This change landed in #6240.
Expose option to configure batch size of staged job polling
We have introduced an option jobs_batch_size
in the projectConfig
in medusa-config.js
, allowing users to configure the batch size of staged jobs we poll from the database every 3rd second. By default, we poll 1000 jobs, which has proven to cause issues with some setups. This option aims to resolve those.
Example config:
module.exports = {
projectConfig: {
jobs_batch_size: 10 // poll 10 jobs every 3rd second
},
}
This change landed in #6333.
Support order by queries on GET /admin/orders
We have introduced an order
query param on the GET /admin/orders
endpoint to support ordering orders.
This change landed in #6258.
Admin revamp (status)
Our work on the admin revamp is progressing well. Below is an overview of completed and remaining work:
Completed
- Customers domain
- Customer Groups domain
- Taxes domain
- Currencies domain
- Regions domain
- Stores domain
- Sales Channels domain
- Users domain
- API keys domain
Remaining
- Orders domain
- Draft Orders domain
- Products domain
- Gift Cards domain
- Categories domain
- Inventory domain
- Discounts domain
- Regions domain
- Taxes domain
- Locations domain
Medusa 2.0 (status)
We spend most of our time working on Medusa 2.0 and are seeing great improvements weekly.
You can follow our development in our roadmap.
Here's a high-level overview of completed, WIP, and planned work:
Completed
- Pricing Module
- Product Module
- Sales Channel Module
- Customer Module
- Workflows / long-running workflows
Work-in-progress
- Payment Module
- Cart Module
- Regions Module
- Fulfillment Module
- Regions Module
- Promotions Module
- Authentication Module
- User Module
- Linked Modules
- Admin: Workflows UI
- Admin: Vite build-tooling
- Admin: UI + UX revamp
- Index Engine
- Rest API V2 (using workflows)
Planned (non-exhaustive)
- API keys Module
- Taxes Module
- Store Module
- Notification Module
- Order Module
Features
- feat(customer): list customer by @srindom in #6206
- feat(medusa): Use remote query in get cart API route by @olivermrbl in #6285
- feat(customer): store addresses by @srindom in #6283
- feat(customer): manage default address selection by @srindom in #6295
- feat(modules-sdk): Module provider plugin loader by @olivermrbl in #6286
- feat(customer): add migration file by @srindom in #6205
- feat(authentication, types): split authenticate method into two by @pKorsholm in #6184
- feat(customer): add customer addresses by @srindom in #6224
- feat(cart): JoinerConfig by @olivermrbl in #6157
- feat: sales channel module by @fPolic in #5923
- feat(medusa, stock-location, types): Add q and order params to list-stock-locations by @pKorsholm in #6197
- feat(authentication, types, utils): Add Authentication provider scopes by @pKorsholm in #6228
- feat(auth): Rename authentication to auth by @pKorsholm in #6229
- feat(cart): Migration file by @olivermrbl in #6156
- feat(): added compute actions for buyget promotions by @riqwan in #6255
- feat(customer): admin CRUD endpoints by @srindom in #6232
- feat(cart):
GET /store/carts/:id
by @olivermrbl in #6262 - feat(auth, medusa): Initial auth module middleware by @pKorsholm in #6271
- feat(dashboard): Users domain by @kasperkristensen in #6212
- feat(customer): add customer group management apis by @srindom in #6233
- feat(customer): admin addresses by @srindom in #6235
- feat(customer): add customer group customer management by @srindom in #6276
- feat(customer): Add create and retrieve customer from store side by @srindom in #6267
- feat(types): added computed actions for automatic promotions by @riqwan in #6272
- feat(auth): add authentication endpoints by @pKorsholm in #6265
- feat(): added percentage calculations for all cases by @riqwan in #6300
- feat(dashboard): DataTable component by @kasperkristensen in #6297
- feat(auth): Make token auth default by @pKorsholm in #6305
- feat(medusa-react): Add
medusaClient
as an input toMedusaProvider
by @erikengervall in #6299 - feat(dashboard): Log in, reset password, and accept invite pages by @kasperkristensen in #6310
- feat: event aggregator by @carlos-r-l-rodrigues in #6218
- feat(cart):
POST /store/carts
by @olivermrbl in #6273 - feat: Region Module (basic CRUD) by @olivermrbl in #6315
- feat(user): Init user module by @pKorsholm in #6293
- Feat(auth): Remove auth provider entity by @pKorsholm in #6314
- feat(payment): payment and session methods by @fPolic in #6138
- feat: Fulfillment module basic structure by @adrien2p in #6319
- feat(region): Add migration by @olivermrbl in #6320
- feat(medusa): Allow configuring of staged job polling batch size by @olivermrbl in #6333
Bugs
- fix: improve error message on incorrect service export by @srindom in #6240
- fix(authentication): remove providers loader by @pKorsholm in #6257
- fix(medusa): add support for
order
field on GET /admin/orders by @kasperkristensen in #6258 - fix(admin-ui) Refactor
use-copy-promotion
to map product IDs by @erikengervall in #6306 - fix: load custom modules by path by @carlos-r-l-rodrigues in #6312
- fix(medusa): fix constructor container type for abstract services by @shahednasser in #6259
Documentation
- docs: add a section on custom templates in SendGrid guide by @shahednasser in #6215
- docs: change process for generating docblocks through actions by @shahednasser in #6237
- docs: refactoring of docblock generator tool by @shahednasser in #6261
- docs: fix title of the configuration page by @shahednasser in #6268
- docs: s3 The "images.domains" configuration is deprecated by @xyzones in #6321
- docs: Update all curl documentation examples and references with new x-medusa-access-token header by @irab in #6326
- docs: Typo Cart -> Card by @herawais in #6302
- docs: update link to io-redis options by @sidcool1234 in #6337
Chores
- chore: PR team labeler by @olivermrbl in #6249
- chore(core-flows): reorganize folder structure for promotion workflows by @riqwan in #6243
- chore: Abstract module service by @adrien2p in #6188
- chore: local workflow proxying methods to pass context by @carlos-r-l-rodrigues in #6263
- chore(cart): Clean up data models by @olivermrbl in #6256
New Contributors
- @herawais made their first contribution in #6302
- @xyzones made their first contribution in #6321
- @irab made their first contribution in #6326
Full Changelog: v1.20.1...v1.20.2
v1.20.1
Highlights
Segment plugin update: Typescript support and Subscribers API
Landed in #5904.
SendGrid plugin update: Custom templates support
Landed in #5833.
Axios adapter support in @medusajs/medusa-js
Landed in #6214.
Improved deployment guides
Landed in #6183.
API Routes for Medusa v2
Core API Routes (located in packages/medusa/src/api
) are not registered when Medusa v2 feature flag is enabled.
And to repeat, all changes behind Medusa v2 are very unstable, highly experimental, and a work in progress at this point, so we do not encourage the use of the feature flag yet.
Follow our development toward Medusa v2 in our roadmap.
Features
- feat(cart): Public-facing DTOs + (partial) module interface by @olivermrbl in #6000
- feat(cart): Cart + Address services by @olivermrbl in #6055
- feat: Payment module package setup by @fPolic in #6059
- feat(cart): Partial module service implementation by @olivermrbl in #6012
- feat(utils,types): added item/shipping adjustments for order/items/shipping_methods by @riqwan in #6050
- feat(utils,types): campaigns and campaign budgets + services CRUD by @riqwan in #6063
- feat(dashboard,ui): Streamline spacing and sizing by @kasperkristensen in #6061
- feat(utils): add campaign + promotion create / update by @riqwan in #6077
- feat(dashboard): add customers domain by @kasperkristensen in #6093
- feat(cart): Line items operations by @olivermrbl in #6066
- feat(utils,types): add registerUsages for promotions + computeActions consider usage by @riqwan in #6094
- feat: Payment module models by @fPolic in #6065
- feat: Payment module interface by @fPolic in #6092
- feat(medusa,types): add promotion list/get endpoint by @riqwan in #6110
- feat: customer module skeleton by @srindom in #6126
- feat(medusa,utils): added campaign get endpoints by @riqwan in #6125
- feat(cart): Line item adjustments by @olivermrbl in #6112
- feat(payment): PaymentCollection CRUD by @fPolic in #6124
- feat(cart): Shipping method adjustments by @olivermrbl in #6119
- feat(customer): Introduce customer group by @srindom in #6137
- feat(core-flows,medusa,utils): promotion and campaign create/update endpoint by @riqwan in #6130
- feat(customers): add delete and update by @srindom in #6148
- feat(medusa,types,core-flows,utils): added delete endpoints for campaigns and promotions by @riqwan in #6152
- feat(customer): add remove from group, update group by @srindom in #6158
- feat(modules-sdk): Run hooks on application start by @pKorsholm in #6111
- feat(cart): Shipping methods by @olivermrbl in #6101
- feat(cart): Add line items in cart-creation by @olivermrbl in #6114
- feat(dashboard): 3.0 product collection by @kasperkristensen in #6120
- feat(dashboard): Customer groups domain by @kasperkristensen in #6098
- feat(authentication): username password provider by @pKorsholm in #6052
- feat(utils): update joiner config for campaigns by @riqwan in #6161
- feat(workflows-sdk): run, registerStepSuccess and registerStepFailure shortcut by @adrien2p in #6164
- feat: Workflow engine modules by @carlos-r-l-rodrigues in #6128
- feat(medusa,types): added buyget support for modules by @riqwan in #6159
- feat(dashboard): Pub Api Key domain by @kasperkristensen in #6162
- feat(authentication): Google authentication provider by @pKorsholm in #6104
- feat(cart): Item tax lines + shipping method tax lines by @olivermrbl in #6136
- feat(modules): Add initModule util by @pKorsholm in #6200
- feat(medusa-oas-cli): updated redocly-cli to v1.7 by @shahednasser in #6211
- feat(customer): add softdelete/restore by @srindom in #6203
- feat(medusa-js): add axios adapter to config by @SirRodney in #6214
Bugs
- fix: migrate segment subscribers + typescript support by @srindom in #5904
- fix: eslint configurations in the root by @shahednasser in #6049
- fix(admin-ui->Collections): add key for map fn. resolve #6106 by @wangjue666 in #6107
- fix(medusa): ensure transaction is reused when service calls itself by @srindom in #6089
- fix(modules-sdk): create workflow returning step transformer by @carlos-r-l-rodrigues in #6102
- fix(docs): update extend repository by @vinhnguyen1211 in #6140
- fix(medusa-js): correct invites resend path in js client by @lukebui in #6155
- fix(medusa-plugin-sendgrid): Support custom templates by @SGFGOV in #5833
- fix(medusa): Implement listAndCount for UserService and update list endpoint by @kasperkristensen in #6190
- fix(medusa): Support q search and order in list regions by @olivermrbl in #6202
- fix(medusa): Support q search in currencies by @olivermrbl in #6201
- fix(medusa): List Users return type by @kasperkristensen in #6204
- fix(medusa): GET /admin/shipping-options params by @kasperkristensen in #6208
Chores
- chore(utils, product): Attempt to simplify module scripts export by @adrien2p in #6021
- chore: abstract the modules repository by @adrien2p in #6035
- chore: Hide repository creation if they are not custom + add upsert support by default by @adrien2p in #6127
- chore(admin-ui): add key for gift-cards table cells map fn by @wangjue666 in #6154
- chore(docs-util): change freshness check threshold by @shahednasser in #6122
- chore: use loaded module reference by @carlos-r-l-rodrigues in #5763
- chore(utils): Update base repository to infer primary keys and support composite by @adrien2p in #6062
- chore: Abstract module services by @adrien2p in #6087
Documentation
- docs: documentation updates for v1.20 by @shahednasser in #6031
- docs: update dependencies by @shahednasser in #6046
- docs: typo backendUrl default url by @wangjue666 in #6073
- docs: fix example of createFulfillment by @shahednasser in #6088
- docs: add new troubleshooting section for create-medusa-app by @shahednasser in #6071
- docs: added link to next.js starter demo by @shahednasser in #6108
- docs: Update environment variables to match Railway variable references format by @peyronoscar in #6145
- docs: improve admin documentation by @shahednasser in #6117
- docs: change sidebar title for Event by @shahednasser in #6134
- docs: migrate guides to TSDoc references by @shahednasser in #6100
- docs: fix production build error by @shahednasser in #6170
- docs: rearrange sections in SendGrid guide by @shahednasser in #6165
- docs: update strapi guide by @shahednasser in #6163
- docs: improvements to deployment guides by @shahednasser #6183
- docs: add anchor link to reference parameters by@shahednasser in #6194
- docs-util: created docblock-generator tool by @shahednasser in #6096
- docs(docblock-generator): fix action Node version by @shahednasser in #6207
New Contributors
- @wangjue666 made their first contribution in #6073
- @vinhnguyen1211 made their first contribution in #6140
- @peyronoscar made their first contribution in #6145
- @lukebui made their first contribution in #6155
Full Changelog: v1.20.0...v1.21.0
v1.20.0
Highlights
Improved Stripe plugin architecture + webhook
🚧 Breaking change in
medusa-plugin-stripe
Two important changes have been introduced to the Stripe plugin, one of which is breaking.
The endpoints and subscribers in the plugin have been migrated to use our new API Routes and Subscribers. This significantly lowers the code footprint of the package and makes it easier to maintain.
The webhook event management has changed significantly from in-band processing of the event to now using our Event Bus to process it as a background job. There were several motivations for this change: 1) it is deemed best practice to respond with a 200 immediately upon receiving a webhook request, 2) it allows for our retry mechanism to kick in in case the processing fails, and 3) it gives us more control of how the event is processed.
One example of the latter, effective from this release, is that we've added a 5s delay on processing events to avoid conflicts stemming from race conditions between the webhook and client requests.
Changed service checks from an instance of
to a static property check
🚧 Breaking change
Several issues have been filed related to failing registrations of different types of services, such as payment providers, fulfillment providers, and similar. The culprit to these issues was found in how we check the type of the service class.
Until now, we've relied on instance of
to perform the check:
export function isPaymentProcessor(obj: unknown): boolean {
return obj instanceof AbstractPaymentProcessor
}
However, if you have a version mismatch in your packages, the instance of
check will fail even though the services are seemingly the expected type.
With this release, the service class type checks are now performed with static properties to eliminate this issue:
static isPaymentProcessor(object): boolean {
return object?.constructor?._isPaymentProcessor
}
More robust and reliable cart completion
🚧 Important change
Our cart completion API has been updated to increase robustness and reliability - especially under high load. The update includes removing serializable transactions from the API and generally refactoring our transaction management.
As a positive side effect, the changes have also made for a more performant API.
Database schema changes
Minor changes to the schema of table publishable_api_key_sales_channel
have been introduced.
Please, apply the new migration by running the following command in your Medusa project after having updated:
npx @medusajs/medusa-cli migrations run
order by
queries on deeply nested relations
An issue with duplicated rows in the result set in order by
queries on deeply nested relations has been resolved.
Read more about the change in the PR description.
API reference for medusa-react
An API reference and examples for our medusa-react
library have been introduced to our documentation.
Admin translations
With this release, the following languages are supported in Medusa Admin: Simplified Chinese, Bulgarian, Slovenian, Czech, and Japanese.
Features
- feat(medusa): add currency to region responses by @riqwan in #5857
- feat(medusa): Update shipping option price type by @pKorsholm in #5895
- feat(medusa, link-modules): sales channel <> product module link by @fPolic in #5450
- feat(admin): Added Simplified Chinese support by @chrislaai in #5798
- feat(admin): Bulgarian language support by @edisaso in #5786
- feat(medusa): Slovenian(sl) translation by @glomon in #5828
- feat(workflows-sdk): Configurable retries upon step creation by @adrien2p in #5728
- feat(medusa): Prevent cart completion conflict by @adrien2p in #5814
- feat(admin): Add Czech language support by @hexrw in #5822
- feat(admin): Add Japanese language support by @hmmhmmhm in #5795
- feat(medusa-payment-stripe): Add delay to Stripe webhook by @olivermrbl in #5838
- feat(orchestration, workflows-sdk): Add events management and implementation to manage async workflows by @adrien2p in #5951
- feat(medusa, link-modules): sales channel <> pubkey link by @fPolic in #5820
- feat(pricing, types, utils): Soft delete pricing entities by @pKorsholm in #5858
- feat(medusa, link-modules): sales channel <> order link by @fPolic in #5810
- feat(types,utils): added promotion create with rules and application target rules by @riqwan in #5957
- feat(cart): Add cart module package by @olivermrbl in #5982
- Feat(medusa-test-utils, utils, pricing, product, link-modules): upgrade mikro orm version to latest by @pKorsholm in #5985
- feat(medusa, link-modules): sales channel <> cart link by @fPolic in #5459
- feat(workflows-sdk): Allow primitive values to be passed as well as WorkflowDataProperties by @adrien2p in #5953
- feat(types,utils): add promotions create with application method by @riqwan in #5945
- feat(workflows-sdk): Allow a step to not define an expected input by @adrien2p in #5775
- feat(types,modules-sdk): basic module setup for promotions by @riqwan in #5920
- feat(types,module-sdk): setup authentication module skeleton by @pKorsholm in #5943
- feat(types): promotion delete / update / retrieve / add/remove-rules by @riqwan in #5988
- feat(cart): Data models by @olivermrbl in #5986
- feat(admin): Add Libya admin region and set Libya to formal name by @abusaidm in #6001
- feat(authentication): Load auth providers by @pKorsholm in #6023
Bugs
- fix: redis_options for job scheduler by @kstoklosa in #5894
- fix(medusa): Passport loader resolving to early by @adrien2p in #5901
- fix: Typo in documentation by @aldo-roman in #5933
- fix(medusa, medusa-js): publishable api key bugs by @olivermrbl in #5926
- fix(medusa, pricing, types): pass dates as Date-objects rather than strings to the pricing module by @pKorsholm in #5768
- fix(utils): More resilient object from string path by @adrien2p in #5929
- fix(medusa-js): remove unnecessary
query
field inAdminInventoryItemsResource.deleteLocationLevel
method by @shahednasser in #5941 - fix(medusa): add payments default relation to getTotalsRelations by @cyf0e in #5875
- fix(medusa): Resolve babel executable with
npx
by @olivermrbl in #5952 - fix(medusa): Update cart sales channel should not remove all line items by @adrien2p in #5980
- fix(medusa-payment-stripe): fix error handling by @adrien2p in #5991
- fix(medusa): cart completion payment sessions by @adrien2p in #5995
- fix(medusa): Ordering management using joins and pagination by @adrien2p in #5990
- fix(medusa): Fix typo in discounts error message by @Sajarin-M in #5853
- fix(medusa-payment-stripe): change webhook environment variables to plugin options by@shahednasser in #6034
Chores
- chore(medusa, interfaces): Uniformise class checks by @adrien2p in #5869
- chore: refactored docs-util by @shahednasser in #5876
- chore(workflows): Use Node 16.14 in CLI workflow by @olivermrbl in #5993
- chore: move next admin packages to core repo by @kasperkristensen in #5983
- chore: add vercel config by @kasperkristensen in #6018
- chore(medusa, orchestration, utils, workflows-sdk): add transaction options support and cleanup by @adrien2p in #6020
- chore(docs-util): update typedoc to v0.25.7 by @shahednasser in #6032
Documentation
- docs: updates for v1.19 by @shahednasser in #5868
- docs: update docs changes for rules_count from number_rules by @riqwan in #5855
- docs: Add discount created event by @Arsenalist in #5850
- docs: fix upgrade guide release notes link by @shahednasser in #5879
- docs: update documentation websites by @shahednasser in #5882
- docs: added missing service...
v1.19.0
Highlights
Cart-completion strategy response
🚧 Breaking change
Attempting to complete an already completed cart will no longer return a 409 conflict. Instead, the order or swap associated with the completed cart is returned.
More specifically, the response will take one of the following two shapes:
// completing a regular cart
{
response_code: 200,
response_body: { data: order, type: "order" },
}
// completing a swap cart
{
response_code: 200,
response_body: { data: swap, type: "swap" },
}
node-redis
replaced with ioredis
for session management
🚧 Important change
Our default Express session store has been changed from node-redis
to ioredis
.
This was done in response to a request for higher configurability of the Redis client used for session management. It was decided to not only expose more options but simultaneously change the library to ioredis
to be consistent with other packages that use Redis, e.g. the Redis Event Bus + Redis Cache.
Add to cart performance improvements
The add-to-cart endpoint, POST /store/carts/:id/line-items
, has been refactored, improving performance and transaction management. The latter was done in response to some users experiencing issues with concurrent requests leading to database conflicts. The changes to transaction management in the endpoint should significantly reduce the risk of this issue occurring while improving performance.
Some rough benchmarks show that for 1000 requests (10-20/s), we see approx. 30% of requests fail due to database conflicts in the latest version. With this PR, 0% of requests fail – even under a higher load.
New cluster command added to @medusajs/medusa-cli
A new cluster command has been added to our CLI, @medusajs/medusa-cli
:
medusa start-cluster --cpus 3
The command allows you to start Medusa in cluster mode. By default, cluster mode will try to consume all available CPUs for Medusa instances. You can specify the number of CPUs with a CLI argument --cpus
.
Running in cluster mode will likely significantly improve performance as the workload and tasks are distributed among all available instances instead of a single one.
Retry support in medusa-react
🚧 Important change
You can now specify maxRetries
as a prop to the MedusaProvider
from medusa-react
. This config is passed on to the underlying medusa-js
client, which means failed requests are retried the amount of times specified by the param. If not provided, the maxRetries
defaults to 3.
import { MedusaProvider as Provider } from "medusa-react"
import { queryClient } from "../constants/query-client"
export const MedusaProvider = ({ children }) => {
return (
<Provider
queryClientProviderProps={{
client: queryClient,
}}
baseUrl={process.env.MEDUSA_BACKEND_URL}
maxRetries={2}
>
{children}
</Provider>
)
}
Features
- feat(link-modules, pricing, product, utils): Should be able to set some custom database config even in shared mode by @adrien2p in #5755
- feat(medusa): Respond with order when cart is already completed by @olivermrbl in #5766
- feat(medusa-cli): add monorepo support command develop by @driver005 in #5723
- feat(admin): Add Korean language support by @iweurman in #5769
- feat(medusa-payment-klarna): Add language variable by @edinskeja in #4483
- feat(medusa): Improve add line item to cart perf and transaction management + clustering start command by @adrien2p in #5701
- feat(medusa): Replace Node Redis with ioredis by @pepijn-vanvlaanderen in #5656
- feat(core-flows,pricing,medusa,pricing,types,utils): Price List Prices can have their own rules by @riqwan in #5752
- feat(medusa): Emit "discount.created" event when discount is created by @Arsenalist in #5816
- feat(orchestration,core-flows,medusa,product,types,utils): product import/export uses workflows by @riqwan in #5811
- feat(medusa, core-workflows, product): slightly improve create cart workflow by @adrien2p in #5725
- feat(admin-ui): metadata for categories in admin ui and refactor to react-hook-form by @luluhoc in #5697
Bugs
- fix(medusa): throw proper error when product doesn't exist w/ key header by @pKorsholm in #5745
- fix(modules-sdk): add graphql dependency to modules-sdk by @riqwan in #5750
- fix(medusa-react): Allow setting maxRetries on MedusaProvider by @kasperkristensen in #5765
- fix(ui): Bump cva and minor type fixes by @kasperkristensen in #5818
- fix(admin-ui): Bulk editor default fields by @kasperkristensen in #5829
- fix(medusa): Updating note doesn't require loading author relationship by @josetr in #5825
- fix(medusa): Product option values in CSV Export by @mortenengel in #5781
- fix(medusa): Order edit confirmation conflict line items update by @adrien2p in #5867
Docs
- docs: fix back link in Workflows API Reference by @shahednasser in #5740
- docs: updated user guide for product pricing by @shahednasser in #5744
- docs: fix back links for modules references by @shahednasser in #5747
- docs: updated next.js starter docs by @shahednasser in #5748
- docs: update pricing module docs with the latest changes by @riqwan in #5749
- docs: fix typo in onboarding by @shahednasser in #5802
- docs: search results template needs the product ids to fetch previews by @chrislaai in #5793
- docs: enhance how references are generated by @shahednasser in #5805
- docs: update algolia plugin next.js details by @shahednasser in #5807
- docs: added examples for modules usage in Medusa by @shahednasser in #5753
- docs: diagrams plugin tooling by @shahednasser in #5741
- docs: updated Next.js deployment guide by @shahednasser in #5756
- docs: TSDoc + reference of fulfillment by @shahednasser in #5761
- docs: added "Integrate Your Ecommerce Stack" recipe by @shahednasser in #5774
- docs(plugins): puts local-file plugin into correct category in site by @annikorp in #5804
- docs: update local events module to fix mistyped reference to redis events module by @ishaqkhattana in #5835
- docs: Fix multiple typos in medusa docs by @Sajarin-M in #5854
- docs: fixed sidebar in API reference by @shahednasser in #5871
- docs: update required Node.js version for Next.js starter by @shahednasser in #5859
- docs: generate documentation for UI components by @shahednasser in #5849
Chores
- chore(): Add engines to all package.json if needed by @adrien2p in #5812
- chore(medusa): Prefer logger instead of console.log by @adrien2p in #5846
New Contributors
- @driver005 made their first contribution in #5723
- @iweurman made their first contribution in #5769
- @chrislaai made their first contribution in #5793
- @annikorp made their first contribution in #5804
- @luluhoc made their first contribution in #5697
- @ishaqkhattana made their first contribution in #5835
- @Arsenalist made their first contribution in #5816
- @Sajarin-M made their first contribution in #5854
Full Changelog: v1.18.1...v1.19.0
v1.18.1
Highlights
Workflows (beta)
This release introduces Workflows to Medusa's toolbox for creating digital commerce applications.
Our new Workflows tooling is published under @medusajs/workflows-sdk
.
Workflows is in beta. Please help us improve the product and squash bugs by filing issues for the errors you encounter.
A workflow is a series of queries and actions that complete a task. You can think of Medusa as being made up of many workflows. For example, when adding line items to carts, we perform several actions:
- Get the product’s title
- Calculate the price of the product
- Create a line item
- Add the line item to a cart
All these actions are steps in a workflow.
Workflows can also be more advanced - like managing a return or processing an inbound purchase order.
You can explore and try our new Workflow tooling in our documentation.
Read more about Workflows on our blog.
Pricing Module
This release marks the completion of the first iteration of our Pricing Module - a standalone pricing service that enables granular pricing configurations.
The Pricing Module is published under @medusajs/pricing
.
You can use the Pricing Module separately from Medusa to enable advanced pricing logic for any resource specific to your needs.
The module is integrated into our core @medusajs/medusa
behind the feature flag medusa_v2
. All features behind this flag are deemed highly experimental as we move toward Medusa 2.0, so please use it with caution.
The feature flag medusa_v2
is not stable for production environments.
Read more about the Pricing Module and our plans for Medusa 2.0.
Product Variant pricing updates
The introduction of the Bulk Editor made it easy to update product variant prices.
With this release, we are centralizing product variant pricing in the Bulk Editor and removing all other entry points for operations related to pricing.
As a result, you can no longer modify prices of product variants in the following flows:
- Creating a product
- Adding a variant to a product
- Editing a variant of a product
You should use the "Edit Prices" option in the dropdown of the variants section:
Features
- feat(medusa,types,workflows,utils,product): PricingModule Integration of PriceLists into Core by @pKorsholm in #5536
- feat(workflows): Workflow DX by @carlos-r-l-rodrigues in #5607
- feat(admin-ui): Delete pricing forms from edit + create variant modals by @pKorsholm in #5676
- feat(workflows-sdk): get name method by @carlos-r-l-rodrigues in #5714
Bugs
- fix(pricing,types): remove is_dynamic from model + types by @riqwan in #5664
- fix(workflows): compensation handling by @adrien2p in #5691
- fix(ui): code block styles in @kasperkristensen in #5692
- fix(product, types, workflows): Update product variant workflow by @pKorsholm in #5668
- fix(medusa): Normalize subscriber paths by @kasperkristensen in #5703
- fix(pricing, medusa): resolve minor pricing-module bugs by @riqwan in #5685
- fix(medusa): Update default relations in admin for list-product from module by @pKorsholm in #5708
- fix(admin-ui): Fix issue with null product categories by @kasperkristensen in #5707
- fix(admin-ui): Edit prices requires at least one product by @kasperkristensen in #5710
- fix(medusa,pricing,types): rules only gets updated/deleted upon passing an explicit object by @riqwan in #5711
- fix(pricing, types): update calculatePrices return type to match actual type by @pKorsholm in #5709
- fix(medusa): pricing module list prices return type by @pKorsholm in #5715
- fix(admin-ui): Fix Y-axis scroll in bulk editor by @kasperkristensen in #5726
- fix(medusa,pricing): Fix migrations for existing databases by @riqwan in #5730
- fix(admin-ui): inventory item deletion when removing product by @pKorsholm in #5727
- fix(link-modules, utils): remove limits on queries when primary-key is provided by @pKorsholm in #5732
- fix(admin-ui): fix height of Bulk Editor cells to always be 40px by @kasperkristensen in #5737
Chores
- chore: update tsdocs of pricing module by @shahednasser in #5648
- chore: added TSDoc for workflow utility functions by @shahednasser in #5674
- chore(workflows, core-flows): Split workflows tooling and definitions by @adrien2p in #5705
Documentation
- docs: Add missing link to admin-guide on translations by @MedusaNick in #5665
- docs: added migration action to upgrade guide by @shahednasser in #5669
- docs: updated medusa develop command by @OmarMHawash in #5698
- docs: redesign tabs by @shahednasser in #5687
- docs: redesigned admonitions by @shahednasser in #5689
- docs: added a new document for available languages by @shahednasser in #5667
- docs: update Next.js starter main image by @shahednasser in #5702
New Contributors
- @OmarMHawash made their first contribution in #5698
Full Changelog: v1.18.0...v1.18.1
v1.18.0
Highlights
Subscriber API + Scheduled Jobs API
This release comes with an improved Subscriber API and a new Scheduled Jobs API. These are drastic improvements of the developer experience of setting up event subscribers and cron jobs.
Subscriber API
// src/subscribers/product-update-handler.ts
import type { SubscriberConfig, SubscriberArgs, ProductService } from "@medusajs/medusa"
export default async function productUpdateHandler({ data, eventName, container, pluginOptions }: SubscriberArgs) {
const productService: ProductService = container.resolve("productService")
const { id } = data
const product = await productService.retrieve(id)
// do something with the product...
}
export const config: SubscriberConfig = {
event: ProductService.Events.UPDATE
}
Scheduled Jobs API
// src/jobs/once-a-minute.ts
import type { ProductService, ScheduledJobConfig, ScheduledJobArgs } from "@medusajs/medusa"
export default async function handler({ container, data, pluginOptions }: ScheduledJobArgs) {
const productService: ProductService = container.resolve("productService")
const count = await productService.count()
console.log(`You have ${count} products`)
}
export const config: ScheduledJobConfig = {
name: "every-minute",
schedule: "* * * * *"
}
Read more about the new APIs in the PR details.
Breaking changes
Changes to feature flags
This version significantly changes the feature flags in our core @medusajs/medusa
. We've decided to replace all module-specific feature flags with one that encapsulates all the work around modularizing Medusa further.
The following feature flags no longer exist:
Name | Flag | Environment variable |
---|---|---|
Product Module | isolate_product_domain |
MEDUSA_FF_ISOLATE_PRODUCT_DOMAIN |
Pricing Module | isolate_pricing_domain |
MEDUSA_FF_ISOLATE_PRICING_DOMAIN |
These feature flags have been replaced with one capturing all work for Medusa V2, releasing next year:
Name | Flag | Environment variable |
---|---|---|
Medusa V2 | medusa_v2 |
MEDUSA_FF_MEDUSA_V2 |
Creating a NotificationService
The introduction of the new Subscriber API changes the recommended way to define the subscribers of a NotificationService. The recommended approach is to use a loader until our Subscriber API natively supports NotificationServices or we introduce a mechanism dedicated towards it.
Read more here.
Features
- feat(pricing,types): price list API + price calculations with price lists by @riqwan in #5498
- feat(workflows,medusa,utils): add medusa v2 feature flag by @riqwan in #5603
- feat(medusa): Alternative Subscriber API and new ScheduledJobs API by @kasperkristensen in #5624
- feat(medusa): Add metadata to Product Category by @bqst in #5599
Bugs
- fix: minor fixes to IconButton and Button documentation by @kasperkristensen in #5636
- fix(admin-ui): Preserve decimal numbers when locale uses commas by @kasperkristensen in #5641
- fix(admin-ui): sort supported languages alphabetically by @VariableVic in #5479
- fix(medusa): Add missing promiseAll import by @chemicalkosek in #5635
- fix(medusa): Error handling middleware should be applied when no config is exported by @kasperkristensen in #5634
- fix(medusa): Update wrapHandler so it also passes errors in non-async route handlers to the errorHandler middleware by @kasperkristensen in #5597
- fix(ui): Fixed CodeBlock line number width by @kasperkristensen in #5640
- fix(product): when running migrations, prevent exploding on isolated case by @riqwan in #5643
Chores
- chore: add missing error responses to currency OAS by @shahednasser in #5627
- chore: change code owners of docs-util directory by @shahednasser in #5626
- chore: add TSDocs for IStockLocationService by @shahednasser in #5631
- chore(types): Add TSDoc comments to IInventoryService by @shahednasser in #5630
Documentation
- docs: update docusaurus to v3 by @shahednasser in #5625
- docs: added troubleshooting for postgres docker container by @shahednasser in #5629
- docs: add note about ttl in redis cache module by @shahednasser in #5617
- docs: generate inventory and stock location references by @shahednasser in #5645
New Contributors
- @VariableVic made their first contribution in #5479
Full Changelog: v1.17.4...v1.18.0
v1.17.4
Highlights
Custom promiseAll
util
Transactions in Typeorm do not play well with Promise.all
when the operations contain nested promises. In case one of the operations fail i.e. reject the promise, all other operations are not guaranteed to be rolled back properly.
See #5529 for more context.
To mitigate this issue, we've introduced the promiseAll
util in @medusajs/utils
. It uses Promise.allSettled
under the hood, but has been wrapped to work like Promise.all
with a transaction rollback guarantee. See here.
You will use it like so:
import { promiseAll } from "@medusajs/utils"
import { TransactionBaseService } from "@medusajs/medusa"
class MyService extends TransactionBaseService {
async performTransactions() {
return await promiseAll([
// your operations....
])
}
}
API Routes BodyParser configuration
API Routes now support body-parser configuration.
You can opt-out:
export config = {
routes: [
{
matcher: "/webhooks/*",
bodyParser: false,
middlewares: [raw({ type: "application/json" })]
}
]
}
Or configure it with options:
export config = {
routes: [
{
matcher: "/webhooks/*",
bodyParser: { sizeLimit: 2000 } // in bytes
middlewares: [raw({ type: "application/json" })]
}
]
}
Design packages moved to monorepo
Our design packages, @medusajs/ui
, @medusajs/icons
, @medusajs/ui-preset
, have been moved to our monorepo to centralize issues and PRs.
Breaking changes
#5511 contains breaking changes in @medusajs/cache-redis
.
If option ttl
is 0 when calling .set
the attempt to add a cache entry is skipped.
Features
- feat(medusa, modules-sdk, types, utils): Re work modules loading and remove legacy functions by @adrien2p in #5496
- feat(product, pricing, utils): Transaction issues and reference issues by @adrien2p in #5533
- feat(utils): Introduce promiseAll util by @adrien2p in #5543
- feat(create-medusa-app): print error message for failed db connection by @egormkn in #5547
- feat(medusa): API routes body parser config by @kasperkristensen in #5537
- feat(medusa): Include Product Collections in Seed command by @adamlamaa in #5510
Bugs
- fix(integration): setup by @adrien2p in #5511
- fix(admin-ui): Make regions in tax setting scrollable by @kasperkristensen in #5530
- fix(admin-ui): Prevent oversized product request in Price List domain by @kasperkristensen in #5535
- fix(admin-ui): Prevent comma decimal separator from converting inputs to NaN by @kasperkristensen in #5566
- fix(admin-ui, ui): Align @types/react versions across UI packages by @kasperkristensen in #5596
- fix(medusa): Load legacy modules entities by @adrien2p in #5594
- fix(admin-ui): Admin UI: Invalid Request Header by @rick-lam in #5548
Chores
- chore(docs-util): fix freshness check script by @shahednasser in #5518
- chore: Update README.md by @srindom in #5517
- chore(docs): Removed Docs Announcement Bar (automated) by @github-actions in #5574
- chore(ui,icons,ui-preset,toolbox): Move design system packages to monorepo by @kasperkristensen in #5470
Documentation
- docs(create-scheduled-job): rewrote sentence by @stefanoschalkidis in #5525
- docs(create-events-module): fixed typos by @stefanoschalkidis in #5524
- docs(create tax provider): tax line code required by @nickmonad in #5540
- docs(api-reference): added local server to list of servers by @shahednasser in #5572
- docs: add missing mime_type in digital products recipe by @shahednasser in #5569
New Contributors
- @stefanoschalkidis made their first contribution in #5525
- @egormkn made their first contribution in #5547
- @nickmonad made their first contribution in #5540
- @rick-lam made their first contribution in #5548
- @adamlamaa made their first contribution in #5510
Full Changelog: v1.17.3...v1.17.4