Skip to content

Medusa 2.0 Release Candidate #7

Latest
Compare
Choose a tag to compare
@olivermrbl olivermrbl released this 18 Oct 14:25
· 5 commits to develop since this release
1e0f618

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 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

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

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:

{
  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

Bugs

Documentation

Chores

New Contributors

Full Changelog: v2.0.0-rc.6...v2.0.0-rc.7