cli icon indicating copy to clipboard operation
cli copied to clipboard

[Bug]: Inconsistent JSON Formatting

Open ceri-waterscreative opened this issue 1 year ago • 9 comments

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

  1. Download the Theme from the Shopify Admin (using the "download theme file" button).

  2. Drop the contents over your locally setup Theme and See the File differences.

  3. Setup a Theme using the GitHub Integration and customize a these templates using the "Customize" action.

  4. 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

ceri-waterscreative avatar Apr 16 '24 07:04 ceri-waterscreative

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.

ceri-waterscreative avatar Apr 16 '24 08:04 ceri-waterscreative

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.

github-actions[bot] avatar May 31 '24 03:05 github-actions[bot]

Bump

ceri-waterscreative avatar May 31 '24 07:05 ceri-waterscreative

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.

github-actions[bot] avatar Aug 01 '24 03:08 github-actions[bot]

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.

github-actions[bot] avatar Sep 13 '24 03:09 github-actions[bot]

still relevant

knjshimi avatar Sep 13 '24 03:09 knjshimi

👋🏻 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

lukeh-shopify avatar Sep 25 '24 22:09 lukeh-shopify

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!

jamesmengo avatar Sep 26 '24 23:09 jamesmengo

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

lukeh-shopify avatar Oct 01 '24 17:10 lukeh-shopify

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.

github-actions[bot] avatar Nov 13 '24 03:11 github-actions[bot]