24.0.4 (2024-02-04)
24.0.3 (2024-02-03)
24.0.2 (2023-12-21)
- lower engines requirements to ease usage for consumers (8bd29f7)
24.0.1 (2023-12-20)
- change build so development and distributed imports match (6383cdd)
24.0.0 (2023-12-20)
- 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)
23.0.1 (2023-05-24)
23.0.0 (2023-03-23)
useSafeState
hook is removed
22.0.0 (2023-01-05)
- 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)
CJS ES5
andESM ES5
versions are removed from distribution, leaving onlyESM 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)
20.0.3 (2022-12-20)
20.0.2 (2022-12-18)
- docs: update link to GHA actions badge (348cba7)
20.0.1 (2022-12-07)
- useMediaQuery: On misconfiguration, cause hydration error instead of SSR crash (#1042) (46e5bcc), closes #1000 #1000
20.0.0 (2022-12-02)
- useMediaQuery:
useMediaQuery
anduseScreenOrientation
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)
19.1.0 (2022-11-12)
19.0.0 (2022-11-12)
- useMeasure: Only width and height are now exposed from the element instead of the whole DOMRect
18.0.1 (2022-11-10)
18.0.0 (2022-11-09)
- useDocumentTitle has been removed.
17.0.1 (2022-11-05)
- useStorageValue: respect
initializeWithValue
default, fix docs and tests (#1003) (1f730d6), closes #1002
17.0.0 (2022-11-03)
- new implementation brings different API. It is not backward compatible!
Co-authored-by: Arttu Olli [email protected]
16.1.0 (2022-10-23)
16.0.1 (2022-10-22)
- useCustomCompareMemo: Correctly infer the type of the value returned by the factory function (#976) (a625c55), closes #975
16.0.0 (2022-10-09)
- remove I prefix from types and interfaces (c2a1ff4)
I
prefix removed from all types having it.
15.1.0 (2022-08-14)
useCustomCompareMemo
- like useMemo but uses custom deps comparator (#895) (5b38e8d)- implement useTimeoutEffect (#886) (a3f6f07)
15.0.1 (2022-07-04)
15.0.0 (2022-07-04)
- implement
useControlledRerenderState
hook (#865) (ea4545b) - useToggle: ignore react events passed to state setter (#867) (085f711), closes #861
- useToggle:
useToggle
now ignores react events passed to its state setter, so it can be used as event handler directly. - useMediaQuery:
useMediaQuery
anduseScreenOrientation
are asynchronous now and yieldsundefined
at very first render, but updates to actual value right after.
14.7.1 (2022-07-03)
14.7.0 (2022-06-30)
14.6.0 (2022-06-30)
- useIsMounted: allow to set initial value (a63188a)
- useSafeState: fix issue with inability to set state before mount (af8f4cd)
14.5.1 (2022-06-30)
14.5.0 (2022-06-30)
- implement
useHookableRef
hook (f41ab22)
14.4.0 (2022-06-30)
14.3.0 (2022-06-25)
14.2.3 (2022-06-22)
- apply correct order of operations in
useRerender
(#850) (5fc735a) - change storybook builder to webpack5 (#830) (2df44c1)
14.2.2 (2022-05-12)
14.2.1 (2022-05-12)
14.2.0 (2022-05-12)
14.1.0 (2022-05-12)
14.0.0 (2022-05-11)
useMediatedState
:useMediatedState
now passes initial state through mediator
13.3.0 (2022-04-25)
13.2.1 (2022-04-10)
13.2.0 (2022-03-30)
13.1.0 (2022-03-14)
13.0.0 (2022-02-25)
useMediaQuery
: add synchronous mql state fetch (0e0be56)- implement new hook -
useScreenOrientation
(107cc21)
useMediaQuery
:useMediaQuery
now does synchronous fetch, this means that in browser it will return final state on first render, while SSR mode still returnundefined
. SSR users should set second parameter of this hook totrue
, to postpone state fetch until effects phase.
12.3.0 (2022-01-17)
12.2.0 (2022-01-14)
12.1.2 (2022-01-13)
12.1.1 (2022-01-11)
useLocalStorage
,useSessionStorage
: replace hook with noop in case of storage absence. (#540) (790b302), closes #521
12.1.0 (2022-01-11)
12.0.3 (2021-12-23)
12.0.0 (2021-10-01)
@types/react
and@types/react-dom
are no more presented independencies
.
11.1.0 (2021-09-28)
11.0.0 (2021-09-28)
- proper links in readme that don't break in firefox (b406dc6)
-
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 withuseConditionalEffect
.
Now you should simpy pass extra argument to achieve same functionality:
useConditionalEffect(()=>{}, undefined, [], truthyAndArrayPredicate, useUpdateEffect)
-
Interface
IUseConditionalEffectPredicate
renamed toIConditionsPredicate
-
docs: cleanup, remove
useConditionalUpdateEffect
from readme
Co-authored-by: Joe Duncko [email protected]
10.1.1 (2021-09-24)
10.1.0 (2021-09-23)
10.0.0 (2021-09-23)
-
useAsync:
useAsync
hook now has only 2 arguments,asyncFn
andinitialValue
and do not execute provided function on its own. -
chore(useAsync): remove unused
IUseAsyncOptions
interface
9.0.0 (2021-08-30)
-
IAnyPermissionDescriptor
type removed in favor of built-inPermissionDescriptor
. -
docs(useCookieValue): example been using old index import
8.0.0 (2021-08-30)
- TS:
IAnyPermissionDescriptor
type removed in favor of built-inPermissionDescriptor
.
7.0.0 (2021-08-06)
- useMediaQuery: add support for safari 13- that has obsolete
useMediaQuery
implementation (#249) (25c8599), closes #242
- useKeyboardEvent: hook call signature has changed.
6.1.0 (2021-08-04)
6.0.1 (2021-07-25)
- make hooks that not listed in index.ts to be built too (c119371)
6.0.0 (2021-07-25)
useCookieValue
is no more exported from index file.
5.0.0 (2021-07-20)
- improve
useThrottledCallback
anduseDebouncedCallback
types (04e965a)
- types changed, now only one generic argument received
by
useThrottledCallback
anduseDebouncedCallback
- the original function type.
4.0.0 (2021-07-16)
useConditionalUpdateEffect
anduseConditionalEffect
now has changed call signature (new argument).
3.8.0 (2021-07-03)
3.7.0 (2021-07-03)
3.6.0 (2021-07-03)
3.5.0 (2021-06-24)
3.4.0 (2021-06-24)
3.3.0 (2021-06-22)
3.2.0 (2021-06-22)
3.1.0 (2021-06-17)
3.0.1 (2021-06-16)
3.0.0 (2021-06-16)
- add
maxWait
parameter touseDebouncedCallback
hook (#131) (600baa8) - change args for
useThrottledCallback
anduseDebouncedCallback
(#132) (131d98e) - new hooks
useDebouncedEffect
anduseDebouncedState
(#133) (1d164ff)
delay
anddeps
arguments are swapped position foruseThrottledCallback
anduseDebouncedCallback
hooks to be aligned withuseCallback
signature.useDebounceCallback
renamed touseDebouncedCallback
useThrottleCallback
renamed touseThrottledCallback
2.2.0 (2021-06-15)
2.1.0 (2021-06-14)
- import reused hooks from the index file instead of its definition (f4bd609)
2.0.0 (2021-06-14)
useCookie
renamed touseCookieValue
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)
1.27.0 (2021-06-11)
1.26.0 (2021-06-11)
1.25.1 (2021-06-02)
1.25.0 (2021-06-02)
1.24.1 (2021-06-02)
- make
useDebounceCallback
anduseRafCallback
return proper fns (#100) (906d6e4) - make
useDebounceCallback
anduseRafCallback
return proper fns (#100) (2495e53) - make
useDebounceCallback
anduseRafCallback
return proper fns (#100) (1dcb083)
1.24.0 (2021-05-26)
useTitle
->useDocumentTitle
(24daf77)
1.23.0 (2021-05-25)
1.22.0 (2021-05-25)
1.21.0 (2021-05-25)
1.20.4 (2021-05-24)
- add
module
field to package.json so bundlers use proper version (b0119ce)
1.20.3 (2021-05-24)
- mark package as side-effects free (74d6f1c)
1.20.2 (2021-05-24)
- proper 'types' and 'esnext' fields values (069ae24)
1.20.1 (2021-05-20)
1.20.0 (2021-05-18)
1.19.0 (2021-05-16)
1.18.0 (2021-05-06)
1.17.0 (2021-05-06)
- use stricter TS config and fix issues caused by this (6af7867)
1.16.0 (2021-05-06)
1.15.0 (2021-05-06)
1.14.0 (2021-05-03)
1.13.0 (2021-05-02)
- make stateful hooks use
useSafeState
(d181c7f)
1.12.0 (2021-05-01)
1.11.0 (2021-04-30)
1.10.0 (2021-04-28)
1.9.1 (2021-04-28)
1.9.0 (2021-04-28)
1.8.0 (2021-04-28)
1.7.5 (2021-04-28)
- rollback husky version and add it to dependabot ignore (099ea5b)
1.7.4 (2021-04-25)
- lint issues auto-fix with ESLint (9f9e53e)
1.7.3 (2021-04-24)
1.7.2 (2021-04-24)
- 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)
- add ci yarn caching layer (5aa8ae1)
1.7.0 (2021-04-23)
- add
md
andmdx
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)
- package now has /cjs, /esm distibuted versions (4911c9d)
1.7.0 (2021-04-23)
- package now has /cjs, /esm distibuted versions (4911c9d)
1.6.2 (2021-04-22)
- add hook link to README.md (368f1d9)
1.7.0 (2021-04-22)
- add storybook docs with deploy to gh-pages (84de312)
1.6.1 (2021-04-21)
- useUnmountEffect and useMountEffect typings fix (32ec0c7)
1.6.0 (2021-04-21)
1.5.0 (2021-04-21)
- make tests import hooks from the index (3210650)
1.4.3 (2021-04-21)
- dist package returned to bundle (e92bd18)
1.4.2 (2021-04-18)
- add @semantic-release/github plugin (9f7e1b3)
1.4.1 (2021-04-16)
- add types field to package json and tweak build (8d64b9a)
1.4.0 (2021-04-16)
- add main file and reexport new hooks (e2ea1cb)
1.3.0 (2021-04-16)
- useUpdateEffect hook (bc3a655)
1.2.3 (2021-04-16)
- properly name useMountEffect and useUnmountEffect parameter (5218bfc)
1.2.2 (2021-04-15)
- attempt to make codecov push only occur on release publish (ac5c221)
1.2.1 (2021-04-15)
- codecov push should only occur on release publish (2a9e024)
1.2.0 (2021-04-15)
- add codecov coverage reporting (3254871)
1.1.0 (2021-04-15)
- implement useMountEffect and useUnmountEffect hooks (98ec434)
- 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)