npm @medusajs/medusa 1.7.13
v1.7.13

latest releases: 2.0.2-preview-20241108120236, 2.0.3-preview-20241108120147, 2.0.2-preview-20241108090227...
20 months ago

Features

Bulk emit events
This release contains an improvement of the events system in Medusa. We've updated the EventBusService.emit method to now support bulk emitting a collection of events. This is useful in bulk upsert scenarios and significantly improves performance.

Note, these changes are backward compatible so that you can use emit to send a single event, as usual.

Single emit

await eventBusService.emit("product.created", { id: product.id }, { attempts: 4 })

Bulk emit

let events = [
  {
    eventName: "product.created",
    data: { id: product.id }
    opts: { attempts: 5 }
  }, 
  {
    eventName: "product.created",
    data: { id: product2.id }
    opts: { attempts: 3 }
  }
]

await eventBusService.emit(events)

Chore

  • chores(medusa): Improve draft order creation perf flow (#3431) @adrien2p

Don't miss a new medusa release

NewReleases is sending notifications on new releases.