Skip to content

Commit a89823d

Browse files
authored
Merge pull request #2478 from Shopify/internal-2023-11-update
Internal November 2023 update
2 parents 94609d5 + fcca18d commit a89823d

File tree

60 files changed

+1487
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1487
-52
lines changed

.changeset/fuzzy-trainers-work.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/ui-extensions-react': minor
3+
'@shopify/ui-extensions': minor
4+
---
5+
6+
Release a new Chat component, chat.render targets and preloads.chat configuration

.changeset/hot-shirts-clean.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
Make POS UI Ext PrintAPI async

.changeset/hot-years-relate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
POS UI Ext PrintAPI src non-optional

.changeset/shiny-dingos-battle.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/ui-extensions-react': patch
3+
'@shopify/ui-extensions': patch
4+
---
5+
6+
Fix RenderExtension interface to support synchronous renders and make the clean up function optional
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {
2+
reactExtension,
3+
Chat,
4+
} from '@shopify/ui-extensions-react/checkout';
5+
6+
export default reactExtension(
7+
'purchase.checkout.chat.render',
8+
() => <Extension />,
9+
);
10+
11+
// This component requires the configuration of the `extensions.targeting.preloads.chat` in the extensions configuration file.
12+
// Its value will be used as the `src` attribute of the Chat component.
13+
14+
function Extension() {
15+
return <Chat inlineSize={100} blockSize={50} />;
16+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {
2+
Chat,
3+
extension,
4+
} from '@shopify/ui-extensions/checkout';
5+
6+
// 1. Choose an extension target
7+
export default extension(
8+
'purchase.checkout.chat.render',
9+
(root) => {
10+
// 2. Render a Chat UI. This target only accepts the Chat component. Any other components will not render.
11+
root.appendChild(
12+
root.createComponent(Chat, {
13+
inlineSize: 100,
14+
blockSize: 50,
15+
}),
16+
);
17+
},
18+
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {
2+
Chat,
3+
reactExtension,
4+
} from '@shopify/ui-extensions-react/checkout';
5+
6+
// 1. Choose an extension target
7+
export default reactExtension(
8+
'purchase.checkout.chat.render',
9+
() => <Extension />,
10+
);
11+
12+
function Extension() {
13+
// 2. Render a Chat UI. This target only accepts the Chat component. Any other components will not render.
14+
return <Chat inlineSize={100} blockSize={50} />;
15+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {
2+
Chat,
3+
extension,
4+
} from '@shopify/ui-extensions/checkout';
5+
6+
// 1. Choose an extension target
7+
export default extension(
8+
'purchase.thank-you.chat.render',
9+
(root) => {
10+
// 2. Render a Chat UI. This target only accepts the Chat component. Any other components will not render.
11+
root.appendChild(
12+
root.createComponent(Chat, {
13+
inlineSize: 100,
14+
blockSize: 50,
15+
}),
16+
);
17+
},
18+
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import {
2+
Chat,
3+
reactExtension,
4+
} from '@shopify/ui-extensions-react/checkout';
5+
6+
// 1. Choose an extension target
7+
export default reactExtension(
8+
'purchase.thank-you.chat.render',
9+
() => <Extension />,
10+
);
11+
12+
function Extension() {
13+
// 2. Render a Chat UI. This target only accepts the Chat component. Any other components will not render.
14+
return <Chat inlineSize={100} blockSize={50} />;
15+
}

packages/ui-extensions/docs/surfaces/checkout/reference/helper.docs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ export function getExamples(
145145
...createExample('purchase.checkout.footer.render-after/default'),
146146
...createExample('purchase.thank-you.header.render-after/default'),
147147
...createExample('purchase.thank-you.footer.render-after/default'),
148+
...createExample('purchase.checkout.chat.render/default'),
149+
...createExample('purchase.thank-you.chat.render/default'),
148150
'analytics-publish': {
149151
description:
150152
'You can publish analytics events to the Shopify analytics frameworks and they will be propagated to all web pixels on the page.',

0 commit comments

Comments
 (0)