Thanks for confirming @JS_Goupil. This really helps!
in pre 2025-10, your extension and all of its screens was mounted within a single JavaScript worker. Now, when you navigate, each screen is mounted in its own instance. This was unfortunately a trade off we had to make to be aligned with the Web Standard Navigation API.
I like the steer towards web standards and tech-framework agnosticism - textbook approach for micro frontends architecture. However, I wish the new behaviour were documented. It’s a significant change and deserves at least a few sentences in the docs, imo. While the docs say that the navigation API “follows web platform standards”, it’s not clear what that entails in the native mobile app.
However, you should still be able to subscribe to the navigation current entry and pass data in there
Yeah, I got the previous example to work by storing the action result via the storage API (no option to pass state in the back method) and then rehydrating the state in the current entry event handler. Is this the recommended approach?
The stale page issue highlighted in The new POS navigation API is unusable - #6 by Galmis comment was caused by shopify.cart.current.value accessed before the page is rendered (cart update action + back() are required, please see the snippet in the linked comment). For example,
This fails
const cartValue = shopify.cart.current.value
return <s-page heading="Test"><SomeContent /></s-page>
This works
return <s-page heading="Test"><SomeContent /></s-page>
function SomeContent() {
const cartValue = shopify.cart.current.value
// ... render something - omitted for brevity
}
Is this expected?
We are working on a better solution for you to be able to subscribe to changes in other screens, cross instance (worker). ie your Screen 3 would be able to subscribe to changes that happen in Screen 1.
This sounds complex. Would it be possible to have an option to opt out of the default behaviour, override the Back/Close button, and listen for back navigation intents (back/close button click and the back gesture)? The web navigation API has the intercept method “to implement same-document (SPA) navigation behavior when a navigation occurs“. This would enable global state sharing while still adhering to web standards. Now, for shared data (e.g., app settings), each page needs to fetch it or retrieve it from the storage API if it exists.
Cheers!