medusa

Building blocks for digital commerce

MIT License

Downloads
1.3M
Stars
24.9K
Committers
269

Bot releases are hidden (Show)

medusa - v1.20.4

Published by olivermrbl 7 months ago

Highlights

Introducing Worker Mode

This release ships Worker Mode, a new runtime mode for Medusa instances.

Worker Mode allows you to start a Medusa instance in a process separate from the main application process. An instance running in Worker Mode is useful for executing long-running or resource-heavy tasks in the background. Those tasks are offloaded to a separate process and will not affect the performance of the main application. Examples of tasks are importing data or updating a search index. While Worker Mode is especially good for resource-intensive tasks, we recommend always starting an instance in this mode if possible.

Worker Mode introduces three new runtime modes for your Medusa instance:

  • server: API Routes are registered, and no workers are started.
  • worker: API Routes are not registered, and workers are started.
  • shared: API routes are registered, and workers are started (the regular runtime mode + default).

The worker mode is configured in medusa-config.js:

// medusa-config.js
const projectConfig = {
  ...,
  database_url: "...",
  worker_mode: "worker",
};

In this release, the Redis Event Bus has been updated to leverage the worker architecture. Instantiating a Medusa instance with worker_mode: "server" and a different one with worker_mode: "worker" will separate background job processing from the public-facing main application, given that the Redis Event Bus module is installed.

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.3...v1.20.4

medusa - v1.20.3

Published by olivermrbl 7 months ago

Highlights

Medusa 2.0 update

Most of the changes in this release are related to Medusa 2.0 and will not affect any users' setup. The expected date for a 2.0 release candidate is early summer. You can track the progress in our high-level roadmap.

The larger remaining todos are:

  • Convert Rest API to use Workflows, new modules, and API routes
  • Migrate Admin to use 2.0
  • Documentation
  • Migration guide
  • Cleanup/housekeeping

Admin Redesign update

Aside from changes for Medusa 2.0, this release also contains work for the Admin Redesign, set to be released in beta at the beginning of April. The redesign will significantly improve the UX and UI of our admin dashboard and make the overall look and feel much more consistent.

Others

Additionally, this release squashes some minor bugs in Medusa 1.*.

Make medusaClient optional in MedusaProvider

The property medusaClient on the type MedusaProviderProps in medusa-react has been updated to be optional.

Using the MedusaProvider without the medusaClient will initialize and use a new default client under the hood:

<MedusaProvider
  baseUrl={process.env.MEDUSA_BASE_URL}
  ...
>
    {children}
</MedusaProvider>

https://github.com/medusajs/medusa/pull/6363

Add Product Categories to search subscriber

Product categories are included in search indexing on product updates and creations if the product categories feature flag is enabled.

https://github.com/medusajs/medusa/pull/6555

Update index on customer table

The multicolumn uniqueness index on the customer table (email, has_account) has been updated to only apply to rows where deleted_at is null. This is to allow for the creation of customers that were previously soft-deleted.

https://github.com/medusajs/medusa/pull/6631

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.2...v1.20.3

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.2...v1.20.3

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.2...v1.20.3

medusa - v1.20.2

Published by olivermrbl 8 months ago

Highlights

Improve error messaging

We have improved error messaging for missing exports of custom services. Until now, the following non-descriptive message was logged:

image

In 1.20.2, the same error will now log to the console:

CleanShot 2024-02-08 at 10 11 16

This change landed in https://github.com/medusajs/medusa/pull/6240.

Expose option to configure batch size of staged job polling

We have introduced an option jobs_batch_size in the projectConfig in medusa-config.js, allowing users to configure the batch size of staged jobs we poll from the database every 3rd second. By default, we poll 1000 jobs, which has proven to cause issues with some setups. This option aims to resolve those.

Example config:

   module.exports = {
      projectConfig: {
       jobs_batch_size: 10 // poll 10 jobs every 3rd second
     },
   }

This change landed in https://github.com/medusajs/medusa/pull/6333.

Support order by queries on GET /admin/orders

We have introduced an order query param on the GET /admin/orders endpoint to support ordering orders.

This change landed in https://github.com/medusajs/medusa/pull/6258.

Admin revamp (status)

Our work on the admin revamp is progressing well. Below is an overview of completed and remaining work:

