Shopify.extension.toml uid specific per app?

Hi there,

Just familiarizing myself with the new Dev Dashboard migration documentation.

Some background, like (probably) all Shopify developers, I maintain a separate app instance for each environment.

  • My App (production)
  • My App - Dev (development)
  • My App - Staging (staging)

In the past, I could rely on different app toml files to control my shopify extension deployments:

# deploying to staging for example
shopify app deploy –config=shopify.app.my-app-dev.toml

However all of these different apps shared the same code base. The extensions were exactly the same code itself.

The introduction of a uid inside of an extension toml sounds like the uid will be separate for each app?

If the uid is a hard reference to the extension associated with the production app, then will we have to remember to re-link the config every single time we switch to a development branch? Then vice versa when preparing for production deployments?

Maybe I’m misunderstanding, or there’s some new environment handling in the Dev Dashboard I’m not privvy too yet.

1 Like

Hi Dylan,

The new uid is app-scoped and source-defined, so it can be (and should be) shared between all the environment instances of your app.

You can read more on this change here:

-Nick

1 Like

Thanks @NickWesselman ! Great explaination, I wish that was linked from or a part of the official docs.

So the long story short is that the uid doesn’t have to be unique per app. In fact, it should not be unique per app.

It’s unique per extension, but an extension can be deployed across apps.

I think that’s what I gather from this sentence:

These UIDs are app-scoped, and source-defined – so unlike the global .env identifiers, they can be the same when deploying any linked copy of your app.

So as long as I commit the uid’s of the production version of my app, then the other environments can reuse that same uid and not have a conflict.

Please let me know if I’m misunderstanding that though.

Yep you got it! We do explain the nature of the IDs, and the recommended process for multiple apps, in the migration docs as well:

4 Likes

Just 1 follow up question:

So I understand my app-prod and app-stagingwill both have the same uid for my-extension.

Then, if I go ahead and update the code for my-extension from 0.1 to 0.2, and deploy the app-staging I wouldn’t want that update to land for app-prod yet.

How does Shopify understand that only app-staging should get v0.2 of my extension which share the uid with app-prod ?

Even though the UIDs are shared in the code between your staging and production apps, the updates to each extension are made when you deploy the app itself. So in your example if you deploy the app-staging app only that app’s extensions will be updated. The app-prod app must be separately deployed for it to have an update applied to its extensions.

2 Likes