Repository navigation
feat(order-export): greet shoppers with a storefront welcome message - #5
Merged
Merged
Conversation
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.
Adds a fifth step to Order Export: a storefront script that greets shoppers with a small welcome message, the kind a live-chat app shows, with a close button.
storefront/welcome.js: plain JavaScript in its own shadow root, so the store's CSS can't reach in and its own can't leak out. "Hi! Are you looking for something?", or "Any questions about this product?" on a product page, followingwindow.FlyCommerce.pageTypeand theflycommerce:pageevent. × closes it, and it stays closed while the shopper browses. Reads no cookies, storage or forms.src/storefront.tsserves it atGET /storefront/welcome.js;app-config.jsondeclares it understorefront.scriptswithload: "idle".npm run devpasses the scripts to the emulator and prints the example storefront at/storefront.test/storefront.test.ts: declared on the app's own host, served as JavaScript, run by the emulator's storefront (fails if the route and the declared path drift apart).^0.1.0-next.1(the first preview with storefront scripts).Checked in a browser on the emulator's storefront: the message appears, changes on the product page, and closes.