Completed

  • Customers domain
  • Customer Groups domain
  • Taxes domain
  • Currencies domain
  • Regions domain
  • Stores domain
  • Sales Channels domain
  • Users domain
  • API keys domain

Remaining

  • Orders domain
  • Draft Orders domain
  • Products domain
  • Gift Cards domain
  • Categories domain
  • Inventory domain
  • Discounts domain
  • Regions domain
  • Taxes domain
  • Locations domain

Medusa 2.0 (status)

We spend most of our time working on Medusa 2.0 and are seeing great improvements weekly.

You can follow our development in our roadmap.

Here's a high-level overview of completed, WIP, and planned work:

Completed

  • Pricing Module
  • Product Module
  • Sales Channel Module
  • Customer Module
  • Workflows / long-running workflows

Work-in-progress

  • Payment Module
  • Cart Module
  • Regions Module
  • Fulfillment Module
  • Regions Module
  • Promotions Module
  • Authentication Module
  • User Module
  • Linked Modules
  • Admin: Workflows UI
  • Admin: Vite build-tooling
  • Admin: UI + UX revamp
  • Index Engine
  • Rest API V2 (using workflows)

Planned (non-exhaustive)

  • API keys Module
  • Taxes Module
  • Store Module
  • Notification Module
  • Order Module

Features

Bugs

Documentation

Chores

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.1...v1.20.2

medusa - v1.20.1

Published by olivermrbl 9 months ago

Highlights

Segment plugin update: Typescript support and Subscribers API

Landed in #5904.

SendGrid plugin update: Custom templates support

Landed in #5833.

Axios adapter support in @medusajs/medusa-js

Landed in #6214.

Improved deployment guides

Landed in #6183.

API Routes for Medusa v2

Core API Routes (located in packages/medusa/src/api) are not registered when Medusa v2 feature flag is enabled.

And to repeat, all changes behind Medusa v2 are very unstable, highly experimental, and a work in progress at this point, so we do not encourage the use of the feature flag yet.

Follow our development toward Medusa v2 in our roadmap.

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.20.0...v1.21.0

medusa - v1.20.0

Published by olivermrbl 9 months ago

Highlights

Improved Stripe plugin architecture + webhook

🚧 Breaking change in medusa-plugin-stripe

Two important changes have been introduced to the Stripe plugin, one of which is breaking.

The endpoints and subscribers in the plugin have been migrated to use our new API Routes and Subscribers. This significantly lowers the code footprint of the package and makes it easier to maintain.

The webhook event management has changed significantly from in-band processing of the event to now using our Event Bus to process it as a background job. There were several motivations for this change: 1) it is deemed best practice to respond with a 200 immediately upon receiving a webhook request, 2) it allows for our retry mechanism to kick in in case the processing fails, and 3) it gives us more control of how the event is processed.

One example of the latter, effective from this release, is that we've added a 5s delay on processing events to avoid conflicts stemming from race conditions between the webhook and client requests.

Changed service checks from an instance of to a static property check

🚧 Breaking change

Several issues have been filed related to failing registrations of different types of services, such as payment providers, fulfillment providers, and similar. The culprit to these issues was found in how we check the type of the service class.

Until now, we've relied on instance of to perform the check:

export function isPaymentProcessor(obj: unknown): boolean {
  return obj instanceof AbstractPaymentProcessor
}

However, if you have a version mismatch in your packages, the instance of check will fail even though the services are seemingly the expected type.

With this release, the service class type checks are now performed with static properties to eliminate this issue:

static isPaymentProcessor(object): boolean {
    return object?.constructor?._isPaymentProcessor
}

More robust and reliable cart completion

🚧 Important change

Our cart completion API has been updated to increase robustness and reliability - especially under high load. The update includes removing serializable transactions from the API and generally refactoring our transaction management.

As a positive side effect, the changes have also made for a more performant API.

Database schema changes

Minor changes to the schema of table publishable_api_key_sales_channel have been introduced.

Please, apply the new migration by running the following command in your Medusa project after having updated:

npx @medusajs/medusa-cli migrations run

order by queries on deeply nested relations

An issue with duplicated rows in the result set in order by queries on deeply nested relations has been resolved.

Read more about the change in the PR description.

API reference for medusa-react

An API reference and examples for our medusa-react library have been introduced to our documentation.

Admin translations

With this release, the following languages are supported in Medusa Admin: Simplified Chinese, Bulgarian, Slovenian, Czech, and Japanese.

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.19.0...v1.20.0

medusa - v1.19.0

Published by olivermrbl 10 months ago

Highlights

Cart-completion strategy response

🚧 Breaking change

Attempting to complete an already completed cart will no longer return a 409 conflict. Instead, the order or swap associated with the completed cart is returned.

More specifically, the response will take one of the following two shapes:

// completing a regular cart
{
  response_code: 200,
  response_body: { data: order, type: "order" },
}

// completing a swap cart
{
  response_code: 200,
  response_body: { data: swap, type: "swap" },
}

node-redis replaced with ioredis for session management

🚧 Important change

Our default Express session store has been changed from node-redis to ioredis.

This was done in response to a request for higher configurability of the Redis client used for session management. It was decided to not only expose more options but simultaneously change the library to ioredis to be consistent with other packages that use Redis, e.g. the Redis Event Bus + Redis Cache.

Add to cart performance improvements

The add-to-cart endpoint, POST /store/carts/:id/line-items, has been refactored, improving performance and transaction management. The latter was done in response to some users experiencing issues with concurrent requests leading to database conflicts. The changes to transaction management in the endpoint should significantly reduce the risk of this issue occurring while improving performance.

Some rough benchmarks show that for 1000 requests (10-20/s), we see approx. 30% of requests fail due to database conflicts in the latest version. With this PR, 0% of requests fail – even under a higher load.

New cluster command added to @medusajs/medusa-cli

A new cluster command has been added to our CLI, @medusajs/medusa-cli:

medusa start-cluster --cpus 3 

The command allows you to start Medusa in cluster mode. By default, cluster mode will try to consume all available CPUs for Medusa instances. You can specify the number of CPUs with a CLI argument --cpus.

Running in cluster mode will likely significantly improve performance as the workload and tasks are distributed among all available instances instead of a single one.

Retry support in medusa-react

🚧 Important change

You can now specify maxRetries as a prop to the MedusaProvider from medusa-react. This config is passed on to the underlying medusa-js client, which means failed requests are retried the amount of times specified by the param. If not provided, the maxRetries defaults to 3.

import { MedusaProvider as Provider } from "medusa-react"
import { queryClient } from "../constants/query-client"

export const MedusaProvider = ({ children }) => {
  return (
    <Provider
      queryClientProviderProps={{
        client: queryClient,
      }}
      baseUrl={process.env.MEDUSA_BACKEND_URL}
      maxRetries={2}
    >
      {children}
    </Provider>
  )
}

Features

Bugs

Docs

Chores

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.18.1...v1.19.0

medusa - v1.18.1

Published by olivermrbl 11 months ago

Highlights

Workflows (beta)

This release introduces Workflows to Medusa's toolbox for creating digital commerce applications.

Our new Workflows tooling is published under @medusajs/workflows-sdk.

Workflows is in beta. Please help us improve the product and squash bugs by filing issues for the errors you encounter.

A workflow is a series of queries and actions that complete a task. You can think of Medusa as being made up of many workflows. For example, when adding line items to carts, we perform several actions:

  1. Get the product’s title
  2. Calculate the price of the product
  3. Create a line item
  4. Add the line item to a cart

All these actions are steps in a workflow.

Workflows can also be more advanced - like managing a return or processing an inbound purchase order.

You can explore and try our new Workflow tooling in our documentation.

Read more about Workflows on our blog.

Pricing Module

This release marks the completion of the first iteration of our Pricing Module - a standalone pricing service that enables granular pricing configurations.

The Pricing Module is published under @medusajs/pricing.

You can use the Pricing Module separately from Medusa to enable advanced pricing logic for any resource specific to your needs.

The module is integrated into our core @medusajs/medusa behind the feature flag medusa_v2. All features behind this flag are deemed highly experimental as we move toward Medusa 2.0, so please use it with caution.

The feature flag medusa_v2 is not stable for production environments.

Read more about the Pricing Module and our plans for Medusa 2.0.

Product Variant pricing updates

The introduction of the Bulk Editor made it easy to update product variant prices.

With this release, we are centralizing product variant pricing in the Bulk Editor and removing all other entry points for operations related to pricing.

As a result, you can no longer modify prices of product variants in the following flows:

  • Creating a product
  • Adding a variant to a product
  • Editing a variant of a product

