Skip to content

Accept fixed-value settings on inline app blocks - #1407

Open
tyleralsbury wants to merge 1 commit into
mainfrom
tyler/inline-app-block-fixed-settings
Open

tyleralsbury wants to merge 1 commit into
mainfrom
tyler/inline-app-block-fixed-settings

Conversation

@tyleralsbury

Copy link
Copy Markdown

Summary

Allow fixed-value setting arguments on canonical inline app block tags in Theme Check.

{% block 'shopify://apps/example_app/blocks/example-block/00000000-0000-4000-8000-000000000000', heading: 'Hello', enabled: true, items: ['a', 'b'] %}{% endblock %}

Accepted values are strings, numbers, booleans and flat arrays of those. Dynamic sources remain supported as strings, such as '{{ closest.product.title }}'.

Expressions, nil/null, empty/blank, namespaced setting arguments and body content remain invalid. Theme block arguments are unchanged.

Implementation

  • Replace the blanket app-argument error with fixed-value validation in the TypeScript and Rust LiquidSyntaxError implementations.
  • Validate every argument occurrence so a later fixed duplicate cannot hide an earlier expression. Preserve namespaced-argument error precedence and the existing string-only block.name behavior.
  • Add shared parser/check specs, plus graph and document-link regression coverage. The parsers already preserve these argument values, so no grammar change is needed.
  • Include a patch changeset for both Theme Check implementations.

Validation

  • pnpm build:ts
  • pnpm exec vitest run: 8,509 passed, 5 skipped
  • pnpm type-check
  • pnpm format:check
  • cargo test --workspace --locked: passed, including 543 parser specs, 1,859 check specs, 15 graph specs and 3,600 Liquid syntax parity cases
  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • pnpm exec changeset status: valid patch release plan

The specs cover accepted literals, invalid expressions and array elements, duplicate settings, namespaced arguments, body content, liquid-line tags, unchanged theme block expressions and the malformed {% block false %}{% endblock %} negative case.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

1 participant