feat: add entry lifecycle hooks - #875
Conversation
📝 WalkthroughWalkthroughAdds ChangesEntry Lifecycle Hooks
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)Before-push flowsequenceDiagram
participant Caller
participant createUnhead
participant entriesBeforePush
Caller->>createUnhead: push(input, options)
createUnhead->>entriesBeforePush: callHook(input, options, shouldPush)
entriesBeforePush-->>createUnhead: update shouldPush
createUnhead-->>Caller: noop entry or active entry
Deferred disposal flowsequenceDiagram
participant ActiveHeadEntry
participant ClientAdapter
participant entriesBeforeDispose
participant DeferredPromises
ActiveHeadEntry->>ClientAdapter: dispose()
ClientAdapter->>entriesBeforeDispose: callHook(entry, defer)
entriesBeforeDispose-->>ClientAdapter: register PromiseLike values
ClientAdapter->>DeferredPromises: Promise.allSettled(values)
DeferredPromises-->>ClientAdapter: promises settle
ClientAdapter-->>ActiveHeadEntry: finalize disposal and invalidate head
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Bundle Size
All bundles (14)
📦 Runtime Dependencies✅ No runtime dependency changes All packages (10)
Skipped optional dependencies (114)
Production dependencies only. Peer dependencies and Unhead workspace packages are excluded. Skipped optional dependencies are unavailable on the CI platform. ⚡ Performance (directional)✅ No significant change (within CI noise) All benchmarks (14)
Baseline: main @ d9b3d2a · 2026-07-26 · gzipped is the headline size metric · perf is directional (shared-runner, gated) |
🤖 Harlan Agent Kit automated reviewThis was generated and posted by a robot, not Harlan's personal review. PASS · 95/100 confidence
Human merge decision still required. |
🔗 Linked issue
Related to nuxt/nuxt#32100 and nuxt/nuxt#35389.
❓ Type of change
📚 Description
Adds typed hooks before entry insertion and disposal so integrations can suppress entries or defer cleanup. This replaces Nuxt integration monkey patches while ensuring rejected promises still release deferred entries.