Repository navigation
Add UnsupportedVisibleIf check - #1339
Open
stephanie-shopify wants to merge 1 commit into
Open
stephanie-shopify wants to merge 1 commit into
stephanie-shopify wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
What are you adding in this PR?
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 are resource pickers likeproductandcollection, pluscolor_scheme_groupandcolor_palette. The theme editor always shows those settings. TodayValidSchemareports it as an error, which is how #932 and #963 came up.visible_ifon those types, soValidSchemastops erroring.This PR:
UnsupportedVisibleIfandUnsupportedVisibleIfSettingsSchema(severity: warning, recommended). They reportvisible_ifon unsupported types in section, block and local-block schemas and inconfig/settings_schema.json. Message:visible_if is not supported on settings of type 'product' and will be ignored. The setting is always visible in the theme editor.ValidVisibleIfskips those settings, since their expression is never evaluated.VISIBLE_IF_UNSUPPORTED_SETTING_TYPES), which mirrors Core'sCONDITIONAL_SETTING_UNSUPPORTED_TYPES.What's next? Any followup issues?
unsupported-visible-if(the check'sdocs.urlpoints there).Tophatting
{% schema %} { "name": "Test", "settings": [ { "type": "checkbox", "id": "show", "label": "Show" }, { "type": "product", "id": "p", "label": "Product", "visible_if": "{{ section.settings.show }}" } ] } {% endschema %}shopify theme checkshows a warning onvisible_if(and noValidSchemaerror once the theme-liquid-docs PR is live).Before you deploy
changesetpnpm buildand committed the updated configuration files