From 85a6c8cb425fe85301b78a73b11ba2d3bbb8095e Mon Sep 17 00:00:00 2001 From: Nathan Oliveira Date: Thu, 12 Dec 2024 13:56:44 -0500 Subject: [PATCH] Remove deprecated features for 2025-01 --- .changeset/hot-insects-float.md | 6 +++ .../src/surfaces/point-of-sale.ts | 1 - .../src/surfaces/point-of-sale/components.ts | 1 - .../components/ActionItem/ActionItem.ts | 4 -- .../reference/components/ActionItem.doc.ts | 35 ------------------ .../reference/components/Badge.doc.ts | 2 +- .../examples/action-api/present-modal.ts | 5 +-- .../examples/action-api/present-modal.tsx | 13 ++----- .../examples/action-item/default.example.ts | 5 +-- .../examples/action-item/default.example.tsx | 12 +++--- .../screenshots/action-item-default.png | Bin 82485 -> 0 bytes .../screenshots/action-item-thumbnail.png | Bin 29024 -> 0 bytes .../staticPages/pages/versions.doc.ts | 13 +++++-- .../src/surfaces/point-of-sale/api.ts | 6 --- .../src/surfaces/point-of-sale/components.ts | 3 -- .../render/api/cart-api/cart-api.ts | 11 ------ .../render/api/smartgrid-api/smartgrid-api.ts | 17 --------- .../components/ActionItem/ActionItem.ts | 24 ------------ .../render/components/List/List.ts | 6 --- .../render/components/TextField/TextField.ts | 15 +------- .../src/surfaces/point-of-sale/targets.ts | 15 ++------ 21 files changed, 36 insertions(+), 158 deletions(-) create mode 100644 .changeset/hot-insects-float.md delete mode 100644 packages/ui-extensions-react/src/surfaces/point-of-sale/components/ActionItem/ActionItem.ts delete mode 100644 packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/ActionItem.doc.ts delete mode 100644 packages/ui-extensions/docs/surfaces/point-of-sale/screenshots/action-item-default.png delete mode 100644 packages/ui-extensions/docs/surfaces/point-of-sale/screenshots/action-item-thumbnail.png delete mode 100644 packages/ui-extensions/src/surfaces/point-of-sale/render/api/smartgrid-api/smartgrid-api.ts delete mode 100644 packages/ui-extensions/src/surfaces/point-of-sale/render/components/ActionItem/ActionItem.ts diff --git a/.changeset/hot-insects-float.md b/.changeset/hot-insects-float.md new file mode 100644 index 000000000..53a5f7049 --- /dev/null +++ b/.changeset/hot-insects-float.md @@ -0,0 +1,6 @@ +--- +'@shopify/ui-extensions-react': minor +'@shopify/ui-extensions': minor +--- + +Removed deprecated props, components, and APIs diff --git a/packages/ui-extensions-react/src/surfaces/point-of-sale.ts b/packages/ui-extensions-react/src/surfaces/point-of-sale.ts index f763d2313..61c274103 100644 --- a/packages/ui-extensions-react/src/surfaces/point-of-sale.ts +++ b/packages/ui-extensions-react/src/surfaces/point-of-sale.ts @@ -68,7 +68,6 @@ export type { PasswordProps, EmbeddedElementProps, NewTextFieldProps, - TextFieldProps, TileProps, TimeFieldProps, TimePickerProps, diff --git a/packages/ui-extensions-react/src/surfaces/point-of-sale/components.ts b/packages/ui-extensions-react/src/surfaces/point-of-sale/components.ts index 49a41d6e3..0e10c2c89 100644 --- a/packages/ui-extensions-react/src/surfaces/point-of-sale/components.ts +++ b/packages/ui-extensions-react/src/surfaces/point-of-sale/components.ts @@ -1,4 +1,3 @@ -export {ActionItem} from './components/ActionItem/ActionItem'; export {Badge} from './components/Badge/Badge'; export {Banner} from './components/Banner/Banner'; export {Button} from './components/Button/Button'; diff --git a/packages/ui-extensions-react/src/surfaces/point-of-sale/components/ActionItem/ActionItem.ts b/packages/ui-extensions-react/src/surfaces/point-of-sale/components/ActionItem/ActionItem.ts deleted file mode 100644 index 3fee6c111..000000000 --- a/packages/ui-extensions-react/src/surfaces/point-of-sale/components/ActionItem/ActionItem.ts +++ /dev/null @@ -1,4 +0,0 @@ -import {ActionItem as BaseActionItem} from '@shopify/ui-extensions/point-of-sale'; -import {createRemoteReactComponent} from '@remote-ui/react'; - -export const ActionItem = createRemoteReactComponent(BaseActionItem); diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/ActionItem.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/ActionItem.doc.ts deleted file mode 100644 index ec5c81fb9..000000000 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/ActionItem.doc.ts +++ /dev/null @@ -1,35 +0,0 @@ -import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'; -import {generateCodeBlock} from '../helpers/generateCodeBlock'; - -const generateCodeBlockForActionItem = (title: string, fileName: string) => - generateCodeBlock(title, 'action-item', fileName); - -const data: ReferenceEntityTemplateSchema = { - name: 'ActionItem', - description: ` - ActionItem has been deprecated. Please use the [Button Component](/docs/api/pos-ui-extensions/components/) instead. - - The ActionItem provides a tappable surface on the specified extension target as an entry point to an extension. Note that the text displayed on this 'ActionItem' is dependent on the description of the extension. - `, - isVisualComponent: true, - type: 'component', - definitions: [ - { - title: 'ActionItem', - description: '', - type: 'ActionItemProps', - }, - ], - category: 'Components', - related: [], - thumbnail: 'action-item-thumbnail.png', - defaultExample: { - image: 'action-item-default.png', - codeblock: generateCodeBlockForActionItem( - 'Render an ActionItem in post purchase', - 'default.example', - ), - }, -}; - -export default data; diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Badge.doc.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Badge.doc.ts index f7e690fa1..2d7e4aec2 100644 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Badge.doc.ts +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/components/Badge.doc.ts @@ -38,7 +38,7 @@ const data: ReferenceEntityTemplateSchema = { anchorLink: 'content-guidelines', title: 'Content guidelines', sectionContent: ` -- Be concise. Use a single word to describe the status of an item. +- Be concise. Use a single word to describe the status of an item. - Only use two or three words if you need to describe a complex state, for example "partially fulfilled". ✅ fulfilled diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.ts b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.ts index 9218c2a8e..4ddaf29bf 100644 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.ts +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.ts @@ -1,11 +1,10 @@ -import {ActionItem, extension} from '@shopify/ui-extensions/point-of-sale'; +import {Button, extension} from '@shopify/ui-extensions/point-of-sale'; export default extension( 'pos.purchase.post.action.menu-item.render', (root, api) => { - const actionItem = root.createComponent(ActionItem, { + const actionItem = root.createComponent(Button, { onPress: () => api.action.presentModal(), - enabled: true, }); root.append(actionItem); diff --git a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.tsx b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.tsx index 786e354c2..792fda467 100644 --- a/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.tsx +++ b/packages/ui-extensions/docs/surfaces/point-of-sale/reference/examples/action-api/present-modal.tsx @@ -2,21 +2,16 @@ import React from 'react'; import { reactExtension, useApi, - ActionItem, + Button, } from '@shopify/ui-extensions-react/point-of-sale'; const PostPurchaseActionItem = () => { const api = useApi<'pos.purchase.post.action.menu-item.render'>(); - return ( - api.action.presentModal()} - enabled - /> - ); + return