Shopify
The Shopify Theme Debugging Toolkit
You cannot attach a debugger to Liquid. Here is the set of techniques that actually works for finding out why a theme is doing something unexpected.
How debuggers, profilers and tracers actually work under the hood, and how knowing that makes you faster with them.
Shopify
You cannot attach a debugger to Liquid. Here is the set of techniques that actually works for finding out why a theme is doing something unexpected.
Debugging
Using a debugger is supposedly the mark of a serious engineer. Print statements are supposedly what beginners do. Both of those claims are wrong.
JavaScript
Same code, same package.json, different bundler, different result. The difference is resolution conditions and how strict each tool is.
JavaScript
Your editor takes four seconds to show a type error and tsc takes two minutes. There is a profiler for this and almost nobody uses it.
Performance
Width is time, stacking is call depth, and left to right means nothing. Once those three facts land, flame graphs become the fastest way to find a bottleneck.
Debugging
Your commits are almost certainly still there. Here is how reflog works, what it cannot save, and the recovery path for each case.
Debugging
Setting a breakpoint rewrites your program's machine code while it runs. Here is the mechanism, from the 0xCC byte up to why conditional breakpoints are slow.
AI
It was sharp for an hour and now it is contradicting itself and reintroducing bugs you already fixed. That is context degradation, and it is manageable.
Debugging
When your profiler shows nothing and your logs are silent, strace shows you every syscall with timings. Here is a practical subset worth knowing.
AI
Your tool is registered, the agent knows it exists, and nothing happens. Here is how to see what is actually crossing the wire.
AI
An honest inventory after a year of daily use: what earns its place in the loop, what I stopped opening, and where these tools are still bad.
AI
Most agent instruction files are a list of vibes. Here is what belongs in one, based on which rules measurably changed the output.