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.
Update existing project
Ensure your Medusa dependencies in package.json
are using the rc
tag:
{
"dependencies": {
"@medusajs/admin-sdk": "rc",
"@medusajs/framework": "rc",
"@medusajs/medusa": "rc",
"@medusajs/medusa-cli": "rc",
...
}
}
To ensure an upgrade to a new version is completed correctly, run the following sequence of commands:
rm -rf node_modules
rm yarn.lock // or package-lock.json
yarn // If you are using yarn berry, you need to create the lock-file first
Highlights
Package restructuring
Warning
Breaking change
This release comes with the final package restructuring, mainly dealing with consistent package names.
The following packages have been renamed:
@medusajs/medusa-cli
->@medusajs/cli
@medusajs/stock-location-next
->@medusajs/stock-location
@medusajs/inventory-next
->@medusajs/inventory
@medusajs/file-local-next
->@medusajs/file-local
medusa-telemetry
->@medusajs/telemetry
medusa-test-utils
->@medusajs/test-utils
This is a breaking change, and to upgrade, please update your dependencies as follows:
- Replace
medusa-test-utils
with@medusajs/test-utils
in your project - Replace
@medusajs/medusa-cli
with@medusajs/cli
in your project
Standardize provider ID generation
Warning
Breaking change
We have cleaned up some inconsistencies and legacy code in the provider domain, which has led to breaking changes.
- Module providers should no longer have a static property
PROVIDER
– this has been replaced withidentifier
- Module providers should have a static property
identifier
describing the name of the provider - Module providers' container registration name have changed format
Before
const key = `pp_[PROVIDER]_[id]`
id
being the id specified in the module provider configuration inmedusa-config.js
PROVIDER
being the property described above, that has now been removed
After
const key = `pp_[identifier]_[id]`
id
being the id specified in the module provider configuration inmedusa-config.js
- If this is not specified, we omit it from the registration key*
identifier
being the property described above, that replacedPROVIDER
*Previously, we did not omit the id
if it wasn't specified, which meant registration keys contained undefined
. For example:
pp_stripe-ideal_undefined
Aside from having a new name in the dependency container, these changes will also affect the payment providers stored in the database. They are stored using the registration key described above, so consequently, they will be loaded anew the first time you boot up your application after upgrading to this version.
Let's consider an example provider configuration of Stripe with an explicit id
:
{
id: "stripe-usd",
resolve: "@medusajs/payment-stripe",
options: { ... }
}
If Stripe providers were enabled, they used to be stored with the following IDs in the database:
pp_stripe_stripe-usd
pp_stripe-ideal_stripe-usd
pp_stripe-bancontact_stripe-usd
...
Those IDs will now be:
pp_stripe_stripe-usd
pp_stripe-ideal_stripe-usd
pp_stripe-bancontact_stripe-usd
...
Let's consider an example provider configuration of Stripe without an explicit id
:
{
resolve: "@medusajs/payment-stripe",
options: { ... }
}
If Stripe providers were enabled, they used to be stored with the following IDs in the database:
pp_stripe_undefined
pp_stripe-ideal_undefined
pp_stripe-bancontact_undefined
...
Those IDs will now be:
pp_stripe
pp_stripe-ideal
pp_stripe-bancontact
...
These changes will affect all created payment sessions on carts, as the provider specified upon creation no longer exists.
Form submission in Admin
Form submissions in Admin now require CMD + Enter
on MacOS or CTRL + Enter
on Windows. This makes for a more intentional action and prevents incorrect submissions.
Features
- breaking: rename package names to be consistent and under @medusajs scope by @thetutlage in #9580
- feat(core-flows): cart events by @carlos-r-l-rodrigues in #9585
- feat(dashboard): Submit forms on Cmd + Enter by @kasperkristensen in #9623
- feat(core-flows,types,medusa): Add tax region update API by @riqwan in #9634
- fea(providers): locking postgres by @carlos-r-l-rodrigues in #9545
- feat(medusa): ordem items endpoint by @carlos-r-l-rodrigues in #9646
- feat: allow html content for notifications by @christiananese in #9613
- feature: use application logger to log HTTP requests by @thetutlage in #9655
- feat(dashboard) taxes + discount breakdown by @fPolic in #9586
Bugs
- fix(dashboard): Set correct method value on promotion by @riqwan in #9610
- fix(dashboard): FF return reason table by @fPolic in #9614
- fix(utils): Mikro orm joined selection issue when select-in strategy by @adrien2p in #9615
- fix(modules-sdk): Add missing paths to require.resolve in load resources by @adrien2p in #9608
- fix(product): options validation if ids are same by @fPolic in #9622
- fix(dashboard,ui): Fix outline flash on FocusModal by @kasperkristensen in #9624
- fix: Add free text search on reservations by @olivermrbl in #9621
- fix(dashboard): cleanup Payments section by @fPolic in #9520
- fix(dashboard): Fix styling of nested NavLinks by @kasperkristensen in #9637
- fix(dashboard): Ensure all progress tabs are 200px wide by @kasperkristensen in #9644
- fix(ui): Fix Avatar styling by @kasperkristensen in #9645
- fix(core-flows, types): general fixes to types and tsdocs by @shahednasser in #9633
- fix(types): change options to be required in http type by @shahednasser in #9642
- fix(dashboard): Hide usage insights by @kasperkristensen in #9651
- test(admin-vite-plugin): React Invalid hook call on Windows by @kasperkristensen in #9647
- Fix/production logging by @thetutlage in #9658
- fix(orchestration): local workflow proxy by @carlos-r-l-rodrigues in #9664
- fix: resolve paths using require.resolve by @thetutlage in #9665
Documentation
- docs: added examples page by @shahednasser in #9587
- docs: improved commerce modules [5/5] by @shahednasser in #9592
- docs: fix heroku typo by @shahednasser in #9382
- docs: update providers to use ModuleProvider by @shahednasser in #9579
- Switch the headings to match the content by @erickirt in #9619
- fix(docs): update workflow API example to include query parameter by @VrajPatelK in #9640
- docs: update curl request to /admin/products by @shahednasser in #9641
- docs-util: add configuration to generate js-sdk reference by @shahednasser in #9630
- docs: add routing page by @shahednasser in #9550
- docs: document JS SDK installation by @shahednasser in #9611
Chores
- chore(medusa): default endpoints size limit by @carlos-r-l-rodrigues in #9616
- chore: Prepare changeset for 2.0 release by @olivermrbl in #9631
- feat(medusa): Display admin url on start by @adrien2p in #9643
- chore(js-sdk): add ignore tsdoc tag to client and constructor of inner classes by @shahednasser in #9635
- chore: remove internal module resources option by @carlos-r-l-rodrigues in #9582
- chore: Update modules providers configuration with 'identifier' and 'PROVIDER' by @adrien2p in #9636
New Contributors
- @VrajPatelK made their first contribution in #9640
Full Changelog: v2.0.0-rc.6...v2.0.0-rc.7