Skip to content

v2.19.0: Vite v7 Update, Inventory Export, Custom Fulfillment Addresses

Latest

Choose a tag to compare

@medusa-os-bot medusa-os-bot released this 13 Aug 13:09

Highlights

Medusa MCP users can update their project using the following prompt:

Update my Medusa project to v2.19.0

Update Vite and React Router to v7

🚧 Breaking change

This release updates the Medusa Admin dashboard to use Vite v7.3.6 and React Router v7.18.2. This is a breaking change and requires you to make the following changes:

  1. Update your vite direct dependency to v7.3.6
  2. Update your react-router-dom and react-router direct dependencies to v7.18.2
  3. Use Node ^20.19.0, ^22.12.0, or greater LTS. Node 20.0–20.18 and 22.0–22.11 are no longer supported.

Due to this update, there are the following breaking changes related to Vite and React Router that may impact you if you use these features:

  • Supported browsers are now changed to Chrome >= 107, Edge >= 107, Firefox >= 104, Safari >= 16 (previously 87 / 88 / 78 / 14)
  • The Vite config allowed in medusa-config.ts's admin.vite configuration now supports Vite 7 config, which makes the following changes:
    • build.target: "modules" is removed. the Vite 7 default is "baseline-widely-available".
    • splitVendorChunkPlugin is removed. Use build.rollupOptions.output.manualChunks instead
    • resolve.conditions is changed from adding your values to the default, to replacing them.
  • Response.json() is removed due to the supported browser change. Return or throw a Response instead. For example, new Response(JSON.stringify(body), { status, headers: { "Content-Type": "application/json; charset=utf-8" } }).
  • defer() is removed from the React Router API. Loaders return a plain object now; unresolved promises are streamed automatically, so <Await> keeps working unchanged.
  • UIMatch.data from React Router is deprecated in favour of UIMatch.loaderData, which holds the same value, and UIMatch.data is now typed as possibly undefined. This includes the props.data form used by detail-route breadcrumb components, which becomes props.loaderData.

JS SDK Admin Product Option Methods Removed

🚧 Breaking change

The following methods have been removed from the JS SDK as they targeted endpoints that no longer exist:

  • sdk.admin.product.createOption
  • sdk.admin.product.updateOption
  • sdk.admin.product.retrieveOption
  • sdk.admin.product.deleteOption

To manage a product's options, use sdk.admin.product.update instead.


Changed Default Behavior for Totals Fetching in Carts and Orders

Previously, when retrieving * fields of carts and orders through Query or API routes, that didn't include totals. You had to request those specifically.

Retrieving all fields with * now includes the computed total fields. So, for better performance, make sure to request only the fields you actually need for carts and orders rather than using *.


Support JSONB Types in .json DML Properties

Previously, a property in a data model typed with .json had the TypeScript type of an object, even though the property stores any JSON-serializable value in a jsonb column.

You can now specify the actual type of the column in a type argument of the json method. This only affects the generated type of the property.

For example:

import { model } from "@medusajs/framework/utils"

const Brand = model.define("brand", {
  id: model.id().primaryKey(),
  name: model.text(),
  warnings: model.json<{ code: string; message: string }[]>(),
})

Inventory Item Export

Inventory items can now be exported from the admin dashboard as a CSV file. The export workflow is available through the admin UI and via the API, matching the pattern already established for products and orders.


Custom Delivery Address and Additional Data for Fulfillment Creation

When creating a fulfillment, you can now supply a custom delivery address independently of the order's shipping address, and pass arbitrary additional_data through to fulfillment providers. This enables use cases such as drop-shipping to a third-party address or forwarding provider-specific metadata without customizing core flows.

#16139


Notification Preferences for Order Edits

Order edit workflows now respect notification preferences. When triggering an order edit, you can opt in or out of sending notifications to the customer, consistent with the preference controls already available on other order operations.

#16238

Features

  • feat(auth-oidc,dashboard,auth,js-sdk,types,medusa): generic OIDC auth provider by @NicolasGorga in #16023
  • feat: Implement search module by @sradevski in #16298
  • feat: Replace admin search with a BE endpoint by @sradevski in #16358
  • feat: Implement a DSL for search index by @sradevski in #16391
  • feat(core-flows,medusa,dashboard,js-sdk,types): add inventory item export by @srindom in #16223
  • feat(fulfillment, core-flows, types, utils, medusa): support custom delivery address + pass additional data to createFulfillment by @shahednasser in #16139
  • feat(core-flows,dashboard,js-sdk, medusa,types,utils): support notification preferences for order edits by @shahednasser in #16238
  • feat(eslint-plugin): prefer workflow events by @leobenzol in #16150

Bugs

  • fix(test-utils, modules-sdk, utils, medusa): fix plugin:add for monorepo projects by @shahednasser in #16308
  • fix: Improve typings for schema metadata by @sradevski in #16400
  • fix(core-flows): delete auth identity when possible upon customer/user deletion by @NicolasGorga in #16176
  • fix(caching,core-flows,framework,query,types,utils): pass non automatically computed tags to various cached queries by @NicolasGorga in #16354
  • fix(pricing): allow updating prices with an empty rules object by @lazerg in #16267
  • fix(medusa): document the invite accept token as a query parameter by @lazerg in #16323
  • fix(utils): support array and dynamic types for .json fields in DML by @shahednasser in #16236
  • fix(cart): fetch totals with all fields + fix inconsistent total calculation by @shahednasser in #16022
  • fix(core-flows): guard calculated price set before reading it in cart line-item prep by @zain-asif-dev in #15939
  • fix(order): fetch totals with all fields + fix inconsistent total calculation by @shahednasser in #16021
  • fix(medusa): allow admin draft orders without an email or customer_id by @GBreg19 in #16133
  • fix(dashboard): hide Property Labels settings item unless view_configurations is enabled by @shahednasser in #16255
  • fix(core-flows): honor item-level allow_backorder when confirming inventory by @shafi-VM in #15731
  • fix(admin-shared): add missing gift_card.list.side injection zone by @shahednasser in #16218
  • fix(core-flows): re-price merged cart line items and hydrate compare_at on update by @shahednasser in #16211
  • fix(index): preserve date filters by @DS123-ally in #16186
  • fix(dashboard,draft-order): update @hookform/resolvers and react-hook-form to show validation errors in admin forms by @shahednasser in #16208
  • fix(dashboard): fetch currency_code for visible currency columns in configurable tables by @Nahid-NHB in #16195
  • fix(core-flows): pass the cart's currency and region to fulfillment providers when calculating shipping option prices by @shahednasser in #16207
  • fix(dashboard): add tooltip for full product/variant name in pricing data grids by @andershermansen in #15962
  • fix(js-sdk): remove dead product-option methods from admin.product by @shahednasser in #16187
  • fix(dashboard): fix active sidebar link detection by @shahednasser in #16191
  • fix(file-s3): preserve directory portion of filename in object key by @Tusharkhadde in #16010
  • fix(core-flows): recompute draft order tax lines on address change and conversion by @shahednasser in #16033
  • fix(product): delete individual variant metadata fields by @ihopenre-eng in #16179

Documentation

Chores

New Contributors

Full Changelog: v2.18.0...v2.19.0