[Bug]: Inconsistent JSON Formatting
Please confirm that you have:
- [X] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- [X] Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Theme
Expected behavior
The format of .json templates to be consistent throughout systems.
Actual behavior
- When you download a theme via the Store Admin any .json template files are both escape and minified.
- Whereas the GitHub integration (when updates are done in the customizer) syncs it without the JSON being minimised (prefered).
- The CLI does it different even again (when using --theme-editor-sync) - it does it without being minified and doesn't escape the JSON.
Verbose output
N/A
Reproduction steps
-
Download the Theme from the Shopify Admin (using the "download theme file" button).
-
Drop the contents over your locally setup Theme and See the File differences.
-
Setup a Theme using the GitHub Integration and customize a these templates using the "Customize" action.
-
Using the CLI run "shopify theme dev --theme-editor-sync" against that Repository and branch, you'll get notified that files between your local copy and the theme dev copy are different, choose to keep local. The templates will now get downloaded regardless, but without the JSON being escape.
In both scenarios you're left with changes to your .json templates, whereas ideally it should be consistent between all three systems.
Operating System
Windows 11
Shopify CLI version (check your project's package.json if you're not sure)
3.58.2
Shell
Git Bash
Node version (run node -v if you're not sure)
18.12.1
What language and version are you using in your application?
N/A
Just a further comment on this, where the JSON had been unescaped in the templates - it worked fine in theme Customizer but not on the front-end when putting the theme live.
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
Bump
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
still relevant
👋🏻 Hi @ceri-waterscreative and @knjshimi. Thanks for reporting this.
I managed to follow your reproduction steps and also noticed that theme zips downloaded through the admin are minified. I also connected a Github repository and noticed that running shopify theme dev --theme-editor-sync on the same commit prompts me to choose whether I keep my remote or local versions of the files. I'm going to check with the team on the expected behaviour for this and will get back to you 😄
Are you able to clarify what you mean when you say .json template files are both escape and minified - do you have an example of the escaping? Thanks
Update from the Shopify team:
We're aiming to ship a fix for this in the next release which is scheduled for early next week. In the meantime, we'd recommend downgrading if this is a blocking issue.
There are lots of moving parts that our services rely on, so thanks for bearing with us as we improve our service!
Hi all, a fix for some incosistencies with miniifcation has been released in the latest version of Shopify CLI (3.67.3). Please let us know if you still have issues after trying again.
Thanks
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.