Repository navigation
Accept visible_if on setting types that ignore it - #1922
Open
stephanie-shopify wants to merge 2 commits into
Open
stephanie-shopify wants to merge 2 commits into
stephanie-shopify wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Shopify Core is changing so that
visible_ifon a setting type that doesn't support it is accepted and ignored, instead of failing the file save. The affected types arearticle,article_list,blog,collection,collection_list,metaobject,metaobject_list,page,product,product_list,color_scheme_groupandcolor_palette. The theme editor always shows those settings.visible_ifnever affects storefront output, and failing saves on it was causing support issues.Core PR: https://meteorite.shopify.io/repos/shop/world/pulls/2172172 (stack: 2172229)
Theme Check runs these schemas under
ValidSchema, which reports every schema problem as an error. So this PR stops treatingvisible_ifas an unknown property on those types. A paired Theme Check PR (Shopify/theme-tools#1339) adds anUnsupportedVisibleIfwarning so developers still find out it's ignored.What
ignoredConditionalSettingdefinition, with a description explaining that the property is ignored. The value must be a string, matching Core, which rejects non-strings because Canvas reads the raw schema and expects a string.visible_ifreferences it on each of the unsupported types.color_scheme_groupdefinitionare unchanged and still rejectvisible_if, matching Core.Merge order
Merge after the Core stack ships. Otherwise Theme Check will pass files that Core still rejects on save.
Tests
The "should not allow visible_if on %s" tests in
section.spec.ts/theme_block.spec.ts/color_palette.spec.tsnow check thatvisible_ifis accepted.