Skip to content

Releases: medusajs/medusa

Preview Release Update #10

18 Sep 08:19
56ee4d6
Compare
Choose a tag to compare

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

Introduced a new query tool

We have introduced a new tool, Query, for querying data across modules in your application. Over time, it will replace Remote Query, which has been deprecated in the latest version. The underlying query engine of Query and Remote Query is the same, but we have changed the query API and eliminated redundant configurations that had built up over time.

There are two significant differences between the two tools:

  • The result returned by Query takes the same shape regardless of the query input, which is different from that of Remote Query's that differed depending on whether pagination was applied or not.
  • The call signature of Query is query.graph({ ... }), which is different from Remote Query's query({ ... })

Query Result

With Query, you will always receive a result with data and metadata. The data contains your requested resources and the metadata contains information about the applied pagination. We recommend consuming it like so:

const { data, metadata } = await query...

Call signature

With Query, you query data across your modules with query.graph({ ... }).

For example, in an API Route, the difference between how you consume Query vs. Remote Query is as follows:

// API Route
-const query = req.container.resolve(ContainerRegistrationKeys.REMOTE_QUERY)
- 
-const result = await query({ ... })
+const query = req.container.resolve(ContainerRegistrationKeys.QUERY)
+
+const { data, metadata } = await query.graph({ ... })

Migrating to Query

To migrate from Remote Query to Query, the following changes are needed:

  • Resolve query instead of remoteQuery from the dependency container
  • Use query.graph({ ... }) instead of query({ .. })
  • Update query options to fit the new format*

*The changes to the query options format are:

  • Entrypoint has been renamed: entryPoint -> entity
  • Filters has been moved to a top-level option: variables: { filters: { ... } } -> filters: { ... }
  • Pagination has been moved to a top-level option: variables: { pagination: { ... } } -> pagination: { ... }
  • Context has been moved to a top-level option: variables: { context: { ... } } -> context: { ... }
  • Variables has been removed entirely from the API

Here's an example using all options:

const { data, metadata } = await query.graph({
  entity: "product",
  fields: ["id", "title", "variants.calculated_price"],
  filters: { 
    variants: { 
      sku: "SHIRT-1234" 
    },
  },
  pagination: { take: 10, skip: 0 },
  context: {
    variants: {
      calculated_price: QueryContext({ currency_code: "usd" })
    }
  }
})

In this example, we:

  • Retrieve the first 10 products that match our query
  • Only with the fields: id, title, and the calculated price of variants, variants.calculated_price
  • Filtered by product variants sku
  • With computed variant prices based on a dynamic QueryContext

Alongside the tool, we have shipped a new option, types, to our CLI commands start and develop. If specified, we will attempt to generate types for all data models in existing and custom modules in your project and place them in a new top-level folder .medusa in your project. The types should significantly improve the developer experience of Query by giving you intellisense of the data you can query in your application.

You can read more about Query in our documentation.

Remote Query will be removed in a later preview version and will not be part of the official release of Medusa 2.0. However, because the required changes are minimal, we recommend upgrading now to avoid issues in the future.

Introduced observability

We have introduced observability into our framework, enabling traces for HTTP requests, workflow executions, and database queries. Our instrumentation is built on top of OpenTelemetry, which allows you to export traces to any platform compatible with OpenTelemetry events.

Read more about tracing in Medusa and how to get started in our documentation.

Features

Bugs

Documentation

Other Changes

  • docs: Rename remoteQuery to query and add db instrumentation flag by @thetutlage in #9159

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

Preview Release Update #9

16 Sep 12:28
8829f89
Compare
Choose a tag to compare

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

Read more

v1.20.10

16 Sep 12:14
Compare
Choose a tag to compare

Bugs

Documentation

Full Changelog: 1.20.10...v1.20.11

Preview Release Update #8

06 Sep 08:34
abe7b66
Compare
Choose a tag to compare

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

Restructured admin packages

| 🚧 Breaking change

Our admin packages have been restructured in #8988. This is a breaking change, as our extensions tool has been moved to a new package.

More specifically, defineWidgetConfig and defineRouteConfig should be imported from @medusajs/admin-sdk instead of @medusajs/admin-shared.

- import { defineRouteConfig, defineWidgetConfig } from "@medusajs/admin-shared"
+ import { defineRouteConfig, defineWidgetConfig } from "@medusajs/admin-sdk"

Additionally, the new admin package needs to be an explicit dependency in your project, so you should install it with your preferred package manager:

yarn add @medusajs/admin-sdk@preview

Features

  • feat(dashboard,types): split damaged activity from received by @riqwan in #8859
  • feat(medusa): order changes endpoint by @carlos-r-l-rodrigues in #8728
  • feat(dashboard): order edits in timeline by @fPolic in #8899
  • feat(notification): Handle long running transaction and add status support by @adrien2p in #8900
  • feat(dashboard): allow custom shopping prices for claims/exchanges by @fPolic in #8912
  • feat(core-flows,types): Refunds can only be performed when order is imbalanced by @riqwan in #8944
  • chore(medusa): remove promotions in campaign validators + move tests to http by @riqwan in #8965
  • feat(dashboard): Cancel claims and exchanges by @fPolic in #8958
  • feat(dashboard): update create fulfillment UI part 1 by @fPolic in #8972
  • feat(utils): dml to graphql by @carlos-r-l-rodrigues in #8951
  • feat: Add github authentication provider by @sradevski in #8980
  • feat: added totals tests for end 2 end RMA flow by @riqwan in #8906
  • feat(types,medusa): add acknowledgement typing by @shahednasser in #8991
  • feat(admin-sdk,admin-bundler,admin-shared,medusa): Restructure admin packages by @kasperkristensen in #8988
  • feat(core-flows): custom price flag for order line items and shipping methods by @carlos-r-l-rodrigues in #8969
  • feat(core-flows,types,promotion): register promotion campaign usage upon cart completion by @riqwan in #8970
  • feat(product): product option value methods by @carlos-r-l-rodrigues in #9004
  • feat(dashboard, user): prefill invite email by @fPolic in #9016
  • feat(dashboard): add inventory kit info in order summary by @fPolic in #8990

Bugs

Documentation

Read more

Preview Release Update #7

29 Aug 09:43
ddddd43
Compare
Choose a tag to compare

Highlights

Bulk Editor improvements

We have added error handling to our bulk editor to make bulk editing of resources more manageable.

error-bulk-editor.mp4

Order Exchanges, Returns, and Claims

We have finished the first iteration of Order Exchanges, Returns, and Claims. There is still some polishing to do on these flows, so please report any issues you find.

Recipe: Food-Delivery platform

We have published a new recipe taking you though building a food-delivery platform like UberEats.

We also have a demo project and repository if you are curious to dig into how this recipe is used in practice: https://github.com/medusajs/medusa-eats

Remote Joiner alias conflict

🚧 Breaking change

Several models were named the same across modules, causing conflicts for our Remote Joiner engine. To resolve the issues with Remote Joiner, the name-clashing models have been renamed to be specific to the module they belong to.

Only the ORM models have been renamed – not the underlying tables.

Order Module:

  • Address -> OrderAddress
  • LineItem -> OrderLineItem
  • LineItemAdjustment -> OrderLineItemAdjustment
  • LineItemTaxLine -> OrderLineItemTaxLine
  • ShippingMethod -> OrderShippingMethod
  • ShippingMethodAdjustment -> OrderShippingMethodAdjustment
  • ShippingMethodTaxLine -> OrderShippingMethodTaxLine
  • Transaction -> OrderTransaction

Fulfillment Module:

  • Address -> FulfillmentAddress

These changes affect the modules' methods since we auto-generate methods based on the model names. For example, createLineItem in the Order Module is now createOrderLineItem. More specifically, this change affects the models mentioned above, and the following methods of those:

  • retrieve[ModelName]
  • list[ModelName]
  • listAndCount[ModelName]
  • create[ModelName]
  • update[ModelName]
  • delete[ModelName]
  • softDelete[ModelName]
  • restore[ModelName]

Internal module events

We have decided to hide the logs of internal module events. These events are currently only emitted in a few modules and are not supposed to be used by end-users for subscribers and such. You should always use Workflow Events, which have replaced the event concept from V1.

Features

Bugs

Documentation

Chores

  • chore(medusa): Re enable plugin loading by @adrien2p in #8843
  • chore: Treat internal event differently, primarely do not display info logs for those events by @adrien2p in #8767
  • chore: Remove unused clients in admin + clean up js-sdk by @olivermrbl in #8839

Full Changelog: v2.0.6-preview...v2.0.7-preview

v2.0.6-preview

27 Aug 14:40
ac18b5d
Compare
Choose a tag to compare

Highlights

Introduced identity registration in auth domain

🚧 Breaking change

We have separated identity registration from authentication. For context about why this decision was made see #8683.

