Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/deprecate-buyer-journey-intercept.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/ui-extensions': patch
---

Deprecate `useBuyerJourneyIntercept` and the `buyerJourney.intercept` API. Use a cart and checkout validation function instead. The buyer journey intercept will be removed in a future version of the API.
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,8 @@
"syntaxKind": "MethodSignature",
"name": "intercept",
"value": "(interceptor: Interceptor) => Promise<() => void>",
"description": "Installs a function for intercepting and preventing progress on checkout.\n\nThis returns a promise that resolves to a teardown function. Calling the teardown function removes the interceptor.\n\nTo block checkout progress, you must set the [block_progress](/docs/api/checkout-ui-extensions/{API_VERSION}/configuration#block-progress) capability in your extension's configuration.\n\nIf you do, then you're expected to inform the buyer why navigation was blocked, either by passing validation errors to the checkout UI or rendering the errors in your extension.\n\nIf the merchant hasn't allowed your extension to block checkout progress, show a warning in the [checkout editor](/docs/apps/build/checkout/test-checkout-ui-extensions#test-the-extension-in-the-checkout-editor)."
"description": "Installs a function for intercepting and preventing progress on checkout.\n\nThis returns a promise that resolves to a teardown function. Calling the teardown function removes the interceptor.\n\nTo block checkout progress, you must set the [block_progress](/docs/api/checkout-ui-extensions/{API_VERSION}/configuration#block-progress) capability in your extension's configuration.\n\nIf you do, then you're expected to inform the buyer why navigation was blocked, either by passing validation errors to the checkout UI or rendering the errors in your extension.\n\nIf the merchant hasn't allowed your extension to block checkout progress, show a warning in the [checkout editor](/docs/apps/build/checkout/test-checkout-ui-extensions#test-the-extension-in-the-checkout-editor).",
"deprecationMessage": "Use a cart and checkout validation function instead. The buyer\njourney intercept will be removed in a future version of the API."
},
{
"filePath": "src/surfaces/checkout/api/standard/standard.ts",
Expand All @@ -1020,7 +1021,7 @@
"description": "All possible steps the buyer can take to complete checkout. These steps vary depending on whether the checkout is one-page or three-page, and on the shop's configuration."
}
],
"value": "export interface BuyerJourney {\n /**\n * Installs a function for intercepting and preventing progress on checkout.\n *\n * This returns a promise that resolves to a teardown function. Calling the\n * teardown function removes the interceptor.\n *\n * To block checkout progress, you must set the [block_progress](/docs/api/checkout-ui-extensions/{API_VERSION}/configuration#block-progress)\n * capability in your extension's configuration.\n *\n * If you do, then you're expected to inform the buyer why navigation was blocked,\n * either by passing validation errors to the checkout UI or rendering the errors in your extension.\n *\n * If the merchant hasn't allowed your extension to block checkout progress, show a warning in the [checkout editor](/docs/apps/build/checkout/test-checkout-ui-extensions#test-the-extension-in-the-checkout-editor).\n */\n intercept(interceptor: Interceptor): Promise<() => void>;\n\n /**\n * Whether the buyer has completed submitting their order. When `true`, the buyer is on the order status page after submitting payment. When `false`, the buyer is still in the checkout flow.\n */\n completed: SubscribableSignalLike<boolean>;\n /**\n * All possible steps the buyer can take to complete checkout. These steps vary depending on whether the checkout is one-page or three-page, and on the shop's configuration.\n */\n steps: SubscribableSignalLike<BuyerJourneyStep[]>;\n /**\n * The step of checkout the buyer is currently on. The value is `undefined` if the current step can't be determined.\n */\n activeStep: SubscribableSignalLike<BuyerJourneyStepReference | undefined>;\n}"
"value": "export interface BuyerJourney {\n /**\n * Installs a function for intercepting and preventing progress on checkout.\n *\n * This returns a promise that resolves to a teardown function. Calling the\n * teardown function removes the interceptor.\n *\n * To block checkout progress, you must set the [block_progress](/docs/api/checkout-ui-extensions/{API_VERSION}/configuration#block-progress)\n * capability in your extension's configuration.\n *\n * If you do, then you're expected to inform the buyer why navigation was blocked,\n * either by passing validation errors to the checkout UI or rendering the errors in your extension.\n *\n * If the merchant hasn't allowed your extension to block checkout progress, show a warning in the [checkout editor](/docs/apps/build/checkout/test-checkout-ui-extensions#test-the-extension-in-the-checkout-editor).\n *\n * @deprecated Use a cart and checkout validation function instead. The buyer\n * journey intercept will be removed in a future version of the API.\n */\n intercept(interceptor: Interceptor): Promise<() => void>;\n\n /**\n * Whether the buyer has completed submitting their order. When `true`, the buyer is on the order status page after submitting payment. When `false`, the buyer is still in the checkout flow.\n */\n completed: SubscribableSignalLike<boolean>;\n /**\n * All possible steps the buyer can take to complete checkout. These steps vary depending on whether the checkout is one-page or three-page, and on the shop's configuration.\n */\n steps: SubscribableSignalLike<BuyerJourneyStep[]>;\n /**\n * The step of checkout the buyer is currently on. The value is `undefined` if the current step can't be determined.\n */\n activeStep: SubscribableSignalLike<BuyerJourneyStepReference | undefined>;\n}"
}
},
"SubscribableSignalLike": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,9 @@ export interface BuyerJourney {
* either by passing validation errors to the checkout UI or rendering the errors in your extension.
*
* If the merchant hasn't allowed your extension to block checkout progress, show a warning in the [checkout editor](https://shopify.dev/docs/apps/build/checkout/test-checkout-ui-extensions#test-the-extension-in-the-checkout-editor).
*
* @deprecated Use a cart and checkout validation function instead. The buyer
* journey intercept will be removed in a future version of the API.
*/
intercept(interceptor: Interceptor): Promise<() => void>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export function useBuyerJourneyCompleted<
*
* It is good practice to show a warning in the checkout editor when the merchant has not given permission for your extension
* to block checkout progress.
*
* @deprecated Use a cart and checkout validation function instead. The buyer
* journey intercept will be removed in a future version of the API.
* @publicDocs
*/
export function useBuyerJourneyIntercept<
Expand Down
Loading