Skip to content

Commit 2b1ea88

Browse files
authored
Update Dux CDN script to version 5.0.1 (#14336)
This PR updates the @shopify/dux package from version 4.4.0 to 5.0.1 and implements the new Global Privacy Control (GPC) feature. Changes: - Added support for the enableSecGpc flag throughout the application - Modified the GoogleTagManager component to respect GPC signals by not loading GTM when optOutSaleOfData is true - Updated the Dux client configuration to pass the GPC signal from request headers - Added the GPC signal detection in server loaders and partials - Updated the privacy signal API version references in tests from 1.0.2 to 1.0.3 - Added the missing enableSecGpc property in story mock data - This update ensures the application respects the Global Privacy Control signal, preventing tracking and data collection when users have enabled this privacy feature in their browsers. You can test this locally by turning SHOPIFY_DUX_DEBUG_MODE to false in env.development and restarting your server. Then go to a page, turn on sec-gpc: 1 as a header and load brochure.shop.dev. You should see a privacy_signal cookie being set and its value should contain "consentedSaleOfData": "-1". You should also see no google tag manager js being loaded. @merwan7 put together this video for upgrading Brochure (his [PR here](shop/world#330056)): https://share.descript.com/view/zHjZb1tzCBk Verified that dux 5.0.1 is being called locally: <img width="956" height="588" alt="image" src="https://github.com/user-attachments/assets/46567d2c-edd3-4ae5-9f63-24aad8978cb6" /> <!-- ☝️How to write a good PR title: - Prefix it with [ComponentName] (if applicable), for example: [Button] - Start with a verb, for example: Add, Delete, Improve, Fix… - Give as much context as necessary and as little as possible - Open it as a draft if it’s a work in progress --> ### WHY are these changes introduced? Fixes #0000 <!-- link to issue if one exists --> <!-- Context about the problem that’s being addressed. --> ### WHAT is this pull request doing? <!-- Summary of the changes committed. Before / after screenshots are appreciated for UI changes. Make sure to include alt text that describes the screenshot. Include a video if your changes include interactive content. If you include an animated gif showing your change, wrapping it in a details tag is recommended. Gifs usually autoplay, which can cause accessibility issues for people reviewing your PR: <details> <summary>Summary of your gif(s)</summary> <img src="..." alt="Description of what the gif shows"> </details> --> ### How to 🎩 🖥 [Local development instructions](https://github.com/Shopify/polaris/blob/main/README.md#install-dependencies-and-build-workspaces) 🗒 [General tophatting guidelines](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md) 📄 [Changelog guidelines](https://github.com/Shopify/polaris/blob/main/.github/CONTRIBUTING.md#changelog) ### 🎩 checklist - [ ] Tested a [snapshot](https://github.com/Shopify/polaris/blob/main/documentation/Releasing.md#-snapshot-releases) - [ ] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [ ] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [ ] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [ ] Updated the component's `README.md` with documentation changes - [ ] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 77806e8 commit 2b1ea88

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.changeset/loud-rivers-wear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'polaris.shopify.com': patch
3+
---
4+
5+
Updating dux package to 5.0.1

polaris.shopify.com/pages/_app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function MyApp({Component, pageProps}: AppProps) {
9393
return promise;
9494
}
9595
// example loading from CDN
96-
loadScript('https://cdn.shopify.com/shopifycloud/dux/dux-portal-4.4.0.min.js').then(() => {
96+
loadScript('https://cdn.shopify.com/shopifycloud/dux/dux-portal-5.0.1.min.js').then(() => {
9797
Dux.init({
9898
eventHandlerEndpoint: 'https://www.shopify.com/__dux',
9999
mode: 'production',

0 commit comments

Comments
 (0)