Skip to content

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 08 Aug 02:46
· 163 commits to main since this release
3c5bee2

Release Notes for @jbpark/use-hooks 3.0.0

This major release brings significant improvements and redesigns to several core hooks in the @jbpark/use-hooks library, making it more robust, efficient, and easier to use.

Major Changes

  • Improved Error Handling in useImage: The error property now returns a real Error object instead of a string or event, with the original event attached as error.cause for debugging purposes.
  • Removed useTimeline: This hook had zero consumers and was removed to simplify the library and reduce maintenance overhead.
  • Redesigned useScrollToElements API: The hook now uses key-based registration and scrolling, eliminating index-based registration and leftover null holes.
  • Improved useClickOutside: The hook now takes the "inside" ref(s) as an argument instead of creating and returning one, and adds an escape option to close on the Escape key.
  • Redesigned useIntersectionObserver: The hook now returns [ref, { entry, isIntersecting }] and adds a freezeOnceVisible option to disconnect the observer when the target becomes intersecting.

Minor Changes

  • Added useDebouncedValue and useThrottledCallback: These hooks provide debounced and throttled values and callbacks, respectively, rounding out the library's value/callback pairing.
  • Added useEventListener, usePrevious, and useToggle: These hooks provide utility functions for event listeners, previous values, and toggling state.

What's Changed

  • 💥 feat!: remove useTimeline by @pjb0811 in #124
  • 💥 feat!: redesign useScrollToElements around keyed registration by @pjb0811 in #125
  • 🐛 fix: recognize any changeset file, not just pr-<PR#>.md by @pjb0811 in #127
  • ✨ feat: add useMergedRef by @pjb0811 in #128
  • 💥 feat!: redesign useClickOutside around caller-supplied refs by @pjb0811 in #129
  • ✨ feat: add useResizeObserver and useMutationObserver by @pjb0811 in #130
  • ✨ feat: add useDebouncedValue and useThrottledCallback by @pjb0811 in #131
  • ✨ feat: add useKeyPress by @pjb0811 in #132
  • ✨ feat: add useFileDrop by @pjb0811 in #133
  • 💥 feat!: redesign useIntersectionObserver return shape and add freezeOnceVisible by @pjb0811 in #135
  • 💥 fix!: use a real Error for useImage's error state by @pjb0811 in #136
  • ✨ feat: add useTimeout and useInterval by @pjb0811 in #134
  • ✨ feat: add useEventListener, usePrevious, and useToggle by @pjb0811 in #137
  • 🔖 chore: version packages by @github-actions[bot] in #126

Full Changelog: v2.11.0...v3.0.0