Been dealing with a head scratcher on the 100kb max limit on extensions because I find it hard to produce liquid-native app blocks given the schemas alone dominate file size. I have been trying the approach of building for Horizon to ensure my app block can actually render snippets from the theme to cut down on unnecessary UI that already exists in the theme, but no luck…
What’s the best way to bring in more Liquid code into my app block outsize of the app block itself? Key word there is ‘liquid’ which is why I’m not simply using a script.
Long answer:
You want to render a snippet from the theme in an app block. This is an anti pattern. The app block can be installed in any theme. How do you know such a snippet exist? To me it does not make sense for Shopify to do this.
Now the 100kb limit could be annoying but its a large enough limit, How many lines of code do you have here? I just checked my 1000 lines file is 21 kb. Maybe there are svgs or styling you can move to assets?
Schema alone for mine as 10kb which is what the challenge is. Obviously I need to cut that down but if you give 25 settings you can include I wish that gelled nicer then with having 100kb. I use product cards in my blocks - therefore it’s much better to use the merchants product card and I built a variety of ways of trying a few ways to get the right product card + then use block inputs for them to dial in more settings. My app block pulls in products the merchant’s influencers recommend. I understand I’ve probably hit the limit but just exploring here.