Skip to content

Releases: 11ty/eleventy-fetch

Eleventy Fetch v5.0.2-beta.2

04 Jan 03:53
Compare
Choose a tag to compare
Pre-release
  • Adds internal directory manager to avoid duplicate fs.mkdir calls
  • Improved debug logs

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

Eleventy Fetch v5.0.2-beta.1

19 Dec 20:10
Compare
Choose a tag to compare
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. 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

Eleventy Fetch v5.0.1

16 Nov 20:34
Compare
Choose a tag to compare
  • Fix internals issue with missing default options on queue() function for 11ty/eleventy-img, related to 11ty/eleventy-img#252

Full Changelog: v5.0.0...v5.0.1

Eleventy Fetch v5.0.1-beta.1

16 Nov 20:07
Compare
Choose a tag to compare
Pre-release

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

Eleventy Fetch v5.0.0

16 Nov 19:26
Compare
Choose a tag to compare

11ty.dev docs for Fetch have been updated for v5.0.0: https://www.11ty.dev/docs/plugins/fetch/

npm install @11ty/[email protected]
  • Breaking: requires Node 18+
  • Breaking: Use native fetch() and drop node-fetch dependency by @uncenter in #37
  • Not Breaking: for compatibility this package is still CommonJS (not ESM)
  • Support URL instance target #41
  • Use AbortSignal for fetch timeouts #39
  • Support custom function source (async-friendly) @doug-wade in #32
  • Allow custom filename via filenameFormat by @chriskirknielsen in #49
  • Add prettier @uncenter in #38
  • Cache request verbs (e.g. POST versus GET) separately (and request body) by @Zegnat in #34
  • Upgrade dependencies to get rid of deprecation warnings by @Zegnat in #46
  • Upgrades flat-cache dependency from v3 to v6 (internal API changes)
  • Update debug module name Eleventy:Fetch by @uncenter in #40
  • Adds support for type: "xml" (alias for "text")
  • Adds support for type: "parsed-xml" #53 returns a JS object via @rgrove’s https://github.com/rgrove/parse-xml
  • Adds returnType: "response" option to return (and cache) Response metadata, including url, status, headers, body.
  • Adds requestId option to control reuse, de-duping, unique cache keys when caching non-URL sources. Fixes a few more bugs with de-duping internally when HTTP methods and body requests are used for cache keys.

Eleventy Fetch v5.0.0-beta.7

12 Nov 22:46
Compare
Choose a tag to compare
Pre-release
  • Adds support for type: "xml" (alias for "text")
  • Adds support for type: "parsed-xml" #53 returns a JS object via @rgrove’s https://github.com/rgrove/parse-xml
  • Adds returnType: "response" option to return (and cache) Response metadata, including url, status, headers, body.

Full Changelog: v5.0.0-beta.6...v5.0.0-beta.7
Full Milestone: https://github.com/11ty/eleventy-fetch/milestone/5?closed=1

Eleventy Fetch v5.0.0-beta.6

12 Nov 19:39
Compare
Choose a tag to compare
Pre-release
  • Adds requestId option to control reuse, de-duping, unique cache keys when caching non-URL sources. Fixes a few more bugs with de-duping internally when HTTP methods and body requests are used for cache keys.

Full Changelog: v5.0.0-beta.5...v5.0.0-beta.6
Full Milestone: https://github.com/11ty/eleventy-fetch/milestone/5?closed=1

Eleventy Fetch v5.0.0-beta.5

08 Nov 23:30
Compare
Choose a tag to compare
Pre-release
  • Fix for de-duplication of custom fetching functions #52 (Related to #32)

Full Changelog: v5.0.0-beta.4...v5.0.0-beta.5
Full Milestone: https://github.com/11ty/eleventy-fetch/milestone/5?closed=1

Eleventy Fetch v5.0.0-beta.4

25 Oct 20:13
Compare
Choose a tag to compare
Pre-release
  • Very big fix for overly aggressive cache misses due to new cache instance being created too often 818313f

Full Changelog: v5.0.0-beta.3...v5.0.0-beta.4
Full Milestone: https://github.com/11ty/eleventy-fetch/milestone/5?closed=1

Eleventy Fetch v5.0.0-beta.3

23 Oct 13:12
Compare
Choose a tag to compare
Pre-release

Full Changelog: v5.0.0-beta.2...v5.0.0-beta.3
Full Milestone: https://github.com/11ty/eleventy-fetch/milestone/5?closed=1