Skip to content

Eleventy Fetch v5.0.2

Latest
Compare
Choose a tag to compare
@zachleat zachleat released this 07 Jan 23:20
  • Improved advanced API (you might not need this). Existing default export creates an instance and couples data fetching together. This release adds a Fetch named export to create a Fetch instance without fetching data automatically. Works with the concurrency queue. Use the queue() method to fetch data.
import CachedFetch, { Fetch } from "@11ty/eleventy-fetch";

let data = await CachedFetch(source, options);

// is the same as:
let inst = Fetch(source, options);
let data = await inst.queue();
  • Adds wasLastFetchCacheHit() on Fetch instances, used to solve bug with Eleventy Image disk cache 11ty/eleventy-img#146
  • Improved efficiency: Adds top level instance cache and a few internal caches to avoid duplicate fetch or file system read calls.
  • Adds internal directory manager to avoid duplicate fs.mkdir calls
  • Improved debug logs

Full Changelog: v5.0.1...v5.0.2