Skip to content

Eleventy Fetch v5.0.0

Compare
Choose a tag to compare
@zachleat zachleat released this 16 Nov 19:26
· 5 commits to main since this release

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.