Shopify / theme-check

The Ultimate Shopify Theme Linter
Other
338 stars 95 forks source link

Add AssetPreload check #603

Closed krzksz closed 2 years ago

krzksz commented 2 years ago

Hey 👋

The goal of this check is to discourage people from preloading assets using plain HTML in cases when it is possible to use Liquid filters instead.

It is sometimes the case that <link rel="preload" ...> is positioned late in the <head>, preventing the browser from discovering it early. In addition, this manual approach is not automatically converted to Link header so Shopify is not able to forward it to Early Hints response. These issues are not present when using Liquid filters mentioned above.

charlespwd commented 2 years ago

Hmm why are the unit tests not running? 🤔

Oh. @krzksz, it's because you haven't used the Shopify remote when pushing your changes (you used a fork) and we probably have setup this repo to run unit tests only by employees. We should change that... or figure out a better way.

krzksz commented 2 years ago

Closing in favour of https://github.com/Shopify/theme-check/pull/605