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