Shopify / themekit

Shopify theme development command line tool.
https://shopify.dev/tools/theme-kit
MIT License
1.2k stars 375 forks source link

js.liquid asset cache inconsistency #940

Open riscidotorg opened 3 years ago

riscidotorg commented 3 years ago

Describe the bug js.liquid assets, which reference other assets via asset_url, are not automatically updated when referenced assets are modified.

To Reproduce Steps to reproduce the behavior:

  1. create js module asset/a.js.liquid with exported function fooBar
  2. create js module asset/b.js.liquid and import asset.js.liquid via import { fooBar } from "{{ 'a.js' | asset_url }}"
  3. deploy a.js.liquid and b.js.liquid
  4. modify and redeploy a.js.liquid
  5. notice b.js.liquid has not been updated; consequently the import url to a.js.liquid is stale.

Expected behavior js.liquid assets, which reference other js.liquid assets via asset_url, should be updated when referenced assets are modified. this issue appears to be isolated to js.liquid files. for example, you can reference image assets within css.liquid files via url({{ 'image.png' | asset_url }}). if you then modify image.png the css.liquid file is automatically updated with the new url.

Environment:

Additional context i am not certain if this is a themekit issue, server side issue, or expected behavior. any insight would be appreciated. thanks.