Introduced endpoint /auth/[scope]/[provider]/register

We have added an endpoint specifically for registering new identities. This change will only be used by providers that require registration, such as email-password.

Introduced method register in auth provider and auth module

We have introduced a new method register to the auth provider and auth module interfaces. This change will only be used by providers that require registration, such as email-password.

Examples of new authentication flows

Sign up with email-password:

POST /admin/invites -> admin creates invite
POST /auth/user/emailpass/register -> user registers identity
POST /admin/invites/accept -> invite is accepted passing the invite + auth token 

Sign in with email-password:

POST /auth/user/emailpass -> authenticate with email-password
GET /admin/users/me -> get authenticated user

Sign up with Google:

POST /auth/user/google -> redirects to Google auth
POST /auth/user/google/callback -> Google hits callback URL, authenticates, and responds with user
POST /admin/invites/accept -> invite is accepted passing the invite + auth token 

Sign up with Google:

POST /auth/user/google -> redirects to Google auth
POST /auth/user/google/callback -> Google hits callback URL, authenticates, and responds with user
GET /admin/users/me -> get authenticated user

Sign up as customer with email-password:

POST /auth/customer/emailpass/register -> customer registers identity
POST /store/customers -> customer is created

Sign in with email-password:

POST /auth/customer/emailpass -> authenticate customer with email-password

CLI commands to manage database operations

We have added a new namespace to our CLI specifically for database operations db:.

Alongside the namespace, a range of new commands have been introduced:

  • db:create: The command creates the database (if it is missing) and updates the .env file
  • db:migrate: This command will run the migrations and sync the links, unless --skip-links flag is specified
  • db:rollback: Rolls-back last batch of migrations for one or more selected modules
  • db:generate: Generates migrations for one or more selected modules
  • db:sync-links: Ensures links between modules are in sync

Events

We have (re)introduced events in the product domain:

"product-category.created"
"product-category.updated"
"product-category.deleted"
"product-collection.created"
"product-collection.updated"
"product-collection.deleted"
"product-variant.updated"
"product-variant.created"
"product-variant.deleted"
"product.updated"
"product.created"
"product.deleted"

Documentation: Redesign completed

We have completed redesigning our documentation for Medusa 2.0, which includes an updated layout and a range of new components improving the overall user experience.

Explore the updated documentation here.

Documentation: Re-introduced AI assistant (beta)

We have (re)introduced our AI assistant for Medusa 2.0 to help guide you through our documentation and find what you are looking for as fast as possible.

Try out the new AI assistant here.

Features

  • feat(dashboard): Hitting escape restores previous value by @kasperkristensen in #8654
  • feat(workflows-sdk): log on error by @carlos-r-l-rodrigues in #8666
  • feat(dashboard,core-flows,js-sdk,types,link-modules,payment): ability to copy payment link by @riqwan in #8630
  • feat(dashboard): Wrap each route in an ErrorBoundary by @kasperkristensen in #8674
  • feat(core-flows): create or update payment collections in RMA flows by @riqwan in #8676
  • feat(dashboard,core-flows,js-sdk,types): ability to mark payment as paid by @riqwan in #8679
  • feat(dashboard,core-flows): ability to refund payment post RMA flow by @riqwan in #8685
  • fix(core-flows): account for unfulfilled items while generating order status by @riqwan in #8698
  • feat(dashboard): add activities for order - claim, exchange, payment by @riqwan in #8702
  • feat(core-flows): order edit request by @carlos-r-l-rodrigues in #8705
  • chore(order): align mikroorm <> order module by @riqwan in #8710
  • feat(fulfillment,order): add created_by fields to fulfillment, return, claim, exchange by @riqwan in #8711
  • feat(medusa,types,core-flows): apply created_by values - claims, exchanges, returns, fulfillment by @riqwan in #8712
  • feat: add missing crud to provider identity service by @christiananese in #8717
  • feat(utils): use dotenv-expand to allow variables within env by @shahednasser in #8720
  • feat(dashboard): order edit UI by @fPolic in #8700
  • feat(core-flows,dashboard): adds item validations for claims, returns and exchanges by @riqwan in #8735
  • feat(create-medusa-app): set database name to project name by @shahednasser in #8727
  • feat(dashboard,types): add active order change panel - claims, exchanges & returns by @riqwan in #8738
  • feat: add env editor utility to edit update .env files by @thetutlage in #8741
  • feature: add db:create command by @thetutlage in #8760
  • fix(dashboard): summary section return fixes by @fPolic in #8770
  • feat: add sync links command by @thetutlage in #8775
  • feat: move migrations commands to the new db namespace by @thetutlage in #8810
  • feat: create auth provider identity by @christiananese in #8675
  • feat: Separate registration from authentication in auth domain by @olivermrbl in #8683
  • feat(dashboard): cancel return request by @fPolic in #8761

