[App bridge] Add middleware to pass clientInterface data #1033
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.
WHY are these changes introduced?
https://github.com/Shopify/app-bridge/issues/737 (more context: https://github.com/Shopify/app-bridge/issues/730)
WHAT is this pull request doing?
This PR adds a tiny middleware which adds a
clientInterface
property to all App bridge actions dispatched from Polaris, so we can track whether people are using App Bridge through Polaris.How to 🎩
Buckle up, this involves 3 repos 😅
Make sure Core & Web are running.
If you want to see the final Monorail events, you can check out
app-bridge/version-tracking
in Web, but it’s not strictly necessary.In your local
app-bridge
repo, check outversion-tracking-polaris-app
(this changes one of the App bridge playground app’s pages to use App bridge through Polaris).In Polaris-react, run
yarn build-consumer app-bridge
.Back in your friendly neighbourhood app bridge repo, run
dev up && dev server
. If you haven't installed the App bridge playground app on your local shop1, go to https://app-bridge.myshopify.io/auth/shopify?shop=shop1.myshopify.io.Visit https://shop1.myshopify.io/admin/apps/app-bridge/foo.
In the Redux dev tools, make sure you have the
App Bridge
instance selected (top right). Find theAPP::TITLEBAR::UPDATE
action. It should containclientInterface
info:(make sure you have
Action
andRaw
selected)If you checked out the web branch earlier, you should also be able to see a Monorail event with
clientInterfaceName
andclientInterfaceVersion
properties.🎩 checklist