github medusajs/medusa v2.0.9-preview
Preview Release Update #9

latest releases: v2.0.6, v2.0.5, medusa-dev-cli@2.0.6...
2 months ago

Update existing project

Ensure your Medusa dependencies in package.json are using the preview tag:

{
  "dependencies": {
    "@medusajs/medusa": "preview",
    "@medusajs/pricing": "preview",
    "@medusajs/product": "preview",
    ...
  }
}

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

Deprecated ModuleRegistrationName

Warning

Breaking change

We have deprecated ModuleRegistrationName in favor of Modules. ModuleRegistrationName will be removed in a later preview release.

Modules are registered in the dependency container using these keys and are now resolved as follows:

import { Modules } from "@medusajs/utils"

const productModule = container.resolve(Modules.PRODUCT)

This is a breaking change if you have used strings for module resolution instead of ModuleRegistrationName.

For example, if you have resolved the product module using its previous string resolution key, you will need to change it as follows:

-const productModule = container.resolve("productModuleService")
+const productModule = container.resolve(Modules.PRODUCT)

Enforced Publishable API Key in Store API

Warning

Breaking change

In the latest preview release, we require a Publishable API key header to access the Store API, i.e., all endpoints under the /store resource. This will ensure your requests are scoped to at least one Sales Channel associated with the Publishable API key. Sales Channels are used to retrieve products, retrieve correct inventory quantities, create carts, and place orders.

The requirement has been introduced to ensure you can perform these operations without experiencing issues.

Disabled automatic MikroORM casing change

Warning

Breaking change

Refer to #9058 for a description of the issue, solution, and the minimal breaking change.

Fixed issue with many-to-many relations

Warning

Breaking change

In #9075, a bug with our many-to-many relation definition was identified. The solution to the problem lead to a minimal breaking change to the way many-to-many relations are defined when using our model tool from @medusajs/framework.

We now require the many-to-many relation to be defined on both sides and a mappedBy definition on at least one side.

Features

  • feat(create-medusa-app): add publishable API key environment variable to Next.js storefront by @shahednasser in #9029
  • feat: Application types generation from project GQL schema's by @adrien2p in #8995
  • feat: Reset password by @olivermrbl in #8962
  • feat: Add support for refreshing JWT tokens by @sradevski in #9013
  • feature: introduce types for query.graph method by @thetutlage in #9031
  • feat: Add support for fetch streaming to js SDK by @sradevski in #9065
  • fix(utils,medusa,order,cart): fix totals when promotions are included by @riqwan in #9014
  • feat(payment): Payment providers are upserted upon loading by @riqwan in #9090
  • feat(dashboard) modal search autofocus by @fPolic in #9038
  • feat(utils,types,framework,medusa): store endpoints should require publishable key by @riqwan in #9068
  • feat(core-flows): product type, option and tag events by @carlos-r-l-rodrigues in #9105
  • feat(core-flows,dashboard,types,medusa): delete shipping methods when all inbound/outbound items are deleted by @riqwan in #9106
  • feat(core-flows,types,medusa): validate deleting location level when quantities exist by @riqwan in #9086
  • feat: introduce a thin wrapper on top of OpenTelemetry by @thetutlage in #9109
  • feat(api-key,js-sdk,dashboard): allow deleting api keys only once its revoked by @riqwan in #9118
  • feature: add telemetry to the HTTP layer by @thetutlage in #9116
  • feature: add tracing to remote query by @thetutlage in #9128
  • feat(core-flows,medusa,utils,types): adds delivered_quantity to order by @riqwan in #9130

Bugs

Documentation

Chores

New Contributors

Full Changelog: v2.0.8-preview...v2.0.9-preview

Don't miss a new medusa release

NewReleases is sending notifications on new releases.