How can we lock the version of Polaris Web Components loaded from the CDN?

Hi everyone :waving_hand:

I’ve been experimenting with the new Polaris Web Components, and I noticed that the recommended way to include them is via:

<script src="https://cdn.shopify.com/shopifycloud/polaris.js"></script>

However, it seems that this script always retrieves the latest version available.

As app developers, we often need to ensure our carefully designed UI experiences remain stable and consistent over time. Automatic upgrades could potentially introduce unexpected visual or behavioral changes, which we might prefer to test and integrate manually.

My question is:
Is there currently a way to lock or pin a specific version of Polaris Web Components when loading from the CDN?
For example, something like:

<script src="https://cdn.shopify.com/shopifycloud/polaris/vX.Y.Z/polaris.js"></script>

Or alternatively, a recommended best practice to manage version control for these assets?

We’d like to have control over when to upgrade Polaris, so we can handle updates at our own pace and ensure everything remains stable for merchants using our apps.

(post deleted by author)

@HamzaDincer NPM is for the React polaris deprecated library - my post is only relevant for the new Web components.

@muchisx The only way to 100% guarantee a specific version is to serve it yourself.

1 Like

The Polaris Web Components are explicitly versionless for now – you will automatically get bug fixes, style changes, etc. that keeps you in sync with Shopify Admin.

Hi @Anthony_Frehner

Thanks for the reply!

Are there any plans to expose a versioned URLs for the web components?

I understand the Pros you’ve described - however, our Cons are outlined in my post.

2 Likes

I agree. I understand the teams reason for why they want one version but the truth is we are now out of the early release phase and now in the full release, yet the team still makes breaking changes to components.

Either changes need to not be breaking or they need to have a system for rolling updates. Maybe have an unstable, stable and release channel for the components?

2 Likes

Just today I’ve found two cases where updates to web components behind the scene have broken functionality in my app:

This is quite frustrating. If Shopify want to make the argument that the advantages of constantly updated styling and bug fixes outweigh the risks of breakage, they’re going to have to have much better QA on their releases across a range of behaviours and settings. The current state of things is really not acceptable, and it seems really irresponsible to encourage developers to ship functionality built on these components to production.

1 Like

To be clear, the root cause of some of these issues isn’t the Polaris CDN script, so while I understand that it’s frustrating to deal with, it’s also not accurate to blame the Polaris CDN for these regressions.

I’m asking the team in charge of extensibility for an update on them. Thanks!

1 Like

The problem with version-less is that sync with the Admin is not the same as working , or passing tests, or support burdens.
It’s not like there’s a place inside the admin with ALL possible Polaris part-combinations where developers can point a merchant at to confirm any possible upstream issues; unless were gonna start seeing polaris snafus as incidents in shopifystatus.com :rofl: .