@react-hookz/web
Advanced tools
Changelog
24.0.1 (2023-12-20)
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.
Changelog
24.0.1 (2023-12-20)
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.
Changelog
22.0.0 (2023-01-05)
4ex:
// previously
import { useUpdate } from "@react-hookz/web/useUpdate/useUpdate"
// now
import { useUpdate } from "@react-hookz/web/useUpdate"
Changelog
21.0.0 (2023-01-04)
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.