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