Fetch Inject

:: JavaScript / ES2015 / Rollup

I conceived of a new technique for managing asynchronous dependencies hacking away at a coffee shop called 9-11 in Bali back in 2017. Fetch Inject is a tiny JavaScript library and Node module making it possible to deep link to full-sized After Dark Image Gallery images without blocking or slowing down page load.

The original implementation was 33 lines of code and I quipped each line took me an hour to write because I worked on the library for three days straight.

What I ended up with was something far more powerful than expected, with all kinds of use cases and a suitable replacement for far more complex libraries – sometimes with hundreds or even thousands of lines of code.

I slipped Fetch Inject into WordPress for a talk at WordCamp 2017 and measured a 200-300% improvement in page load performance. So I wrapped it into a single PHP file and made it a WordPress plug-in.