A Test of Eleventy Fetch

It has been quite some time since I wrote about Eleventy. My last post was a quick announcement about me upgrading my site to Eleventy 3.0 and how well that worked. I was going through my list of blog ideas and realized that in March of 2022, yes, 2022, I wrote down that I should take a quick look at Eleventy Fetch: I knew it worked, but I was curious about a few things, for example, invalidating the cache, but apparently this idea got buried and forgotten about until… today! So yes, it works, and works really well and if that’s all you care about, hit up the docs and you’re good to go. I had to see this for myself though. My API I began by creating a quick HTTP-based API... more →
Posted in: JavaScript

fetch with Timeout

A few years back I wrote a blog post about how write a fetch Promise that times out. The function was effective but the code wasn’t great, mostly because AbortController , which allows you to cancel a fetch Promise, did not yet exist. With AbortController and AbortSignal available, let’s create a better JavaScript function for fetching with a timeout: Much like the original function, we’ll use setTimeout to time to the cancellation but we’ll use the signal with the fetch request: async function fetchWithTimeout(url, opts = {}, timeout = 5000) { // Create the AbortController instance, get AbortSignal const abortController = new AbortController(); const { signal }... more →
Posted in: JavaScript

Netflix builds JavaScript library to fetch data – InfoWorld

InfoWorld Netflix builds JavaScript library to fetch dataInfoWorldWith its Falcor project, Netflix is offering a JavaScript library for efficient data-fetching, with developers able to represent remote data sources as a single domain model via the JSON Graph convention. Netflix, which uses Falcor for the company's …and more » JavaScript – Google News… more →
Posted in: JavaScript