v2.0.0-rc.7
medusajs/medusav2.0.0-rc.7Oct 18, 2024by olivermrbl
AI Summary
Release Candidate 7 finalizes package restructuring and standardizes provider ID generation, along with changes to admin form submission behavior.
Key Highlights
- Final package restructuring with renamed packages (e.g., `medusa-cli` -> `cli`).
- Standardized provider ID generation replacing the `PROVIDER` static property.
- Admin forms now require Cmd/Ctrl+Enter to submit.
Breaking Changes
- Package renaming (e.g., `@medusajs/medusa-cli` -> `@medusajs/cli`)
- Provider ID generation changes affecting payment sessions stored in the database
New Features
- Cart events
- Tax region update API
- HTML content support for notifications
Full Release Notes
<!--

# Medusa v2.0 Release Candidate #7
CMS_BREAK -->
## Get started with a new project
To get started using the RC, run the following command:
```bash
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:
```json
{
"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:
```tsx
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 with `identifier`
- Module providers **should have** a static property `identifier` describing the name of the provider
- Module providers' container registration name have changed format
**Before**
```ts
const key = `pp_[PROVIDER]_[id]`
```
- `id` being the id specified in the module provider configuration in `medusa-config.js`
- `PROVIDER` being the property described above, that has now been removed
**After**
```ts
const key = `pp_[identifier]_[id]`
```
- `id` being the id specified in the module provider configuration in `medusa-config.js`
- If this is not specified, we omit it from the registration key*
- `identifier` being the property described above, that replaced `PROVIDER`
*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`:
```ts
{
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`:
```ts
{
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 https://github.com/medusajs/medusa/pull/9580
* feat(core-flows): cart events by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9585
* feat(dashboard): Submit forms on Cmd + Enter by @kasperkristensen in https://github.com/medusajs/medusa/pull/9623
* feat(core-flows,types,medusa): Add tax region update API by @riqwan in https://github.com/medusajs/medusa/pull/9634
* fea(providers): locking postgres by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9545
* feat(medusa): ordem items endpoint by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9646
* feat: allow html content for notifications by @christiananese in https://github.com/medusajs/medusa/pull/9613
* feature: use application logger to log HTTP requests by @thetutlage in https://github.com/medusajs/medusa/pull/9655
* feat(dashboard) taxes + discount breakdown by @fPolic in https://github.com/medusajs/medusa/pull/9586
## Bugs
* fix(dashboard): Set correct method value on promotion by @riqwan in https://github.com/medusajs/medusa/pull/9610
* fix(dashboard): FF return reason table by @fPolic in https://github.com/medusajs/medusa/pull/9614
* fix(utils): Mikro orm joined selection issue when select-in strategy by @adrien2p in https://github.com/medusajs/medusa/pull/9615
* fix(modules-sdk): Add missing paths to require.resolve in load resources by @adrien2p in https://github.com/medusajs/medusa/pull/9608
* fix(product): options validation if ids are same by @fPolic in https://github.com/medusajs/medusa/pull/9622
* fix(dashboard,ui): Fix outline flash on FocusModal by @kasperkristensen in https://github.com/medusajs/medusa/pull/9624
* fix: Add free text search on reservations by @olivermrbl in https://github.com/medusajs/medusa/pull/9621
* fix(dashboard): cleanup Payments section by @fPolic in https://github.com/medusajs/medusa/pull/9520
* fix(dashboard): Fix styling of nested NavLinks by @kasperkristensen in https://github.com/medusajs/medusa/pull/9637
* fix(dashboard): Ensure all progress tabs are 200px wide by @kasperkristensen in https://github.com/medusajs/medusa/pull/9644
* fix(ui): Fix Avatar styling by @kasperkristensen in https://github.com/medusajs/medusa/pull/9645
* fix(core-flows, types): general fixes to types and tsdocs by @shahednasser in https://github.com/medusajs/medusa/pull/9633
* fix(types): change options to be required in http type by @shahednasser in https://github.com/medusajs/medusa/pull/9642
* fix(dashboard): Hide usage insights by @kasperkristensen in https://github.com/medusajs/medusa/pull/9651
* test(admin-vite-plugin): React Invalid hook call on Windows by @kasperkristensen in https://github.com/medusajs/medusa/pull/9647
* Fix/production logging by @thetutlage in https://github.com/medusajs/medusa/pull/9658
* fix(orchestration): local workflow proxy by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9664
* fix: resolve paths using require.resolve by @thetutlage in https://github.com/medusajs/medusa/pull/9665
## Documentation
* docs: added examples page by @shahednasser in https://github.com/medusajs/medusa/pull/9587
* docs: improved commerce modules [5/5] by @shahednasser in https://github.com/medusajs/medusa/pull/9592
* docs: fix heroku typo by @shahednasser in https://github.com/medusajs/medusa/pull/9382
* docs: update providers to use ModuleProvider by @shahednasser in https://github.com/medusajs/medusa/pull/9579
* Switch the headings to match the content by @erickirt in https://github.com/medusajs/medusa/pull/9619
* fix(docs): update workflow API example to include query parameter by @VrajPatelK in https://github.com/medusajs/medusa/pull/9640
* docs: update curl request to /admin/products by @shahednasser in https://github.com/medusajs/medusa/pull/9641
* docs-util: add configuration to generate js-sdk reference by @shahednasser in https://github.com/medusajs/medusa/pull/9630
* docs: add routing page by @shahednasser in https://github.com/medusajs/medusa/pull/9550
* docs: document JS SDK installation by @shahednasser in https://github.com/medusajs/medusa/pull/9611
## Chores
* chore(medusa): default endpoints size limit by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9616
* chore: Prepare changeset for 2.0 release by @olivermrbl in https://github.com/medusajs/medusa/pull/9631
* feat(medusa): Display admin url on start by @adrien2p in https://github.com/medusajs/medusa/pull/9643
* chore(js-sdk): add ignore tsdoc tag to client and constructor of inner classes by @shahednasser in https://github.com/medusajs/medusa/pull/9635
* chore: remove internal module resources option by @carlos-r-l-rodrigues in https://github.com/medusajs/medusa/pull/9582
* chore: Update modules providers configuration with 'identifier' and 'PROVIDER' by @adrien2p in https://github.com/medusajs/medusa/pull/9636
## New Contributors
* @VrajPatelK made their first contribution in https://github.com/medusajs/medusa/pull/9640
**Full Changelog**: https://github.com/medusajs/medusa/compare/v2.0.0-rc.6...v2.0.0-rc.7