-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use new asset filter #3582
Use new asset filter #3582
Conversation
The time to introduce support for sub-directories in |
…into use-new-asset-filter
Found a wild bug, when you search in your Country/region selector, the input from the Search page are linked. This is in production though... 14-59-dr7a1-75s0h.mp4 |
For that one, you can create a separate issue. Weird one. |
* Change width and height to be handled by parent context * Optimized SVG files with svgo
Country/Region selector
|
Is the inline_asset_content already in production Liquid? I tried to check how it works but it does not seem to work. Remainder for the dev team as well: make sure to not forget app blocks and make it sure it works for assets inside an app block. |
Not yet. Keep an eye out, though. |
Good ol' Safari, always up for a surprise. Fixed it - TIL height and width auto don't work properly on Safari SVGs. 🤷 |
A few regressions to note while fixing for Safari: |
This set was a bit weird - I didn't see these issues so it's possible another batch of fixes already fixed them. |
Might be coming from the Safari fix
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Tyler and team for the hard work picking on the fine details. I am ready to put my approval on this! Let's continue to keep an eye on the other themes! 💪 🎉
Congrats 👏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a huge amount of work 🚀
excuse me, where is this new filter documented? |
The filter is not yet documented, but will be soon. The usage is as seen in this Pull Request:
And that's all there is to it - it will inline the content of the file into the document. Note that there is a filesize limit of 15kb for assets inlined by the filter. |
The docs are now available. https://shopify.dev/docs/api/liquid/filters/inline_asset_content |
Hi @tyleralsbury , At Maestrooo our icon snippet is a bit more complex. I've tried to do some experiment around this new filter but for now we unfortunately can't easily use it. Would it be possible to add the
|
* Moved snippets to assets and changed to svg * Changed snippet icon rendering to use new inline_asset_content filter * Removed hardcoded SVGs * Made SVGs valid * Refactored + Optimized svg files (Shopify#3586) --------- Co-authored-by: Ludo <[email protected]> Co-authored-by: melissaperreault <[email protected]>
There is an alternate approach to managing icons with SVG symbols, which is my favorite one, and I use it for my Tailwind projects. The icons could live in assets/icons.svg instead of snippets/icons.liquid. Then they can be referenced via <use> tag.
Since assets now load from the same origin, this approach works nicely. For theme editor could use svgxuse. |
Since |
Thanks @tyleralsbury ! That makes sense, I understand there is also probably some heavy caching involved to be able to inline the content and that customizing the output might not be possible. Having said that, having parameters dependant of the type of resource is not a first. The |
* Moved snippets to assets and changed to svg * Changed snippet icon rendering to use new inline_asset_content filter * Removed hardcoded SVGs * Made SVGs valid * Refactored + Optimized svg files (Shopify#3586) --------- Co-authored-by: Ludo <[email protected]> Co-authored-by: melissaperreault <[email protected]>
Refactor of SVGs in Dawn to use the new
inline_asset_content
Liquid filter.