You should use the "Edit Prices" option in the dropdown of the variants section:

Features

Bugs

  • fix(pricing,types): remove is_dynamic from model + types by @riqwan in https://github.com/medusajs/medusa/pull/5664
  • fix(workflows): compensation handling by @adrien2p in https://github.com/medusajs/medusa/pull/5691
  • fix(ui): code block styles in @kasperkristensen in #5692
  • fix(product, types, workflows): Update product variant workflow by @pKorsholm in #5668
  • fix(medusa): Normalize subscriber paths by @kasperkristensen in #5703
  • fix(pricing, medusa): resolve minor pricing-module bugs by @riqwan in #5685
  • fix(medusa): Update default relations in admin for list-product from module by @pKorsholm in #5708
  • fix(admin-ui): Fix issue with null product categories by @kasperkristensen in #5707
  • fix(admin-ui): Edit prices requires at least one product by @kasperkristensen in #5710
  • fix(medusa,pricing,types): rules only gets updated/deleted upon passing an explicit object by @riqwan in #5711
  • fix(pricing, types): update calculatePrices return type to match actual type by @pKorsholm in #5709
  • fix(medusa): pricing module list prices return type by @pKorsholm in #5715
  • fix(admin-ui): Fix Y-axis scroll in bulk editor by @kasperkristensen in #5726
  • fix(medusa,pricing): Fix migrations for existing databases by @riqwan in #5730
  • fix(admin-ui): inventory item deletion when removing product by @pKorsholm in #5727
  • fix(link-modules, utils): remove limits on queries when primary-key is provided by @pKorsholm in #5732
  • fix(admin-ui): fix height of Bulk Editor cells to always be 40px by @kasperkristensen in #5737

Chores

  • chore: update tsdocs of pricing module by @shahednasser in https://github.com/medusajs/medusa/pull/5648
  • chore: added TSDoc for workflow utility functions by @shahednasser in #5674
  • chore(workflows, core-flows): Split workflows tooling and definitions by @adrien2p in #5705

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.18.0...v1.18.1

medusa - v1.18.0

Published by olivermrbl 11 months ago

Highlights

Subscriber API + Scheduled Jobs API

This release comes with an improved Subscriber API and a new Scheduled Jobs API. These are drastic improvements of the developer experience of setting up event subscribers and cron jobs.

Subscriber API

// src/subscribers/product-update-handler.ts
import type { SubscriberConfig, SubscriberArgs, ProductService } from "@medusajs/medusa"

export default async function productUpdateHandler({ data, eventName, container, pluginOptions }: SubscriberArgs) {
  const productService: ProductService = container.resolve("productService")

  const { id } = data

  const product = await productService.retrieve(id)

  // do something with the product...
}

export const config: SubscriberConfig = {
  event: ProductService.Events.UPDATE
}

Scheduled Jobs API

// src/jobs/once-a-minute.ts
import type { ProductService, ScheduledJobConfig, ScheduledJobArgs }  from "@medusajs/medusa"

export default async function handler({ container, data, pluginOptions }: ScheduledJobArgs) {
  const productService: ProductService = container.resolve("productService")
  
  const count = await productService.count()

  console.log(`You have ${count} products`)
}

export const config: ScheduledJobConfig = {
  name: "every-minute",
  schedule: "* * * * *"
}

Read more about the new APIs in the PR details.

Breaking changes

Changes to feature flags

This version significantly changes the feature flags in our core @medusajs/medusa. We've decided to replace all module-specific feature flags with one that encapsulates all the work around modularizing Medusa further.

The following feature flags no longer exist:

Name Flag Environment variable
Product Module isolate_product_domain  MEDUSA_FF_ISOLATE_PRODUCT_DOMAIN
Pricing Module isolate_pricing_domain  MEDUSA_FF_ISOLATE_PRICING_DOMAIN

These feature flags have been replaced with one capturing all work for Medusa V2, releasing next year:

Name Flag Environment variable
Medusa V2 medusa_v2  MEDUSA_FF_MEDUSA_V2

Creating a NotificationService

The introduction of the new Subscriber API changes the recommended way to define the subscribers of a NotificationService. The recommended approach is to use a loader until our Subscriber API natively supports NotificationServices or we introduce a mechanism dedicated towards it.

Read more here.

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.4...v1.18.0

