Skip to content

v4.0.0

Choose a tag to compare

@linyows linyows released this 20 Sep 01:44
· 19 commits to main since this release
1fcf0cb

Failures are visible, downloads and caches can no longer keep broken data, settings are read when they are used, and unused files can be removed.

Breaking changes

  • Node.js 22.12 or later, and Safari 17.4 or later in the browser, because mermaid 12 requires them. Diagrams keep their current layout and colors.
  • Failures are printed as [rotion] ... warnings on stderr without ROTION_DEBUG. ROTION_STRICT=true throws on them instead, so a build does not publish a site with missing content.
  • A result left incomplete by a transient failure is not cached (rate limit, timeout, 5xx, network error); it is fetched again on the next call. A permanent failure, such as a 404 image or a page the integration cannot access, is still cached.
  • Only a 2xx response is saved as a downloaded image or file, and getHTTP throws otherwise, so bookmark, embed and video metadata is no longer read from an error page.
  • The incremental cache checks what a page shows from elsewhere: with ROTION_INCREMENTAL_CACHE=true, FetchBlocks asks Notion for the last_edited_time of the source of a synced block, a mentioned page or database, a child page and a child database, at most once per ROTION_CACHE_AVAILABLE_DURATION per dependency.

New

  • configure() sets the settings from code. The environment is read when a setting is used, not when rotion is imported, so a token set afterwards takes effect, and package.json is no longer required in the working directory.
  • pruneCache() and the rotion prune command remove cache files, images and files that Rotion has not used since a given time.
  • ROTION_STRICT.

Fixes

  • GitHub link previews time out and check the response status.
  • A HEIC or HEIF image is downloaded and converted once, not on every call.
  • A relative Location header is followed, and unused responses are drained.
  • FetchBlocks takes a file lock, so parallel workers and concurrent requests fetch a page once.
  • A lock from another host that shares the cache directory is not taken over while its holder may still be working.
  • FetchPage asks only for the properties that page.meta keeps.
  • 503, 504 and service overload answers from Notion are retried.

What's Changed

  • Stop saving error responses as downloaded images and files by @linyows in #275
  • Do not cache results that a transient failure left incomplete by @linyows in #276
  • Make GitHub link previews time out and check the status by @linyows in #277
  • Print failures without ROTION_DEBUG, and add ROTION_STRICT by @linyows in #279
  • Read the settings when they are used, and add configure() by @linyows in #280
  • Lock FetchBlocks, and do not take over locks from another host by @linyows in #281
  • Refetch blocks when a page or database they show was edited by @linyows in #282
  • Add pruneCache and the rotion prune command by @linyows in #283
  • Ask only for page properties that page.meta keeps by @linyows in #284
  • Update @notionhq/client to 5.26.0 by @linyows in #285
  • Update the dependencies except mermaid by @linyows in #286
  • Update mermaid to 12, keeping the diagrams as they look now by @linyows in #287
  • Update the dependencies of the examples by @linyows in #288
  • Release 4.0.0 by @linyows in #289

Full Changelog: v3.6.3...v4.0.0