Themekit: Handle new config.yml on change detection (either error, warn or use new data)

Created on 3 Nov 2016  路  9Comments  路  Source: Shopify/themekit

I am working with several git branches, each branch with a different config.yml. In deed, each branch is a different shopify shop. With this workflow is a really common mistake to change branches without stopping theme watch. So, accidentally chaging branches will cause lot of unintended updates on my sites.

I think it is reasonable to stop themekit execution if current config.yml has changed.

Another workarounds would be to raise a warning (but it is not a solution for me), to prompt asking if the user want to continue with the new configuration or to operate using new configuration.

Most helpful comment

We just had a discussion about this yesterday, and none of our solutions were as elegantly simple as this. Nice one @arypbatista. Super simple, super logical.

All 9 comments

Thanks this is a good idea, I will see what I can do.

We just had a discussion about this yesterday, and none of our solutions were as elegantly simple as this. Nice one @arypbatista. Super simple, super logical.

Hey @Cam @arypbatista When you change branches, are you seeing it instantly start uploading your diff changes or only after you edit the files?

Hi @tanema, as soon as I git checkout <branch> lot of events are triggered on themekit causing files to upload.

ah at the very least maybe the documentation could be updated to just say if you're going to switch, don't forget to clean up watcher(s)? was spinning my wheels on why my themeid weren't propagating after reconfiguring config.yml

Not sure how this is a duplicate of https://github.com/Shopify/themekit/issues/316 but how would we go about using Livereload. The example with --notify=/tmp/theme.update doesn't seem to do anything.

Right now if you are running theme watch and there is a change to the config.yml file, it will automatically reload the watchers.

The notify file is touched when watch is idle.

What about Livereload for the theme? Doesn't it refresh the browser? Also, have you considered integrating with https://github.com/browsersync?

Was this page helpful?
0 / 5 - 0 ratings