medusa - v1.17.4

Published by olivermrbl 11 months ago

Highlights

Custom promiseAll util

Transactions in Typeorm do not play well with Promise.all when the operations contain nested promises. In case one of the operations fail i.e. reject the promise, all other operations are not guaranteed to be rolled back properly.

See https://github.com/medusajs/medusa/issues/5529 for more context.

To mitigate this issue, we've introduced the promiseAll util in @medusajs/utils. It uses Promise.allSettled under the hood, but has been wrapped to work like Promise.all with a transaction rollback guarantee. See here.

You will use it like so:

import { promiseAll } from "@medusajs/utils"
import { TransactionBaseService } from "@medusajs/medusa"

class MyService extends TransactionBaseService {
  async performTransactions() {
    return await promiseAll([
      // your operations....
    ])
  }
}

API Routes BodyParser configuration

API Routes now support body-parser configuration.

You can opt-out:

export config = {
  routes: [
    {
      matcher: "/webhooks/*",
      bodyParser: false,
      middlewares: [raw({ type: "application/json" })]
    }
  ]
}

Or configure it with options:

export config = {
  routes: [
    {
      matcher: "/webhooks/*",
      bodyParser: { sizeLimit: 2000 } // in bytes
      middlewares: [raw({ type: "application/json" })]
    }
  ]
}

Design packages moved to monorepo

Our design packages, @medusajs/ui, @medusajs/icons, @medusajs/ui-preset, have been moved to our monorepo to centralize issues and PRs.

Breaking changes

https://github.com/medusajs/medusa/pull/5511 contains breaking changes in @medusajs/cache-redis.

If option ttl is 0 when calling .set the attempt to add a cache entry is skipped.

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.3...v1.17.4

medusa - v1.17.3

Published by olivermrbl 12 months ago

Highlights

API Routes compatible with Windows

