Eleventy Fetch v5.0.2-beta.1
Pre-release
Pre-release
- 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 that does not automatically fetch data and works with the concurrency queue. Useasync queue()
to fetch data.
import { Fetch } from "@11ty/eleventy-fetch";
let inst = Fetch(source, options);
let data = await inst.queue();
same as:
import CachedFetch from "@11ty/eleventy-fetch";
let data = await CachedFetch(source, options);
- 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.
Full Changelog: v5.0.1...v5.0.2-beta.1