We’re excited to share the first Release Candidate (RC) of Medusa 2.0. By definition, release candidates are not production-ready. There are likely still minor issues across our packages, which is part of the reason for publishing a pre-release of the official version.
We welcome feedback, questions, and bug reports. Please use Issues to submit your input.
Get started with a new project
To get started using the RC, run the following command:
npx create-medusa-app@rc
This command will create a new Medusa project with our redesigned admin and a 2.0-compatible Next.js storefront. The Medusa application and the Next.js storefront are separate projects in separate folders.
Highlights
Please note, the following highlights are based on changes that have landed between the last preview release update and this release candidate.
We will cover all new changes to Medusa 2.0 in the official release notes. For now, you can refer to previous preview release updates to see what's new.
Package restructuring
Warning
Breaking change
With the announcement of the first Release Candidate, we decided to perform some housekeeping tasks and arrange our packages/dependencies. This is the last larger breaking change before the official release of 2.0.
Our goal with this change is to reduce the footprint of multiple packages within your application. Instead, we expose all the core-level utilities via the @medusajs/framework
package and all commerce features via the @medusajs/medusa
package.
As a result, you will have fewer dependencies to install and upgrade with every change. We will also be able to restructure things internally without impacting outside usage.
Dependencies
Moving forward, the dependencies inside a fresh Medusa application's package.json
file will look as follows:
{
"dependencies": {
"@medusajs/admin-sdk": "rc",
"@medusajs/framework": "rc",
"@medusajs/medusa": "rc",
"@medusajs/medusa-cli": "rc",
"@mikro-orm/core": "5.9.7",
"@mikro-orm/knex": "5.9.7",
"@mikro-orm/migrations": "5.9.7",
"@mikro-orm/postgresql": "5.9.7",
"awilix": "^8.0.1",
"pg": "^8.13.0"
},
"devDependencies": {
"@mikro-orm/cli": "5.9.7",
"@swc/jest": "^0.2.36",
"medusa-test-utils": "rc",
"jest": "^29.7.0",
"@types/node": "^20.0.0",
"@swc/core": "1.5.7",
"ts-node": "^10.9.2",
"typescript": "^5.6.2",
"@types/react": "^18.3.2",
"@types/react-dom": "^18.2.25",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"vite": "^5.2.11"
},
}
You don't have to install individual modules since they are all bundled and distributed via the @medusajs/medusa
package.
TSConfig file changes
Now that most packages have been bundled into @medusajs/medusa
and `@medusajs/framework, importing from the transitive dependencies should be done with subpaths.
For example, this is how a link definition will look like:
import HelloModule from "../modules/hello"
- import ProductModule from "@medusajs/product"
+ import ProductModule from "@medusajs/medusa/product"
- import { defineLink } from "@medusajs/utils"
+ import { defineLink } from "@medusajs/framework/utils"
export default defineLink(
ProductModule.linkable.product,
HelloModule.linkable.myCustom
)
In the above example, we import the product
module from the @medusajs/medusa/product
subpath and the defineLink
from the @medusajs/framework/utils
subpath.
To use subpath imports, the moduleResolution
should be set to Node16 inside the tsconfig.json file:
{
"module": "Node16",
"moduleResolution": "Node16",
}
medusa-config.js
file changes
With the introduction of subpath imports, the module registration in medusa-config.js
should similarly use subpaths instead of top-level paths.
For example, this is how you would register the authentication module:
defineConfig({
// ...
modules: {
- resolve: "@medusajs/auth",
+ resolve: "@medusajs/medusa/auth",
options: {
providers: [
{
- resolve: "@medusajs/auth-emailpass",
+ resolve: "@medusajs/medusa/auth-emailpass",
id: "emailpass",
options: {
// provider options...
},
},
],
},
},
})
Notice the change from @medusajs/auth
to @medusajs/medusa/auth
and @medusajs/auth-emailpass
to @medusajs/medusa/auth-emailpass
.
Features
- feat(index): Index module foundation by @adrien2p in #9095
- feat(dashboard): manage inventory placeholder by @fPolic in #9190
- feat(index): Provide a similar API to Query by @adrien2p in #9193
- feat(dashboard): login and invite redesign by @fPolic in #9214
- feat(core-flows,dashboard,types,fulfillment,medusa): uses requires shipping throughout lifecycle by @riqwan in #9170
- feat(utils): define read only link by @carlos-r-l-rodrigues in #9254
- feat(medusa,fulfillment): pass stock location data to fulfillment provider by @srindom in #9322
- feature: bundle all modules by @thetutlage in #9324
Bugs
- fix(workflow-sdk): Use the correct event group ID from the flow metadata by @adrien2p in #9177
- fix(workflow-engine-*): pass container to flow by @carlos-r-l-rodrigues in #9180
- fix(medusa-test-utils): get port should a deps for now by @adrien2p in #9198
- fix(dashboard): open edit variant modal in current context by @fPolic in #9203
- fix(types): fixes to HTTP types by @shahednasser in #9189
- fix(oas): support additional props, fix circular references patch, and other fixes by @shahednasser in #9213
- fix(oas): handle new keys in circular reference patch by @shahednasser in #9218
- fix(user): check if user account with email already exist on invite create by @fPolic in #9243
- fix(dashboard): PL creation - customers table customers count by @fPolic in #9237
- fix(dashboard): prices validation in PL bulk editor by @fPolic in #9245
- fix(dashboard): minor collection bugs by @fPolic in #9255
- fix(dashboard): customer groups table fileds by @fPolic in #9262
- fix(dashboard): customer groups fixes by @fPolic in #9258
- fix(dashboard): pagination in invite table by @fPolic in #9259
- fix(core-flows): line item type collection by @carlos-r-l-rodrigues in #9251
- fix(pricing): calculate pricing repository query by @fPolic in #9265
- fix: Add missing await when refetching region by @sradevski in #9283
- fix(orchestration): Throw if not exists using filters by @adrien2p in #9275
- fix: add missing dependency to utils package by @thetutlage in #9297
- fix: Add actor type to password reset event by @sradevski in #9301
- fix(modules-sdk): Fix dynamic import usage by @adrien2p in #9304
- fix(dashboard): login alert background by @fPolic in #9305
- fix(types): remove BigNumberValue usages in http types by @shahednasser in #9285
- fix: Generated types interface name by @adrien2p in #9307
- fix: base tsconfig by @adrien2p in #9309
- fix(types, medusa): fixes to HTTP types by @shahednasser in #9273
- fix(modules-sdk): default db options by @carlos-r-l-rodrigues in #9313
- fix(dashboard): set/unset automatic taxes on a region by @fPolic in #9315
- fix(types): fix order DTO types by @shahednasser in #9323
- fix(dashboard): variant update success toast by @fPolic in #9325
- fix(create-medusa-app): fix publishable api key not saving in .env.local by @shahednasser in #9328
- fix: Bind abort controller to abort in sdk by @sradevski in #9341
- fix: remove dist access for modules in integration tests by @adrien2p in #9336
- fix(core-flows): shipping options for cart by @carlos-r-l-rodrigues in #9343
- fix: validate regions exist for shipping option price update by @srindom in #9364
- fix: Tax region + rates clean up by @olivermrbl in #9279
- fix: force string compare by @srindom in #9360
- fix(medusa): Instrumentation resolution by @adrien2p in #9368
- fix(dashboard): product table colum widths by @fPolic in #9329
- fix(medusa,dashboard): don't send price updates for deleted regions/currencies by @srindom in #9361
- fix: Update tax lines on cart when region changes by @olivermrbl in #9367
- fix: Use correct propname for stroke opacity by @sradevski in #9331
- fix: db:rollback and db:generate commands to cast module names to arrays by @thetutlage in #9377
- fix: Pass order object to create fulfillment by @sradevski in #9391
- fix(dashboard): don't prefil invite email while onboarding by @fPolic in #9392
- fix(medusa): Replace default http tracer by @adrien2p in #9390
- fix(dashboard): reservations quantity validations by @fPolic in #9393
- fix(dashboard): categories add products by @fPolic in #9380
- fix: Correctly reference job hander in loader by @sradevski in #9396
Documentation
- docs: customization chapter exploration by @shahednasser in #9078
- docs: improvements and fixes to API route docs by @shahednasser in #9197
- docs: fix link in sidebar for modules test example by @shahednasser in #9195
- docs: add an examples list documentation by @shahednasser in #9194
- chore(oas): [11/n] improve oas schemas by @shahednasser in #9188
- chore(oas): [12/n] improve oas schemas by @shahednasser in #9200
- chore(oas): [10/n] improve oas schemas by @shahednasser in #9167
- chore(oas): [14/n] improve OAS schemas by @shahednasser in #9202
- docs: fix attribute name in calculated price by @shahednasser in #9215
- docs: updates to digital product recipe by @shahednasser in #9165
- docs: improvements + additions to workflow docs by @shahednasser in #9182
- docs: change navbar items + breadcrumb improvements by @shahednasser in #9209
- docs: improve search to show results for all filters by @shahednasser in #9208
- chore(oas): [13/n] improve oas schemas by @shahednasser in #9201
- Fix: Correct module path and clarify config structure in Medusa v2 Docs by @aqeebpathan in #9222
- Fix: Install command for Vercel deployment documentation by @aqeebpathan in #9270
- chore(): Update modules deps by @adrien2p in #9286
- docs: added architecture documentation by @shahednasser in #9256
- docs: fixes to customization docs by @shahednasser in #9236
- chore(oas): [16/n] improve oas schemas by @shahednasser in #9272
- oas: [15/n] improve oas schemas by @shahednasser in #9216
- docs: add note about authentication opt out by @shahednasser in #9298
- chore(oas): [17/n] improve OAS schemas by @shahednasser in #9284
- docs: document InferTypeOf by @shahednasser in #9321
- chore(oas): [19/n] improve oas schemas by @shahednasser in #9317
- chore(oas): [18/n] improve oas schemas by @shahednasser in #9311
- chore(oas): [20/n] improve oas schemas by @shahednasser in #9337
- docs-util: fixes following packages reorg by @shahednasser in #9326
- chore(oas): [21/21] improve oas schemas by @shahednasser in #9339
Chores
- chore: Cleanup manager decorator usage by @adrien2p in #9181
- chore(): Handle medusa service base methods events by @adrien2p in #9179
- chore: Add stale bot by @olivermrbl in #9184
- chore(link-modules): fulfillment order fieldAlias by @carlos-r-l-rodrigues in #9185
- chore(orchestrator): remote joiner using entitymap by @carlos-r-l-rodrigues in #9205
- fix(framework): throw when middleware fails to register by @riqwan in #9211
- refactor(modules-sdk): Align configuration and fixes by @adrien2p in #9239
- refactor(orchestration): Align configuration and fixes by @adrien2p in #9242
- chore: Cleanup utils package by @thetutlage in #9238
- Chore: cleanup workflows SDK by @thetutlage in #9244
- refactor(types): Align configuration and fixes by @adrien2p in #9240
- chore: upgrade moduleResolution to Node16 by @thetutlage in #9269
- chore(): Remove default limit from the build query by @adrien2p in #9257
- chore(): Move dependencies around by @adrien2p in #9278
- chore: notify slack on failed release by @riqwan in #9287
- chore: notify slack on failed release by @riqwan in #9289
- chore: Add missing changeset for index by @olivermrbl in #9288
- chore: Move graphl to a single place by @adrien2p in #9303
- chore: remove direct usage from graphql by @adrien2p in #9316
- chore: perform dependencies scan and fix all dependencies by @thetutlage in #9296
- Chore/framework sub path by @adrien2p in #9253
- chore: Add support for module dependencies configuration by @adrien2p in #9330
- chore(utils): Cleanup and improve message aggregator by @adrien2p in #9300
- chore(modules-sdk): load modules in sequence by @carlos-r-l-rodrigues in #9327
- chore: Improve jest config and deps by @adrien2p in #9318
- chore: Improve instrumentation loading by @adrien2p in #9378
- chore: Add import from framework types at the top of ay generated types file by @adrien2p in #9389
Other Changes
- refactor(framework): Align configuration and fixes by @adrien2p in #9246
- chore(medusa-test-utils): Add custom link loading before syncing by @adrien2p in #9249
- chore(types): is_return on shipping options by @carlos-r-l-rodrigues in #9352
- fix: invalid mutation for product media gallery by @joekendal in #9371
New Contributors
- @aqeebpathan made their first contribution in #9222
- @joekendal made their first contribution in #9371
Full Changelog: v2.0.10-preview...v2.0.0-rc