v3.2.0
Highlights
@byline/core— Lazy-loader form for collection and upload hooks. A collection schema is isomorphic — Byline bundles it into the browser admin as well as the server — so a hook declared inline that statically imports server-only code (a storage SDK,sharp, an antivirus scanner, a Node built-in) drags that entire graph into the client bundle, failing silently inbuild(tree-shaken away) but crashing the dev server withModule "node:…" has been externalized for browser compatibility. This release adds a loader form for both server-only hook surfaces — collection lifecyclehooksand a field'supload.hooks— letting authors point at a sibling module via a dynamic import:hooks: () => import('./hooks.js'). Because the schema reaches the hooks only throughimport(), that module and its entire transitive graph are structurally absent from the client bundle, with no per-call-site SSR guards required. New exports:defineHooks(an identity factory mirroringdefineCollection/defineBlock), theCollectionHooksLoader/UploadHooksLoadertypes, and the memoizedresolveHooks/resolveUploadHooksresolvers (wired into every lifecycle, read, and upload-hook site; a loader'simport()runs at most once per process). The change is additive and backward-compatible — the inline object form stays valid for hooks whose bodies only touch isomorphic code. Seedocs/COLLECTIONS.md→ "Hooks must not statically import server-only code".
Chores
- monorepo — documented the parallel
upload.storageisomorphic-import hazard (pinning anIStorageProviderinstance inline in a schema field) indocs/FILE-MEDIA-UPLOADS.md, and migrated thedocscollection andmediaupload field to siblinghooks.tsfiles as worked references.
All other @byline/* packages bumped to 3.2.0 in lockstep with no behavioural changes this cycle.