Skip to content

Latest commit

 

History

History
1140 lines (538 loc) · 49.4 KB

CHANGELOG.md

File metadata and controls

1140 lines (538 loc) · 49.4 KB

24.0.4 (2024-02-04)

Bug Fixes

  • useDebouncedCallback: make invoked function to be updated with deps (#1510) (12658ee), closes #1357

24.0.3 (2024-02-03)

Bug Fixes

  • get rid of import alias as it still breaks everything around (#1509) (90e4f9d)

24.0.2 (2023-12-21)

Bug Fixes

  • lower engines requirements to ease usage for consumers (8bd29f7)

24.0.1 (2023-12-20)

Bug Fixes

  • change build so development and distributed imports match (6383cdd)

24.0.0 (2023-12-20)

Features

BREAKING CHANGES

  • Hooks are now distrubutes as JS built form TS with target ESNext and ESM module resolution. There is no more sense to distribute CJS version as package is ESM-only.

Consequent of above - no more esm and cjs subfolders - hooks are importable from index.js or its own directory which don't have a prefix anymore, thanks to exports directive. All of below examples will lead to same result, choose any on your taste:

import { useFirstMountState } from '@react-hookz/web'; import { useFirstMountState } from '@react-hookz/web/'; import { useFirstMountState } from '@react-hookz/web/useFirstMountState/'; import { useFirstMountState } from '@react-hookz/web/useFirstMountState/index.js'; Thought is seems not to have subfolder, it is only due to exports directive, in real it is @react-hookz/web/dist/useFirstMountState/index.js.

Pakage uses imports directive to define path alias #root - it stays so even in distributed code, thus, some may be affected in case their bundler configured to somehow handle such alias. Those developer shoud configure import rewriter not to handle node_modules or @react-hookz/web package exclusively.

Side-effect for current PR - documentation is broken, as storybook 6 is not working within ESM packages and I'm planning to switch to another domenting engine anyway.

23.1.0 (2023-06-30)

Features

23.0.1 (2023-05-24)

Bug Fixes

  • useThrottleCallback: Cleared timeout on unmount (#1173) (8681ad8)

23.0.0 (2023-03-23)

BREAKING CHANGES

  • useSafeState hook is removed

22.0.0 (2023-01-05)

Features

  • rename all hook implementation files to index.ts (#1065) (34c36f2)

BREAKING CHANGES

  • all current hook implementation fies renamed to index to allow usage of directory imports and avoid redundant reexporting. Such change breaks previous direct imports, but simplifies import string and solves redundant hook name duplication.

4ex:

// previously
import { useUpdate } from "@react-hookz/web/useUpdate/useUpdate"

// now
import { useUpdate } from "@react-hookz/web/useUpdate"

21.0.0 (2023-01-04)

Features

  • Drop es5 versions support, leave only ESNext (#963) (5a622af)

BREAKING CHANGES

  • CJS ES5 and ESM ES5 versions are removed from distribution, leaving only ESM ESNext version.

We understand that this change can break existing pipelines for some developers, but such move eases library maintenance and is one of several moves towards module package. Address Usage docs to actualize your pipeline if needed.

This change is one of several braking changes regarding distribution and package usage.

Sorry for any inconvenience.

20.1.0 (2023-01-02)

Features

20.0.3 (2022-12-20)

Bug Fixes

  • useEventListener: change the way listener added and removed (#1050) (f2936a5)

20.0.2 (2022-12-18)

Bug Fixes

  • docs: update link to GHA actions badge (348cba7)

20.0.1 (2022-12-07)

Bug Fixes

  • useMediaQuery: On misconfiguration, cause hydration error instead of SSR crash (#1042) (46e5bcc), closes #1000 #1000

20.0.0 (2022-12-02)

Bug Fixes

  • useMediaQuery: add option to martch media query on first render (#1020) (087b2b1), closes #1000

BREAKING CHANGES

  • useMediaQuery: useMediaQuery and useScreenOrientation now returns matched media query state on first render by default, SSR users can change that behaviour via hook options.

19.2.0 (2022-11-20)

Features

19.1.0 (2022-11-12)

Features

  • useStorageValue: add custom parse and stringify functions to options (#913) (095d371)

19.0.0 (2022-11-12)

Bug Fixes

  • useMeasure: only expose with and height properties (#954) (161c18d), closes #951

BREAKING CHANGES

  • useMeasure: Only width and height are now exposed from the element instead of the whole DOMRect

18.0.1 (2022-11-10)

Bug Fixes

  • useStorageValue: make methods to be stable between renders (#1015) (2211bb7), closes #1014

18.0.0 (2022-11-09)

BREAKING CHANGES

  • useDocumentTitle has been removed.

17.0.1 (2022-11-05)

Bug Fixes

  • useStorageValue: respect initializeWithValue default, fix docs and tests (#1003) (1f730d6), closes #1002

17.0.0 (2022-11-03)

  • Rework useStorageValue to more simple and robust variant (#960) (7bcc385), closes #960

BREAKING CHANGES

  • new implementation brings different API. It is not backward compatible!

Co-authored-by: Arttu Olli [email protected]

16.1.0 (2022-10-23)

Features

  • useDeepCompareMemo: Implement useDeepCompareMemo (#979) (532cc41), closes #871

16.0.1 (2022-10-22)

Bug Fixes

  • useCustomCompareMemo: Correctly infer the type of the value returned by the factory function (#976) (a625c55), closes #975

16.0.0 (2022-10-09)

Styles

  • remove I prefix from types and interfaces (c2a1ff4)

BREAKING CHANGES

  • I prefix removed from all types having it.

15.1.0 (2022-08-14)

Features

  • useCustomCompareMemo - like useMemo but uses custom deps comparator (#895) (5b38e8d)
  • implement useTimeoutEffect (#886) (a3f6f07)

15.0.1 (2022-07-04)

Bug Fixes

  • useLifecycleLogger: rework hook and improve tests coverage (#868) (bfba4c2)

15.0.0 (2022-07-04)

Bug Fixes

  • useMediaQuery: fix state stuck for concurrent mode (#866) (75db2b5), closes #849

Features

  • implement useControlledRerenderState hook (#865) (ea4545b)
  • useToggle: ignore react events passed to state setter (#867) (085f711), closes #861

BREAKING CHANGES

  • useToggle: useToggle now ignores react events passed to its state setter, so it can be used as event handler directly.
  • useMediaQuery: useMediaQuery and useScreenOrientation are asynchronous now and yields undefined at very first render, but updates to actual value right after.

14.7.1 (2022-07-03)

Bug Fixes

14.7.0 (2022-06-30)

Features

14.6.0 (2022-06-30)

Features

  • useIsMounted: allow to set initial value (a63188a)
  • useSafeState: fix issue with inability to set state before mount (af8f4cd)

14.5.1 (2022-06-30)

Bug Fixes

  • useMeasure: support conditional rendering (76ac155), closes #755

14.5.0 (2022-06-30)

Features

  • implement useHookableRef hook (f41ab22)

14.4.0 (2022-06-30)

Features

14.3.0 (2022-06-25)

Features

  • useList: port useList from react-use (#810) (73639fb)

14.2.3 (2022-06-22)

Bug Fixes

  • apply correct order of operations in useRerender (#850) (5fc735a)
  • change storybook builder to webpack5 (#830) (2df44c1)

14.2.2 (2022-05-12)

Bug Fixes

  • useResizeObserver now respects element changes within ref object (#759) (2a4e848), closes #755

14.2.1 (2022-05-12)

Bug Fixes

  • useUnmountEffect now invokes changing effect functions (#758) (380637a), closes #756

14.2.0 (2022-05-12)

Features

  • useVibration hook implementation and docs (#757) (db40294)

14.1.0 (2022-05-12)

Features

  • useCounter: port useCounter from react-use (#751) (510947b), closes #33

14.0.0 (2022-05-11)

Bug Fixes

  • useMediatedState: make initial state be passed through mediator (#753) (727d224)

BREAKING CHANGES

  • useMediatedState: useMediatedState now passes initial state through mediator

13.3.0 (2022-04-25)

Features

13.2.1 (2022-04-10)

Bug Fixes

  • make useRerender operate integer increment instead of bool switch (#711) (409a21f), closes #691

13.2.0 (2022-03-30)

Features

13.1.0 (2022-03-14)

Features

  • implement useRafState hook (6cd44ec)
  • implement useWindowSize hook (81819cf)

13.0.0 (2022-02-25)

Features

  • useMediaQuery: add synchronous mql state fetch (0e0be56)
  • implement new hook - useScreenOrientation (107cc21)

BREAKING CHANGES

  • useMediaQuery: useMediaQuery now does synchronous fetch, this means that in browser it will return final state on first render, while SSR mode still return undefined. SSR users should set second parameter of this hook to true, to postpone state fetch until effects phase.

12.3.0 (2022-01-17)

Features

12.2.0 (2022-01-14)

Features

12.1.2 (2022-01-13)

Bug Fixes

  • move to stricter linting configuration (#580) (f455992)

12.1.1 (2022-01-11)

Bug Fixes

  • useLocalStorage, useSessionStorage: replace hook with noop in case of storage absence. (#540) (790b302), closes #521

12.1.0 (2022-01-11)

Features

  • useMeasure,useResizeObserver: ability yo disable observation (#573) (4c6f074), closes #523

12.0.3 (2021-12-23)

Bug Fixes

12.0.0 (2021-10-01)

Features

  • exclude @types/react and @types/react-dom from deps (bcaca2e), closes #353

BREAKING CHANGES

  • @types/react and @types/react-dom are no more presented in dependencies.

11.1.0 (2021-09-28)

Features

11.0.0 (2021-09-28)

Bug Fixes

  • proper links in readme that don't break in firefox (b406dc6)

Features

  • improve useConditionalEffect and remove useConditionalUpdateEffect (#345) (4474cf7)

BREAKING CHANGES

  • useConditionalEffect conditions and deps arguments now switched places.

  • feat(useConditionalEffect): added ability to wrap other effect hooks

  • feat: remove useConditionalUpdateEffect

  • useConditionalUpdateEffect removed in favor of composition with useConditionalEffect.

Now you should simpy pass extra argument to achieve same functionality: useConditionalEffect(()=>{}, undefined, [], truthyAndArrayPredicate, useUpdateEffect)

  • Interface IUseConditionalEffectPredicate renamed to IConditionsPredicate

  • docs: cleanup, remove useConditionalUpdateEffect from readme

Co-authored-by: Joe Duncko [email protected]

10.1.1 (2021-09-24)

Bug Fixes

10.1.0 (2021-09-23)

Features

10.0.0 (2021-09-23)

Features

  • useAsync: remove effector behaviour from hook (#339) (0e47ff2)

BREAKING CHANGES

  • useAsync: useAsync hook now has only 2 arguments, asyncFn and initialValue and do not execute provided function on its own.

  • chore(useAsync): remove unused IUseAsyncOptions interface

9.0.0 (2021-08-30)

Documentation

BREAKING CHANGES

  • IAnyPermissionDescriptor type removed in favor of built-in PermissionDescriptor.

  • docs(useCookieValue): example been using old index import

8.0.0 (2021-08-30)

chore

BREAKING CHANGES

  • TS: IAnyPermissionDescriptor type removed in favor of built-in PermissionDescriptor.

7.0.0 (2021-08-06)

Bug Fixes

  • useMediaQuery: add support for safari 13- that has obsolete useMediaQuery implementation (#249) (25c8599), closes #242

Code Refactoring

  • useKeyboardEvent: improve the code and change signature (#248) (a0e1b24)

BREAKING CHANGES

  • useKeyboardEvent: hook call signature has changed.

6.1.0 (2021-08-04)

Features

6.0.1 (2021-07-25)

Bug Fixes

  • make hooks that not listed in index.ts to be built too (c119371)

6.0.0 (2021-07-25)

Bug Fixes

BREAKING CHANGES

  • useCookieValue is no more exported from index file.

5.0.0 (2021-07-20)

Bug Fixes

  • improve useThrottledCallback and useDebouncedCallback types (04e965a)

BREAKING CHANGES

  • types changed, now only one generic argument received by useThrottledCallback and useDebouncedCallback - the original function type.

4.0.0 (2021-07-16)

Features

  • deps for useConditionalUpdateEffect and useConditionalEffect (#201) (bd56af3)

BREAKING CHANGES

  • useConditionalUpdateEffect and useConditionalEffect now has changed call signature (new argument).

3.8.0 (2021-07-03)

Features

3.7.0 (2021-07-03)

Features

3.6.0 (2021-07-03)

Features

3.5.0 (2021-06-24)

Features

3.4.0 (2021-06-24)

Features

3.3.0 (2021-06-22)

Features

3.2.0 (2021-06-22)

Features

3.1.0 (2021-06-17)

Features

  • new hooks useThrottledEffect and useThrottledState (#137) (1cc6677)

3.0.1 (2021-06-16)

Bug Fixes

3.0.0 (2021-06-16)

Bug Fixes

  • rename useThrottleCallback and useDebounceCallback (#130) (77f66d7), closes #129

Features

  • add maxWait parameter to useDebouncedCallback hook (#131) (600baa8)
  • change args for useThrottledCallback and useDebouncedCallback (#132) (131d98e)
  • new hooks useDebouncedEffect and useDebouncedState (#133) (1d164ff)

BREAKING CHANGES

  • delay and deps arguments are swapped position for useThrottledCallback and useDebouncedCallback hooks to be aligned with useCallback signature.
  • useDebounceCallback renamed to useDebouncedCallback useThrottleCallback renamed to useThrottledCallback

2.2.0 (2021-06-15)

Features

2.1.0 (2021-06-14)

Features

  • import reused hooks from the index file instead of its definition (f4bd609)

2.0.0 (2021-06-14)

Features

  • add initializeWithValue option to useCookie hook (#120) (17c9543)

BREAKING CHANGES

  • useCookie renamed to useCookieValue
  • useCookieValue default behaviour for browsers changed to fetch cookie value on state initialisation.

SSR remains untouched, but requires implicit setting of initializeWithValue option to false, to avoid hydration mismatch.

1.28.0 (2021-06-14)

Features

1.27.0 (2021-06-11)

Features

1.26.0 (2021-06-11)

Features

1.25.1 (2021-06-02)

Bug Fixes

  • tsconfig.build.json missconfig (ba92152), closes #102

1.25.0 (2021-06-02)

Features

1.24.1 (2021-06-02)

Bug Fixes

  • make useDebounceCallback and useRafCallback return proper fns (#100) (906d6e4)
  • make useDebounceCallback and useRafCallback return proper fns (#100) (2495e53)
  • make useDebounceCallback and useRafCallback return proper fns (#100) (1dcb083)

1.24.0 (2021-05-26)

Features

  • useTitle -> useDocumentTitle (24daf77)

1.23.0 (2021-05-25)

Features

1.22.0 (2021-05-25)

Features

1.21.0 (2021-05-25)

Features

1.20.4 (2021-05-24)

Bug Fixes

  • add module field to package.json so bundlers use proper version (b0119ce)

1.20.3 (2021-05-24)

Bug Fixes

  • mark package as side-effects free (74d6f1c)

1.20.2 (2021-05-24)

Bug Fixes

  • proper 'types' and 'esnext' fields values (069ae24)

1.20.1 (2021-05-20)

Bug Fixes

  • remove types field in package.json (#75) (340e7d7)

1.20.0 (2021-05-18)

Features

1.19.0 (2021-05-16)

Features

  • new hooks useLocalStorageValue and useSessionStorageValue (#43) (f02e8ea)

1.18.0 (2021-05-06)

Features

1.17.0 (2021-05-06)

Features

  • use stricter TS config and fix issues caused by this (6af7867)

1.16.0 (2021-05-06)

Features

1.15.0 (2021-05-06)

Features

  • new hook useIsomorphicLayoutEffect (#41) (8e17b3c)

1.14.0 (2021-05-03)

Features

1.13.0 (2021-05-02)

Features

  • make stateful hooks use useSafeState (d181c7f)

1.12.0 (2021-05-01)

Features

1.11.0 (2021-04-30)

Features

1.10.0 (2021-04-28)

Features

  • new hooks, useConditionalEffect and useConditionalUpdateEffect (#26) (eb7f0a5)

1.9.1 (2021-04-28)

Bug Fixes

  • default useUnmountEffect example to false (#27) (2ed0aa3)

1.9.0 (2021-04-28)

Features

1.8.0 (2021-04-28)

Features

1.7.5 (2021-04-28)

Bug Fixes

  • rollback husky version and add it to dependabot ignore (099ea5b)

1.7.4 (2021-04-25)

Bug Fixes

  • lint issues auto-fix with ESLint (9f9e53e)

1.7.3 (2021-04-24)

Bug Fixes

  • better not to split declarations from files (c6a2d92)
  • lint issues auto-fix with ESLint (63bf8e2)

1.7.2 (2021-04-24)

Bug Fixes

  • lint issues auto-fix with ESLint (11b9a07)
  • replace husky v6 with husky v4 as v5+ ruins CI lint autofix (a50955a)

1.7.1 (2021-04-23)

Bug Fixes

  • add ci yarn caching layer (5aa8ae1)

1.7.0 (2021-04-23)

Bug Fixes

  • add md and mdx files to lint-staged hook glob (d1d3d72)
  • add readme clarification about different lang level usages (0632992)
  • exclude new distributed directories from eslint and tsconfig (058960e)

Features

  • package now has /cjs, /esm distibuted versions (4911c9d)

1.7.0 (2021-04-23)

Features

  • package now has /cjs, /esm distibuted versions (4911c9d)

1.6.2 (2021-04-22)

Bug Fixes

  • add hook link to README.md (368f1d9)

1.7.0 (2021-04-22)

Features

  • add storybook docs with deploy to gh-pages (84de312)

1.6.1 (2021-04-21)

Bug Fixes

  • useUnmountEffect and useMountEffect typings fix (32ec0c7)

1.6.0 (2021-04-21)

Features

1.5.0 (2021-04-21)

Features

  • make tests import hooks from the index (3210650)

1.4.3 (2021-04-21)

Bug Fixes

  • dist package returned to bundle (e92bd18)

1.4.2 (2021-04-18)

Bug Fixes

  • add @semantic-release/github plugin (9f7e1b3)

1.4.1 (2021-04-16)

Bug Fixes

  • add types field to package json and tweak build (8d64b9a)

1.4.0 (2021-04-16)

Features

  • add main file and reexport new hooks (e2ea1cb)

1.3.0 (2021-04-16)

Features

1.2.3 (2021-04-16)

Bug Fixes

  • properly name useMountEffect and useUnmountEffect parameter (5218bfc)

1.2.2 (2021-04-15)

Bug Fixes

  • attempt to make codecov push only occur on release publish (ac5c221)

1.2.1 (2021-04-15)

Bug Fixes

  • codecov push should only occur on release publish (2a9e024)

1.2.0 (2021-04-15)

Features

  • add codecov coverage reporting (3254871)

1.1.0 (2021-04-15)

Features

  • implement useMountEffect and useUnmountEffect hooks (98ec434)

1.0.0 (2021-04-14)

Features

  • add .npmignore and filler .gitignore files. (e12375f)
  • add CI workflow and dependabot config. (7e365cf)
  • add semantic release dep. (4e39fa3)
  • configure basic builds. (34aafe4)
  • improve ci config and set initial version to 0.0.1 (adf4dca)
  • introduce useFirstMountState (bd7123b)

1.0.0 (2021-04-14)

Features

  • add .npmignore and filler .gitignore files. (e12375f)
  • add CI workflow and dependabot config. (7e365cf)
  • add semantic release dep. (4e39fa3)
  • configure basic builds. (34aafe4)
  • improve ci config and set initial version to 0.0.1 (adf4dca)
  • introduce useFirstMountState (bd7123b)

1.0.0 (2021-04-12)

Features

  • add .npmignore and filler .gitignore files. (e12375f)
  • add CI workflow and dependabot config. (7e365cf)
  • add semantic release dep. (4e39fa3)
  • configure basic builds. (34aafe4)
  • improve ci config and set initial version to 0.0.1 (adf4dca)
  • introduce useFirstMountState (bd7123b)