Skip to content

[React Native] 4.0.0-alpha.4

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 24 Aug 08:41
Immutable release. Only release title and notes can be modified.
0fdad6c

Breaking changes

Single CheckoutException error class

onFail now always receives a CheckoutException instance. The error subclasses (CheckoutClientError, CheckoutExpiredError, CheckoutHTTPError, ConfigurationError, GenericError, InternalError) and the CheckoutNativeErrorType enum have been removed, and CheckoutException is a class rather than a union of those types. Branch on code instead of the error's class:

 onFail: error => {
-  if (error instanceof CheckoutExpiredError) {
+  if (error.code === CheckoutErrorCode.cartExpired) {
     refreshCart();
   }
 },

Every exception exposes code, message, name, and an optional statusCode (present only when an HTTP response caused the failure). The raw native fail payload type is now exported as CheckoutNativeError.

CheckoutErrorCode values reshaped

The codes now match the flattened error reporting of the native SDKs. clientError, sendingBridgeEventError, receivingBridgeEventError, and renderProcessGone have been removed; customerAccountRequired, networkError, sdkError, webViewNotSupported, and webContentProcessTerminated have been added. Update switches over the code:

 switch (error.code) {
-  case CheckoutErrorCode.renderProcessGone:
+  case CheckoutErrorCode.webContentProcessTerminated:
     recreateCheckout();
     break;
 }

ColorScheme.web renamed to ColorScheme.storefront

The wire value changes from web_default to storefront to match the native SDKs:

 configuration: {
-  colorScheme: ColorScheme.web,
+  colorScheme: ColorScheme.storefront,
 }

Additive changes

Incoming message origin validation

allowedMessageOrigins restricts which web origins the checkout WebView accepts incoming messages from:

 configuration: {
+  allowedMessageOrigins: [
+    'https://checkout.example.com',
+    'https://*.example.com',
+  ],
 }

The surface stays open by default: when the list is empty, messages from any origin are accepted. The loaded checkout origin and shop.app (including its subdomains) are always trusted. Entries may be exact origins, wildcard subdomains (https://*.example.com), or '*' to explicitly disable validation. Rejected messages are never silently dropped — the native SDK logs each rejection as a warning with the origin and reason.

LogLevel.warn and LogLevel.none

LogLevel now covers the native SDKs' four ordered thresholds: debug, warn, error, and none. Omit logLevel to keep the native SDK default.

Behaviour changes

Native SDKs updated to 4.0.0-alpha.5

The wrapper now pins ShopifyCheckoutKit (iOS) and com.shopify:checkout-kit (Android) at 4.0.0-alpha.5, up from 4.0.0-alpha.2. Behaviour from the native alpha.3 through alpha.5 releases applies transitively — most visibly, links checkout opens via window.open now stay in an in-app browser surface (SFSafariViewController on iOS, Custom Tabs on Android) instead of leaving the app. See the Swift 4.0.0-alpha.5 and Android 4.0.0-alpha.5 release notes and their predecessors for the full details.

title applies on Android and updates at runtime

configuration.title previously changed the checkout sheet title only on iOS. It now sets the title on both platforms and takes effect at runtime when the provider configuration changes. When omitted, each platform uses its default localized title.