Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Inconsistent JSON Formatting #3719

Open
2 tasks done
ceri-waterscreative opened this issue Apr 16, 2024 · 1 comment
Open
2 tasks done

[Bug]: Inconsistent JSON Formatting #3719

ceri-waterscreative opened this issue Apr 16, 2024 · 1 comment
Labels
Area: @shopify/theme @shopify/theme package issues Type: Bug Something isn't working

Comments

@ceri-waterscreative
Copy link

Please confirm that you have:

  • 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.)
  • 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 ceri-waterscreative added the Type: Bug Something isn't working label Apr 16, 2024
@ceri-waterscreative
Copy link
Author

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.

@isaacroldan isaacroldan added the Area: @shopify/theme @shopify/theme package issues label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: @shopify/theme @shopify/theme package issues Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants