- 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 thequeue()
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()
onFetch
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 systemread
calls. - Adds internal directory manager to avoid duplicate
fs.mkdir
calls - Improved debug logs
Full Changelog: v5.0.1...v5.0.2