Skip to content

v3.1.0

Choose a tag to compare

@58bits 58bits released this 03 Jun 02:49
· 58 commits to main since this release

Highlights

  • @byline/core, @byline/db-postgresDocument path on write-side collection hooks. Every write-side lifecycle hook context now carries the document's canonical (source-locale) routing path: afterCreate, afterUpdate, beforeStatusChange / afterStatusChange, beforeUnpublish / afterUnpublish, and beforeDelete / afterDelete. Previously these contexts exposed only documentId and collectionPath, so consumers wiring cache invalidation, CDN URL purges, webhooks, or search re-indexing had no way to target the specific document/URL that changed and were forced into coarse, collection-wide invalidation. The path is the raw slug from byline_document_paths, resolved via a new narrow getCurrentPath storage query that reuses the existing source-locale fallback projection — so it follows a document's source_locale anchor even after the site default changes. beforeCreate intentionally stays path-free, since the path isn't derived until after that hook may have mutated the source field. The change is additive and backward-compatible — existing hooks keep working and simply receive an extra ctx.path field. (Note: while paths remain single-canonical-slug, ctx.path is unambiguous; the per-locale-paths future phase will enrich these contexts with the derived locale — see docs/DOCUMENT-PATHS.md.)

All other @byline/* packages bumped to 3.1.0 in lockstep with no behavioural changes this cycle.