You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: