Repository navigation
v4.0.0
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 withoutROTION_DEBUG.ROTION_STRICT=truethrows 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
getHTTPthrows 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,FetchBlocksasks Notion for thelast_edited_timeof the source of a synced block, a mentioned page or database, a child page and a child database, at most once perROTION_CACHE_AVAILABLE_DURATIONper dependency.
New
configure()sets the settings from code. The environment is read when a setting is used, not whenrotionis imported, so a token set afterwards takes effect, andpackage.jsonis no longer required in the working directory.pruneCache()and therotion prunecommand 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
Locationheader is followed, and unused responses are drained. FetchBlockstakes 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.
FetchPageasks only for the properties thatpage.metakeeps.- 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