Shopify / ui-extensions

MIT License
269 stars 35 forks source link

Persistent storage for POS UI Extensions #975

Open dsnvs opened 1 year ago

dsnvs commented 1 year ago

Please list the related package(s)

retail-ui-extensions, retail-ui-extensions-react

If this related to specific APIs or components, please list them here

Is your feature request related to a problem? Please describe.

Our POS UI Extensions will render differently depending on the merchant's settings for our app (e.g: we need to load the currency format to render money). Currently, we fetch these settings from our server every time a merchant opens the app's modal, and although this approach works it adds delay to the initial render.

We would like a way to maintain the settings on the device between different times the modal is opened.

Describe the changes you are looking for

Some sort of storage that would be persistent between different modal openings. Maybe implement localStorage for POS UI Extensions.

An alternative would be to load the settings on the POS tile, and pass props to the modal through the api.smartGrid.presentModal() function.

Describe alternatives you’ve considered

Additional context

galmis commented 1 year ago

+1. I'm facing a similar type of issue. Some form of local cache in POS UI extensions would be useful.

pablogiralt commented 1 year ago

+1 same here

timvandam commented 10 months ago

+1 would be useful

rex-empowerdigital commented 4 months ago

+1

adamwooding commented 4 months ago

+1

kvmsc commented 4 months ago

+1 One suggestion is to have two types of storage options,

  1. Session Storage - Lives until the cart session exists, allowing the sharing of data between tiles and modals
  2. Persistent Storage - Using Application Cache in React Native, allowing the storage of long lived merchant related constants, white-labeled application text etc

This will enhance the POS extension experience tenfold.

Currently for that first problem, I use cart properties to share data between tiles/modals, it isn't ideal but works.

mrniamster commented 3 months ago

+1 facing the same, unable to share data btw tiles x modal, tried using a state management lib but it doesn't work