An issue with path parsing on Windows for API Routes registration has been resolved (#5497).

Custom batch jobs support in Admin activity drawer

Custom batch jobs can now be rendered in the activity drawer in Medusa Admin (#5288)

Use format [entity]-[operation] for your batch job type to render a human-readable activity title. For example, product-import.

Translations

Vietnamese, Ukrainian, Tamil, Russian, and Hindi translations added to Medusa Admin.

Removed source-map-plugin from @medusajs/admin-ui

Removed source-map-plugin to make Webpack more fault tolerant. The plugin would cause admin builds to throw if a dependency had no source maps (#5484)

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.2...v1.17.3

medusa - v1.17.2

Published by olivermrbl about 1 year ago

Highlights

API Routes

Version 1.17.2 of @medusajs/medusa introduces API Routes - a massive improvement of the developer experience of creating custom endpoints in Medusa.

Custom API endpoints can now be implemented using similar patterns to frameworks like Next.js and Svelte.

// api/admin/products/route.ts

import { MedusaRequest, MedusaResponse } from "@medusajs/medusa"

export async function GET(req: MedusaRequest, res: MedusaResponse) {
  const productService = req.scope.resolve("productService")
  const products = await productService.list()
  res.json({ products })
}

In the above example, we create the endpoint GET /admin/products. The example illustrates a few key points:

  • Endpoint paths are inferred from the file path of the route
  • route.{ts|js} is a new special file that contains the route handlers
  • HTTP methods of route handlers are defined by the handler name (above GET)

Read more about the API Routes in the PR and announcement post.

Features

Bugs

Chores

Docs

Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.1...v1.17.2

medusa - v1.17.1

Published by olivermrbl about 1 year ago

Highlights

Pricing UI + UX upgrade

The Price List domain in @medusajs/admin has been revamped to improve merchants' experience in creating promotional sales and customer-specific prices.

The update includes:

  • New UI implemented using Medusa UI
  • Bulk Editor for editing multiple prices on the Products part of the Price List

https://github.com/medusajs/medusa/assets/59018053/65008316-cb46-43a0-9116-6c279853bd4d

We will incrementally migrate Medusa Admin to use our UI components library. Therefore, you can expect to find UI inconsistencies in the foreseeable future.

The next iteration of the Price List revamp will introduce minimum and maximum requirements support (in the UI), as well as the ability to import and export Price List to/from CSV files.

AI Assistant

We've introduced an AI Assistant to our documentation, helping you on your journey building digital commerce experiences.

https://github.com/medusajs/medusa/assets/59018053/57564836-7233-43d9-840d-5b943353e9b4

Added translations

Spanish, Italian, and German translations have been added to Medusa Admin.

Features

Bugs

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.17.0...v1.17.1

medusa - v1.17.0

Published by olivermrbl about 1 year ago

Highlights

New and improved authentication methods

Version 1.17.0 of @medusajs/medusa ships new and improved authentication methods. A contribution by @dPreininger.

Medusa supports three authentication methods:

Sessions
Our session cookie authentication remains unchanged. However, the strategy name has been updated in both the store and admin API, making existing cookie sessions invalid.

⚠️ We will not convert existing sessions to work with this update. Make sure to plan your upgrade accordingly.

API tokens (⚠️ breaking changes)

The header for API token authentication has changed from a Bearer authorization scheme to a custom header scheme specific to Medusa, x-medusa-access-token.

Previously, you would use API tokens like so:

curl -L GET '<BACKEND_URL>/admin/products' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {api_token}'

This has changed to:

curl -L GET '<BACKEND_URL>/admin/products' \
  -H 'Content-Type: application/json' \
  -H 'x-medusa-access-token: {api_token}'

Bearer tokens
Bearer token authentication is a "new" method that utilizes JWT tokens and the Bearer scheme. Request a token from a client and attach it to subsequent requests to keep the authenticated session alive. The approach is identical to that of the old API authentication but uses a different token type.

First, request a token:

curl -L POST 'http://localhost:9000/admin/auth/token' \
  -H 'Content-Type: application/json' \
  --data-raw '{
    "email": "[email protected]",
    "password": "supersecret"
  }'

Then, hit an authenticated route:

curl -L GET 'http://localhost:9000/admin/products?limit=1' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer some_access_token'

Arabic translations

Thanks to @PeterAbdalla, you can now operate Medusa Admin in Arabic.

Medusa UI 2.0

Version 2.0 of @medusajs/ui is out. To upgrade, run the following command in your project:

yarn add @medusajs/[email protected]

The release includes:

  • New components, including CurrencyInput, Tabs, and CommandBar
  • New icons
  • Updated API of Button, Badge, and CodeBlock (⚠️ breaking changes)

And much more.

Check out all changes and the upgrade guide in our documentation: https://docs.medusajs.com/upgrade-guides

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.16.1...v1.17.0

medusa - v1.16.1

Published by olivermrbl about 1 year ago

Highlights

Polish translations added to Medusa Admin

Huge thanks to @chemicalkosek for the contribution!

Important bugs related to Multi-language support resolved

Upgrade to the latest version of Medusa Admin:

yarn add @medusajs/admin@latest

Solves:

Features

Bugs

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.16.0...v1.16.1

medusa - v1.16.0

Published by olivermrbl about 1 year ago

Highlights

Multi-language support in Medusa Admin

We are excited to announce multi-language support in Medusa Admin, allowing merchants to manage products, orders, customers, etc. in their preferred language.

This release ships English, Portuguese (Brazil), and French translations.

Check it out by upgrading to the latest version of Medusa Admin:

yarn add @medusajs/admin@latest

Huge thanks to @gempain and @mj-mehdizadeh for this amazing contribution. And thanks @dahorarodrigo for contributing with Portuguese translations.

If you want to help us translate Admin to other languages, see the contribution guide in our documentation.

Your efforts are highly appreciated!

Pricing Module

This release introduces the first iteration of our new standalone Pricing Module, which ships on npm under @medusajs/pricing. This version of the module comes with limited functionality as we've focused on putting down a solid foundation for follow-up work.

You can think of the Pricing Module as a way to assign a price to any type of resource, for example, ProductVariants.

We will share an announcement article soon, describing the module's features and what you can expect from follow-up iterations.

Breaking changes

Database schema changes
In our effort to build Standalone Commerce Modules, we will incrementally be dropping foreign key constraints across many business domains and change relationships between entities in the core, @medusajs/medusa.

Right now, we are focused on finalizing the Product (@medusajs/product) and Pricing (@medusajs/pricing) module, which has led to the following database changes.

The relationship between MoneyAmounts and ProductVariants has been changed from a Many-to-One to a Many-to-Many in package @medusajs/medusa. Therefore, you are required to apply the new migration by running the following command in your Medusa project:

npx @medusajs/medusa-cli migrations run

Additionally, the following foreign key constraints have been dropped:

These changes are only relevant if you are using the feature flag isolate_product_domain. Please be careful about enabling this flag, as it will introduce experimental changes and work in progress.

  • ProductTaxRate to Product
  • ProductTypeTaxRate to ProductType
  • ClaimItem to ProductVariant
  • DiscountConditionProduct to Product
  • DiscountConditionProductCollection to ProductCollection
  • DiscountConditionProductTag to ProductTag
  • DiscountConditionProductType to ProductType
  • DiscountRule to Product

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.15.1...v1.16.0

medusa - v1.15.1

Published by olivermrbl about 1 year ago

Highlights

Updated create-medusa-app onboarding

We've updated the create-medusa-app command with a new option, allowing you to get started with a Next.js storefront right away.

Try the new step in the flow yourself:

npx create-medusa-app@latest

Or pass the argument --with-nextjs-starter when running the command:

npx create-medusa-app@latest --with-nextjs-starter

AbstractFulfillmentService

We've done some housekeeping around fulfillment plugins, introducing a new interface and an abstract class correctly typed with added documentation.

As a result, fulfillment plugin services will now need to extend the AbstractFulfillmentService from @medusajs/medusa. Rest assured, the changes are backward compatible, so you are in no rush to migrate your implementation or plugin.

The deprecated fulfillment service will be removed in a future release. We will announce these changes beforehand so you can take the proper precautions.

Improvements to S3 file plugin

The AWS SDK used in medusa-file-s3 has been upgraded to V3, as V2 will enter maintenance mode later this year.

Cache-control has been added to the plugin options, allowing you to optimize your storage more granularly.

Solves:

EventBus enqueuer reconnection

We've introduced a mechanism to ensure the EventBus will not stop processing events in case the database connection momentarily dies.

If the connection is lost, we will try to reestablish the connection every 3rd second until successful. Changes was added in #4855 and further improved in #4963.

Additionally, logs have been added to inform the user in case this should happen.

Solves:

Breaking changes

Product Module
In https://github.com/medusajs/medusa/pull/4965, we introduced breaking changes in the list and listAndCount methods of the ProductService in package @medusajs/product.

Specifically, the category filter has changed from category_ids to category_id:

// before
ProductService.list({ category_ids: ["pcat_123", "pcat_345"] })
ProductService.listAndCount({ category_ids: ["pcat_123", "pcat_345"] })

// after
ProductService.list({ category_id: ["pcat_123", "pcat_345"] })
ProductService.listAndCount({ category_id: ["pcat_123", "pcat_345"] })

Features

Bugs

Chores

Documentation

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.15.0...v1.16.0

medusa - v1.15.0

Published by olivermrbl about 1 year ago

Highlights

Import and Export support in @medusajs/file-local

The file plugin, @medusajs/file-local, used for local development, now supports uploads and downloads via streaming, making it possible to import products right after setting up a project, among other things.

New Search UI in Medusa Documentation

You can now filter the search results to view specific results such as plugins, API reference, UI, and other areas of the documentation.

Check it out here.

Breaking changes

Reading and writing streams with file plugins now default to a private bucket across all providers.

The file plugin streaming API to upload to public/private buckets has been updated to be consistent across all providers.

// before
// MinIO
fileService.getUploadStreamDescriptor({..., usePrivateBucket: false})
// S3 & Spaces
fileService.getUploadStreamDescriptor({..., acl: "public-read"})

// after
fileService.getUploadStreamDescriptor({..., isPrivate: true}) // private bucket (default)
fileService.getUploadStreamDescriptor({..., isPrivate: false}) // public bucket

The following method signatures in the Price List and Product import strategies have been updated:

// before
downloadImportOpsFile(batchJobId: string, op: OperationType)
deleteOpsFiles(batchJobId: string)

// after
downloadImportOpsFile(batchJob: BatchJob, op: OperationType)
deleteOpsFiles(batchJob: BatchJob)

The following types specific to file services have moved from @medusajs/medusa to @medusajs/types:

export type FileServiceUploadResult = {
  url: string
  key: string
}

export type FileServiceGetUploadStreamResult = {
  writeStream: stream.PassThrough
  promise: Promise<any>
  url: string
  fileKey: string
  [x: string]: unknown
}

export type GetUploadedFileType = {
  fileKey: string
  isPrivate?: boolean
  [x: string]: unknown
}

export type DeleteFileType = {
  fileKey: string
  [x: string]: unknown
}

export type UploadStreamDescriptorType = {
  name: string
  ext?: string
  isPrivate?: boolean
  [x: string]: unknown
}

Features

Bugs

Docs

  • docs: added beta features documentation by @shahednasser in #4859
  • docs,api-ref: added search filters by @shahednasser in #4830

Full Changelog: https://github.com/medusajs/medusa/compare/v1.14.0...v1.15.0

medusa - v1.14.0

Published by olivermrbl about 1 year ago

Highlights

Admin Extensions reaches general availability

We are excited to announce the general availability of Admin Extensibility, shipping alongside version 1.14.0 of Medusa Core and a brand-new component library.

To start using it, install the latest versions of the core and admin packages, and check out our guide to building your first Admin Widgets and UI Routes.

yarn add @medusajs/admin@latest @medusajs/medusa@latest

The following is a breaking change from the beta version released in June.

path should now have the format /<path> instead of <path>. A path with a trailing / will still throw an error.

Separately, it is worth highlighting that to use environment variables in Admin Extensions, they should be prefixed with MEDUSA_ADMIN_. Variables with this prefix are included in the admin build and otherwise omitted for security reasons. If you have used Next.js or Gatsby, the concept will be familiar to you.

UI Component Library

To build Admin Extensions with the same look and feel as Medusa Admin, we are excited to announce our new component Library, Medusa UI.

Medusa UI is a React implementation of the Medusa design system. Most components are based on Radix UI Primitives, and we use Tailwind CSS for styling, shipping our own preset with our customizations.

The library is a dependency of our Admin package, so you can start using it if you have the latest version of that installed. Alternatively, you can install it in a standalone project. However, this comes with the required configuration. See the documentation.

To help you get started with Medusa UI, we have published its own documentation. This should get you up and running and provide more information on the available components and how to use them. You will also find information on Medusa Icons we have made public and more details on theming.

Bulk Editor improvements

The following improvements have been shipped to the Bulk Editor

  • 2-dimensional selection
  • Keyboard navigation
    • Arrow
    • Shift + arrow
    • Command/ctrl + shift + arrow
    • Tab
    • Shit + tab
  • Copy/paste functionality

Extended create-medusa-app options

The following options have been added:

--no-browser: Disables opening the browser at the end of the project creation and only shows success message.

--skip-db: Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser. Useful if you want to set the database URL at a later point in the configurations.

--db-url <url>: Skips database creation and sets the database URL to the provided URL. Throws an error if connection to the database fails. Will still run migrations and open the admin after project creation. Useful if you already have a database created, locally or remotely.

--no-migrations: Skips running migrations, creating admin user, and seeding. If used, it's expected that you pass the `--db-url` option with a URL of a database that has all necessary migrations. Otherwise, unexpected errors will occur. Helpful only if combined with `--db-url`.

--directory-path <path>: Allows specifying the parent directory path to create the directory of the new project in.

Important fix: Cart Shipping Methods

Shipping methods are now always deleted on cart line item updates. This was always the intention, but the functionality has been broken until now. This release patches the functionality.

Other breaking changes

The FlagRouter that manages feature flags has been removed from @medusajs/medusa and added to @medusajs/utils.

Features

Bugs

Chores

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.13.1...v1.14.0

medusa - v1.13.1

Published by olivermrbl about 1 year ago

Highlights

Write logs to file

Environment variable LOG_FILE has been introduced to enable winston to write logs to file.

Thanks, @pevey, for the contribution.

Features

Bugs

Chores

New Contributors

Full Changelog: https://github.com/medusajs/medusa/compare/v1.13.0...v1.13.1

medusa - v1.13.0

Published by olivermrbl about 1 year ago

Highlights

This version ships with schema changes (breaking) and minor fixes improving Medusa Admin.

Breaking changes

Version 1.13.0 introduces database schema changes that require you to run migrations. The relationship between Shipping Profile and Product has been changed to a Many-to-Many relation.

After upgrading to 1.13.0, run the following command:

medusa migrations run

Features

Bugs

Chores

Full Changelog: https://github.com/medusajs/medusa/compare/v1.12.3...v1.13.0