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
- fix(types): add inventory_quantity to http variant type by @shahednasser in #9030
- fix: Check for star actor types when allowing unregistered access by @sradevski in #9037
- fix(orchestration): filter out undefined items by @carlos-r-l-rodrigues in #9046
- fix(types, medusa): request / response types clean-up by @shahednasser in #9043
- fix: Allow specifying PORT for tests through environment by @sradevski in #9055
- breaking: turn off Mikro-ORM casing change with DML properties by @thetutlage in #9058
- fix(dashboard): rq cache and pending flag by @fPolic in #9063
- fix: JSON stringify DML json property default value by @thetutlage in #9074
- fix(dashboard): refresh order list when fulfilment status changes by @fPolic in #9076
- fix(medusa-test-utils): Run with modules without models by @adrien2p in #9062
- fix(core-flows): fix emitted event for deleting sales channel by @shahednasser in #9081
- fix(promotion): handle promotion buy X get X scenario by @riqwan in #9002
- fix(dashboard): campaign fixes by @fPolic in #9082
- fix: broken order page due to missing inventory by @riqwan in #9083
- fix: Update auth
app_metadata
when deleting users + customers by @olivermrbl in #9041 - fix: product options event names by @carlos-r-l-rodrigues in #9108
- fix(dashboard): product create - ignored variants in datagrid by @fPolic in #9087
- fix: wrap ModuleImplementations so that all methods are async by @Alexnortung in #9012
- fix:
instanceof MedusaError
does not work by @McTom234 in #9094 - fix(dml): Throw when many to many are not configured properly by @adrien2p in #9085
- fix: Remove test listeners after the event has happened by @sradevski in #9115
- fix(types, medusa): fix http type of exchanges and claims by @shahednasser in #9123
- fix(): Query Missing bindings by @adrien2p in #9131
- fix(core-flows): item id in reservations by @fPolic in #9097
- fix(dashboard): max call error onKeyDown handler by @kasperkristensen in #9141
- fix: OrderDTO add first class discount_subtotal var by @420coupe in #9112
- fix: Fixed misleading LinkDefinition import from the wrong package by @erickirt in #9139
Documentation
- chore: fix incorrect oas property name by @shahednasser in #9009
- docs: update auth docs + add new storefront guides by @shahednasser in #9020
- docs: fix admin actor type -> user by @shahednasser in #9028
- docs: document star actor types by @shahednasser in #9044
- oas: [2/2] improve store OAS by @shahednasser in #9035
- oas: [1/n] improve oas schemas by @shahednasser in #9039
- oas: [2/n] improve schema oas by @shahednasser in #9040
- oas: [1/n] improve store oas by @shahednasser in #8993
- oas: [3/n] improve oas schemas by @shahednasser in #9042
- docs: fix pricing query params in storefront guide + modules restructure by @shahednasser in #9021
- docs: added storefront development guide on retrieving variant inventory details by @shahednasser in #9032
- chore(utils): update auth provider TSDocs + fix errors stopping references build by @shahednasser in #9023
- chore: fix build errors in OAS by @shahednasser in #9059
- docs: add prerequisites link for test guides by @shahednasser in #9057
- oas: [4/n] improve oas schemas by @shahednasser in #9064
- docs-util: fix generated hooks example by @shahednasser in #9060
- oas: [5/n] improve oas schemas by @shahednasser in #9066
- docs-util: fix after updating node version by @shahednasser in #9072
- docs: fix links to inventory model references by @shahednasser in #9073
- docs: document events reference by @shahednasser in #9080
- docs: add Query documentation by @shahednasser in #9079
- docs: added a services constraint document by @shahednasser in #8999
- docs: fixes to long-running workflows + relationship docs by @shahednasser in #9101
- docs: added docs for deleting user of actor type by @shahednasser in #9104
- docs: add new events to reference by @shahednasser in #9121
- oas: [6/n] improve oas schemas by @shahednasser in #9122
- docs: fix import of LinkDefinition by @shahednasser in #9143
Chores
- chore: re-add oas tests for generated OAS by @shahednasser in #9036
- chore(modules-sdk): Move Query and cleanup by @adrien2p in #9054
- chore(types, medusa): clean up to request / response types by @shahednasser in #9067
- chore: joiner config entity property by @carlos-r-l-rodrigues in #9084
- chore: Register Query in container by @adrien2p in #9103
- chore(workflows-sdk): Update hook functions type by @adrien2p in #9117
- chore: remove container registration name by @carlos-r-l-rodrigues in #9137
New Contributors
Full Changelog: v2.0.8-preview...v2.0.9-preview