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

Figure out a way to prevent incompatible/breaking Shopify/theme-liquid-docs JSON schema changes #601

Open
Tracked by #600
charlespwd opened this issue Nov 18, 2024 · 0 comments

Comments

@charlespwd
Copy link
Contributor

charlespwd commented Nov 18, 2024

With #599, we added strict typing of {% schema %} tag parsed content.

We use the JSON Schemas defined over in Shopify/theme-liquid-docs as a type assertion.

Problem with this is that Shopify/theme-liquid-docs is meant to change independently of our codebase. It's that way so that we can ship changes without requiring a release.

This is mostly fine since the types are used inside checks/completion internally and we wouldn't be using types that don't exist yet.

The only problem I can see happening is with changes like the one we recently shipped: accepting blocks presets as a hash rather than an array. This kind of change would make something we strictly type to be an array be an object at runtime. Since the validation is injected, then the "type assertion" would incorrectly say that the parsed object has an array blocks property when it could be array or hash.

We'll need some kind of process to prevent against issues like these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant