Replies: 4 comments
-
Love that you flagged this! IMO our approach of requesting the icons should should be fine for non-critical path icons -- but your point makes sense (and maybe what merchants are referring to) with icons that are more critical.
The biggest dealbreaker for that is that we remove flexibility of changing out the contents of the icon from theme to theme
I think we're definitely onto something with our current approach. Not convinced that we need to backtrack back to snippets for SVGs yet.
We should definitely minimizing layout shift regardless to our final approach Spitballing a few ideas:
Our approach is inspired by Shoelace's icon component -- what more can we learn from there? Would be great to see some before/after experiments! |
Beta Was this translation helpful? Give feedback.
-
I would not backtrack, otherwise we risk having two fragmented solutions to the same problem. I would go all-in with our current approach—it's solid given the amount of flexibility it provides. @t-kelly the Some questions worth exploring:
|
Beta Was this translation helpful? Give feedback.
-
I've been playing with the idea of preloading and inlining the JS (currently placed in the layout files) and got good results! Now i'm no network timing expert but here are recordings using 'regular 3g' network throttling Preloading and InliningScreen.Recording.2024-05-24.at.9.38.27.AM.movCurrent approachScreen.Recording.2024-05-24.at.9.41.26.AM.movAs you can see it's even faster than the font rendering and in our current approach the age verification will appear before the icons have a chance to load Now if we do like these results we can certainly keep moving forward with it, i'm not 100% sold on placing the JS in the layout files so i'm open to some thoughts here but as for preloading icons we can keep it fairly controlled with conditionals
To add, I'm only preloading the icons we know for sure will appear above the fold |
Beta Was this translation helpful? Give feedback.
-
I did my own testing and found out our approach is not the bottle neck, just the wrapping |
Beta Was this translation helpful? Give feedback.
-
Some merchants are commenting that icons are loading in slowly in our themes, recently we went ahead and decided to fetch our icons using JS instead of using a large snippet containing all of the icons.
While this offers some benefits it does have the disadvantage of a noticeable load time (specifically elements ‘above the fold’). I had a brief chat with @bertiful today and wanted to start a discussion on what we all think may be the best approach is here.
A couple of options I’ve brainstormed would be
In any case it’s only been a handful of merchants bringing this up so there is no immediate urgency so we have the luxury of time to discuss what we think is the future of icons in our themes.
Beta Was this translation helpful? Give feedback.
All reactions