Bugs

Documentation

Read more

v1.20.10

26 Aug 11:41
Compare
Choose a tag to compare

Bugs

  • fix: Pass in data to PATCH call so cart amount is updated on quantity change by @Arsenalist in #8456
  • fix(admin-ui): Fixed DropdownMenu inside a Modal zIndex issues by @adevinwild in #8358
  • fix: Check if the SalesChannels FF is enabled on /admin/products by @adevinwild in #8357

Docs

New Contributors

Full Changelog: v1.20.9...1.20.10

v2.0.5-preview

19 Aug 10:50
a77c23c
Compare
Choose a tag to compare

Highlights

Product Category organizer component

We've polished the Product Category organizer component for a smoother drag-and-drop experience. As part of the polish, we've also fixed an issue with a dependency.

Email-pass as default authentication provider

🚧 Breaking change

We've updated the default modules config to include email-password as a default authentication provider. This is a breaking change. To ensure your application will continue to run, you should install the preview version of the email-password provider package:

yarn add @medusajs/auth-emailpass@preview

Workflows Reference

We've introduced a reference of all workflows used in Medusa's core. It includes a visual representation of steps, hooks, and conditionals.

Explore the reference here.

Features

  • feat: admin return reason list by @christiananese in #8482
  • feat(medusa): filter shipping options by location by @riqwan in #8511
  • feat(dashboard,js-sdk,types): ability to add refund reason and note by @riqwan in #8466
  • feat(types,dashboard): ability to set shipping methods for claim by @riqwan in #8533
  • feat: create return reason by @christiananese in #8516
  • feat(create-medusa-app): prompt for database name with credentials by @shahednasser in #8552
  • feat(core-flows,dashboard,medusa): fixes set of tiny bugs in claims flow by @riqwan in #8551
  • feat(dashboard): BulkEditor Boolean cell behaviour by @kasperkristensen in #8418
  • feat: Move userpass default definition to defineConfig instead of a hard-coded value by @sradevski in #8557
  • feat(core-flows): introduce a generic create entities step by @riqwan in #8553
  • feat(medusa-oas-cli): automatically fix missing circular references by @shahednasser in #8600
  • feat(core-flow): order edit endpoints by @carlos-r-l-rodrigues in #8596
  • feat(dashboard,core-flows,js-sdk,types,medusa): Add exchange UI + fixes by @riqwan in #8606
  • feat(medusa,core-flows,types): API to create payment collections for order by @riqwan in #8617

Bugs

Documentation

Chores

  • chore: normalize packages version by @carlos-r-l-rodrigues in #8492
  • chore(core-flows): [4] export types and types, add basic TSDocs by @shahednasser in #8509
  • chore(core-flows): [3] export types and types, add basic TSDocs by @shahednasser in #8507
  • chore(core-flows): [2] export types and types, add basic TSDocs by @shahednasser in #8505
  • chore(core-flows): [5] export types and types, add basic TSDocs by @shahednasser in #8510
  • chore(core-flows): [6] export types and types, add basic TSDocs by @shahednasser in #8512
  • chore(core-flows): [7] export types and types, add basic TSDocs by @shahednasser in #8514
  • chore(core-flows): [8] export types and types, add basic TSDocs by @shahednasser in #8517
  • chore(core-flows): [9] export types and types, add basic TSDocs by @shahednasser in #8519
  • chore(core-flows): [11] export types and types, add basic TSDocs by @shahednasser in #8521
  • chore(core-flows): [12] export types and types, add basic TSDocs by @shahednasser in #8522
  • chore(core-flows): [14] export types and steps, add basic TSDocs by @shahednasser in #8524
  • chore(core-flows): [16] export types and steps, add basic TSDocs by @shahednasser in #8527
  • chore(core-flows): [17] export types and steps, add basic TSDocs by @shahednasser in #8528
  • chore(core-flows): [18/18] export types and types, add basic TSDocs by @shahednasser in #8529
  • chore(order): item update quantity by @carlos-r-l-rodrigue...
Read more

v2.0.4-preview

08 Aug 13:35
73cc669
Compare
Choose a tag to compare

