docs: documentation updates for v1.20 (#6031)

* docs: documentation updates for v1.20

* fix stripe upgrade guide

* fixed vale error

* fix eslint errors

* change stripe environment variables to options
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-01-09 19:07:24 +01:00
1 parent 9fda1e63c1
commit 13f12e1953
6 files changed
+139 -2

No files matched your search

@@ -0,0 +1,63 @@
---
description: "Actions Required for v.1.20"
sidebar_custom_props:
iconName: "server-stack-solid"
---
# v1.20
Version 1.20 of Medusa ships performance improvements, bug fixes, and some breaking changes.
<DocCard item={{
type: 'link',
href: 'https://github.com/medusajs/medusa/releases/tag/v1.20.0',
label: 'Release Notes',
customProps: {
iconName: "github",
html: 'Check the release notes for all changes.',
}
}} />
## Breaking Changes
### Stripe Plugin Changes
v6.0.7 of the Stripe plugin introduces improvements and breaking changes. Refer to [its upgrade guide](../plugins/stripe/6-0-7.md) for more details on the breaking changes, required actions, and how to update it.
### Service Registration Improvement
Previously, when you create services such as a Payment Processor or Fulfillment Provider, the Medusa backend relied on the use of the `instanceof` operator to check and register a service:
```ts
// previously
export function isPaymentProcessor(obj: unknown): boolean {
return obj instanceof AbstractPaymentProcessor
}
```
However, if you have a version mismatch in your packages, the `instanceof` check will fail even though the services are seemingly the expected type.
In this release, the service class type checks are now performed with static properties to eliminate this issue:
<!-- eslint-skip -->
```ts
// now
static isPaymentProcessor(object): boolean {
return object?.constructor?._isPaymentProcessor
}
```
This change doesn't require any action from your side.
---
## How to Update
Run the following command in your Medusa backend:
```bash npm2yarn
npm install @medusajs/medusa@1.20
```
To avoid unexpected issues with dependencies, it's also recommended to update all other Medusa plugins or packages you have installed.
@@ -0,0 +1,58 @@
---
description: 'Actions Required for v.6.0.7'
sidebar_label: 'v6.0.7'
---
# Stripe Plugin: v6.0.7
v6.0.7 of Stripe introduces an improvement in Stripe's plugin's architecture and webhooks.
:::note
This version of Stripe requires at least v1.20 of `@medusajs/medusa`. Refer to its update guide [here](../../medusa-core/1-20.mdx).
:::
## Overview
There are two important changes that have been introduced to the Stripe plugin, one of which is breaking.
### Architectural Improvement
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.
### Breaking Change: Webhooks and the Event Bus
The webhook event management has changed significantly; previously, it used in-band processing of the webhook events. Following this update, the Event Bus Service is used to process the event in a background job instead.
There were several motivations for this change:
1. It's deemed best practice to respond with a 200 immediately upon receiving a webhook request.
2. It allows for the retry mechanism to kick-in in case the processing fails.
3. It provides more control of how the event is processed.
One example of the latter: starting from this release, you can now set a delay on processing events to avoid conflicts stemming from race conditions between the webhook and client requests. By default, the delay is five seconds.
Learn more about the new webhook options in [the stripe plugin's guide](../../../plugins/payment/stripe.mdx)
---
## Required Actions
Since webhooks now rely on the Event Bus Service, make sure to install and setup an Event Bus module on your backend, if you haven't already. For production, please use the [Redis Event Bus Module](../../../development/events/modules/redis.md).
---
## How to Update
:::warning [Important]
Make sure you're using at least v1.20 of `@medusajs/medusa`. Refer to its update guide [here](../../medusa-core/1-20.mdx).
:::
Run the following command in the root directory of your Medusa backend:
```bash npm2yarn
npm install medusa-payment-stripe@6.0.7
```
@@ -0,0 +1,6 @@
{
"label": "Stripe",
"customProps": {
"reverse": true
}
}