I'm using Theme Kit to build a theme. Recently, after watching Shopify Unite 2021, I was interested in building a new page using a JSON template. Even though I've read in the docs that it is not supported through Theme Kit, I decided to try anyway. And surprisingly it worked and I really liked the idea. Everything was great until I needed to deploy/publish new changes to the theme, not related to that JSON template. Firstly, I tried publishing 'development' theme which was a duplicate of the live theme with new changes added. Secondly, I tried deploying new changes via 'theme deploy' command. But in both cases the content of my page using JSON template was wiped out. I wonder if this is the expected behavior? Is there any way to make sure that the content is not getting wiped out when I'm introducing new changes not related to that template? Should I switch to using Shopify CLI instead of Theme Kit to avoid this issue?
Previously, section settings were saved to settings_data.json. Now, these settings are saved to json template files.
if you are re-uploading empty .json template files, the section settings are wiped out.
I spend an hour reading the migration guide and realize the issue here.
I've been working on a new Online Store 2.0 theme and have come to this realization as well. The migration guide does state multiple times that Theme Kit is not the ideal choice for working with Online Store 2.0 themes, so I should have seen the writing on the wall. It seems we really need to buy into the new Shopify CLI workflow and GitHub integration to work safely with Online Store 2.0 themes.
As mentioned in the GitHub integration docs, modifications made in the theme editor, code editor, or by apps are committed to the Git repo. This would ensure that all theme changes are accounted for and merged. This is likely to prevent what happens if you deploy JSON templates through Theme Kit that don't have the changes made in the Shopify admin. What I'm currently unsure of is if the shopify push pushes changes to the repo or just deploys files directly to the theme. If it doesn't go through GitHub, then you could potentially overwrite a JSON template there too.
Probably more new questions than answers in there, but I'm trying to understand the best approach to adopt the "Online Store 2.0 Way". Right now, it's looking like my existing workflow is going to need some significant changes due to the new JSON templates storing settings and data.