Highlights

Domain-specific Workflow Hooks

We recently introduced Workflow Hooks, allowing you to expose injection points in workflows for the consumer to perform custom logic.

Among Medusa's core workflows, you will find available hooks in the following domains:

  • Products: create, update, and delete
  • Orders: create, cancel, complete, create fulfillment, cancel fulfillment, and create shipment
  • Promotions: create, update, delete, create campaign, update campaign, and delete campaign
  • Carts: create and update
  • Customers: create, update, delete, create address, update address, and delete address

Workflow hooks are consumed by registering a hook handler on the workflow. The hook handlers should be placed and registered in the /workflows/hooks folder of your Medusa project. For example, here's how to use the product-created hook:

// workflows/hooks/product-created.ts
import { createProductsWorkflow } from "@medusajs/core-flows"

createProductsWorkflow.hooks.productCreated(( { products, additional_data }) => {
  // run custom business logic
})

This hook receives the created products and arbitrary additional_data. The latter should be passed to the workflow upon running it:

await createProductsWorkflow(req.scope).run({
  input: { products: [ ... ], additional_data: { ... } },
})

In combination with extending the request payload to receive additional data, you can achieve a range of different use cases with Workflow Hooks, e.g. linking a product with another resource. We will share recipes for many of these cases in the near future.

We will continuously add more Workflow Hooks to our core workflow, e.g. a hook to transform line item data and price before it's added to the cart. Keep an eye out for our preview release updates, as they will contain an overview of the new hooks.

Features

Bugs

Documentation

Chores

New Contributors

Full Changelog: v2.0.3-preview...v2.0.4-preview

v2.0.3-preview

02 Aug 15:57
4b0119f
Compare
Choose a tag to compare

Get started with a new project

To get started using the preview release, run the following command:

npx create-medusa-app@preview

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.

Highlights

Workflow Hooks

🚧 Breaking change

We have added a new helper, createHook, to the workflows-sdk. The createHook helper exposes a hook from a workflow. Later (after the workflow has been composed), the workflow consumers can bind a handler to the hook to run custom logic.

Note

As of now, you can only register one hook handler, and the workflow orchestrator ignores the return value.

Exposing hook via createHook

import {
  createStep,
  createHook,
  createWorkflow,
  WorkflowResponse
} from '@medusajs/workflows-sdk'

const createProductStep = createStep('createProduct', function () {
  // business logic for "createProduct"
})

const workflow = createWorkflow('name', function (input) {
  createProductStep(input)
  const productCreatedHook = createHook('productCreated', { productId: input.id })

  return new WorkflowResponse(input, {
    hooks: [productCreatedHook]
  })
})

Points to note

  • Unlike the createStep function, the createHook method is called within the workflow composition callback.
  • You must return the created hooks from the composition callback. Returning of hooks is needed for the TypeScript engine to provide intellisense when registering a handler for the hook.
  • Hooks are executed in the same position as they are defined within the composition callback

Registering the hook handler
The workflow user must register a hook handler to run custom logic within a workflow. They can do that as follows.

workflow.hooks.productCreated(() => {
  // run custom business logic
})

Points to note

  • The hook handler behaves similarly to a workflow step. It can run async code, will be retried, and can also have compensation behavior (defined as the 2nd parameter)
  • There can only be one handler for a hook. If you need multiple handlers, you should create another workflow and register that as the hook handler (not supported yet).
  • The return value of the hook handler is ignored in this first iteration.

Introducing the WorkflowResponse class and breaking changes

The introduction of hooks has changed the return value of the createWorkflow composition callback. Now, we must return both the workflow results and the configured hooks.

Instead of manually composing the return value, you can use the WorkflowResponse class to construct the current response. The WorkflowResponse class accepts the following parameters.

  • The first parameter is the result of the workflow.
  • The second parameter (optional) is a config object with configured hooks.

Product Import and Export

We have re-introduced Product Import and Export and simultaneously redesigned the notifications drawer in the dashboard.

Right now, we are polling for new notifications every third second, but we intend to introduce SSE (or a similar tech.) to enable real-time notifications.

Product Tag management UI

We have added Product Tag management in the dashboard. Find it in "Settings > Product Tags".

New Recipes: Subscriptions and Digital Products

We have added two new recipes covering how to add support for Subscriptions and Digital Product respectively. They both come with an example repository.

Check out the Subscription recipe here.

Check out the Digital Products recipe here.

Features

Bugs

Documentation

Read more