Skip to content

@shopify/theme-check-common@4.0.0

Choose a tag to compare

@github-actions github-actions released this 06 Nov 19:34
· 35 commits to main since this release
10b1ed4

Minor Changes

  • c587ae0: Add an optional remoteFileSize dependency: the size of a remote file, such as a script on a CDN. AssetSizeCSS and AssetSizeJavaScript use it, and by default it makes the same HEAD request as before.

Patch Changes

  • 7cb4970: Parse the Liquid inside HTML comments. Liquid renders it, and its tags can open, branch and close blocks, so {% if a %}<!-- {% endif %} --> no longer fails with an unclosed if.

    • HtmlComment has children (text and Liquid) and blockStartPosition/blockEndPosition for its delimiters.
    • A comment that crosses a Liquid block boundary is split there, and each part has an empty delimiter range on the split side.
    • A comment that never closes ends at the end of the file, as in a browser.
    • An end tag in a comment that closes no block is a parse error, as in Liquid.
    • The opaqueHtmlComments option keeps comment bodies opaque.

    Behavior changes

    • Code that walks children now visits the Liquid and text inside HTML comments.
    • <!-- {% if a %} --><p>x</p><!-- {% endif %} --> is one comment whose if holds <p>x</p> as text, not two comments around a <p> element.
    • <!-- {% endif %} --> with no open if no longer parses. An unclosed <!-- and {% if a %}<!-- {% endif %} --> now parse.
    • Code that creates HtmlComment nodes must set children, blockStartPosition and blockEndPosition.

    Pass opaqueHtmlComments: true to get the previous tree for these templates.

    Checks now see the Liquid in HTML comments, and completions work inside them. Prettier prints an unclosed comment as written, and can move whitespace and line breaks inside a comment that holds a Liquid block or is split by one.

  • Updated dependencies [7cb4970]

  • Updated dependencies [7cb4970]

  • Updated dependencies [7cb4970]

  • Updated dependencies [c8099ba]

  • Updated dependencies [320fa1f]

  • Updated dependencies [5b634d9]

  • Updated dependencies [7cb4970]

  • Updated dependencies [a73b174]

  • Updated dependencies [7cb4970]

  • Updated dependencies [7cb4970]

  • Updated dependencies [5aec106]

  • Updated dependencies [34dae62]

    • @shopify/liquid-html-parser@2.12.0