Skip to content

Eleventy Fetch v5.0.2-beta.1

Pre-release
Pre-release
Compare
Choose a tag to compare
@zachleat zachleat released this 19 Dec 20:10
· 6 commits to main since this 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. Use async 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() 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.

Full Changelog: v5.0.1...v5.0.2-beta.1