Move the platform forward, one step at a time 🪜
Every step you take reveals new or emphasizes existing pain points. The need for subfolders to better organize assets has been felt by developers long before the new inline_asset_content filter has been introduced, and adding 100 SVG files in the mix only emphasizes the need further.
There is no such thing as a quick win when you reach Shopify’s scale. Each time you add an ‘and’ to a feature request, you’re forced to solve for more variables which takes longer to solve and thus delays delivering value to your customer.
Take this seemingly simple new filter, inline_asset_content. It does just one thing — take content of the file and inline it in the page response. Simple, right? But that file is hosted on CDNs far away from Shopify’s Liquid Renderer, not in DB like Liquid files are. And that file is now a dependency for the Liquid renderer, which is the main player in page response speed (TTFB). And these files can change and invalidate any cached responses at any time. And what do we even call this filter? And Tobi wants this shipped now, not in 2 months.
Yes is would be nice to have options to modify classes in the svg, or specify height, or organize your svgs in the assets folder better — but these are nice to have when considering the main problem you’re trying to solve.
What’s important here is progress; each precise step removing SOME complexity. Working with native SVG files is simpler than all previous solutions. End of story. Done. Ship it.
Inline_asset_content is one step forward, and hopefully the first of many more steps as Shopify’s online store team picks up momentum again.
So what’s next? Subfolders in assets would certainly be nice 😜
Recently, I have seen many of my fellows Shopify developers get really excited about the new 'inline_asset_content' filter in Liquid and don't get me wrong I am too.
It's awesome to output in any web page and with a one-liner the content of a SVG, JS or CSS file located in the assets folder of a Shopify project.
The thing is that I don't get why this new filter is presented as a game changer for theme SVGs management.
Most of the time, there are a lot of SVGs in any website project and I don't want them to pollute my assets folder, even if they are alphabetically ordered (I'd like to keep my scroll wheel working).
Maybe am I missing something here?
To me, it would be perfect if we can specify the SVGs subfolder in a parameter like this:
{{ 'linkedin.svg' | inline_asset_content: subfolder: 'icons' }}
Meanwhile, even if I know it is a bit more work, I'll stick to manually taking care of my SVGs markup within a same file and call each of them this way:
{%- render 'icon' with 'linkedin' -%}
And you? How do you work with SVGs? Do you know a better way to deal with them?
Please feel free to share what your thoughts are about all that and let's discuss it!
-
Senior Backend Engineer | Full Stack Developer | PHP | Laravel | Ruby on Rails | React.js | Node.js | AWS | Shopify Plus Developer
3moThanks for sharing a detailed roadmap. However, there should be some roadmap on HPOS as well. I know HPOS already gives us separate Orders and some other DB tables. However, we could also get dedicated DB tables for Products data. Thanks!