feat(pos): add optional lineItems arg to addLineItem#4531
Open
vctrchu wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
/snapit |
Contributor
|
🫰✨ Thanks @vctrchu! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/ui-extensions": "0.0.0-snapshot-20260626012557",
"@shopify/ui-extensions-tester": "0.0.0-snapshot-20260626012557" |
f0e902b to
e409ce4
Compare
Add an optional third argument to cart.addLineItem so a single call can
create a line item and decorate it with line-item properties, instead of
chaining addLineItem -> addLineItemProperties.
Introduces the AddLineItemOptions type ({properties?}). Backwards
compatible: the third argument is optional. Follows the TAG-friendly
options-bag pattern (extend existing method over new method).
Assisted-By: devx/2ccb68c4-3a6f-43e0-9eb1-37bda8685c84
e409ce4 to
b38d150
Compare
Contributor
Author
|
/snapit |
Contributor
|
🫰✨ Thanks @vctrchu! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/ui-extensions": "0.0.0-snapshot-20260626213319",
"@shopify/ui-extensions-tester": "0.0.0-snapshot-20260626213319" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of https://github.com/shop/issues-retail/issues/28967
Dev Forum Request
What
Add an optional third argument to the POS
cart.addLineItemmethod so a single call can create a line item and decorate it with line-item properties:Introduces the
AddLineItemOptionstype. Backwards compatible — the third argument is optional, so existing two-argument calls are unchanged.Why
Cafe-style POS extensions adding a "modified item" (e.g. coffee + modifiers) currently chain two extension API calls:
Each call awaits its own native SDK call and
syncDraftCheckoutround-trip — measured at ~3s p50 for the sequential pattern.