Commit 50921ef
authored
feat: switch package to module type (#1472)
BREAKING CHANGE: 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.1 parent 050d21a commit 50921ef
File tree
307 files changed
+1700
-9252
lines changed- .github/workflows
- .storybook
- public
- src
- __docs__
- __tests__
- useAsyncAbortable
- __docs__
- __tests__
- useAsync
- __docs__
- __tests__
- useClickOutside
- __docs__
- __tests__
- useConditionalEffect
- __docs__
- __tests__
- useControlledRerenderState
- __docs__
- __tests__
- useCookieValue
- __docs__
- __tests__
- useCounter
- __docs__
- __tests__
- useCustomCompareEffect
- __docs__
- __tests__
- useCustomCompareMemo
- __docs__
- __tests__
- useDebouncedCallback
- __docs__
- __tests__
- useDebouncedEffect
- __docs__
- __tests__
- useDebouncedState
- __docs__
- __tests__
- useDeepCompareEffect
- __docs__
- __tests__
- useDeepCompareMemo
- __docs__
- __tests__
- useDocumentVisibility
- __docs__
- __tests__
- useEventListener
- __docs__
- __tests__
- useFirstMountState
- __docs__
- __tests__
- useFunctionalState
- __docs__
- __tests__
- useHookableRef
- __docs__
- __tests__
- useIntersectionObserver
- __docs__
- __tests__
- useIntervalEffect
- __docs__
- __tests__
- useIsMounted
- __docs__
- __tests__
- useIsomorphicLayoutEffect
- __docs__
- __tests__
- useKeyboardEvent
- __docs__
- __tests__
- useLifecycleLogger
- __docs__
- __tests__
- useList
- __docs__
- __tests__
- useLocalStorageValue
- __docs__
- __tests__
- useMap
- __docs__
- __tests__
- useMeasure
- __docs__
- __tests__
- useMediaQuery
- __docs__
- __tests__
- useMediatedState
- __docs__
- __tests__
- useMountEffect
- __docs__
- __tests__
- useNetworkState
- __docs__
- __tests__
- usePermission
- __docs__
- __tests__
- usePreviousDistinct
- __docs__
- __tests__
- usePrevious
- __docs__
- __tests__
- useQueue
- __docs__
- __tests__
- useRafCallback
- __docs__
- __tests__
- useRafEffect
- __docs__
- __tests__
- useRafState
- __docs__
- __tests__
- useRenderCount
- __docs__
- __tests__
- useRerender
- __docs__
- __tests__
- useResizeObserver
- __docs__
- __tests__
- useScreenOrientation
- __docs__
- __tests__
- useSessionStorageValue
- __docs__
- __tests__
- useSet
- __docs__
- __tests__
- useStorageValue
- __tests__
- useSyncedRef
- __docs__
- __tests__
- useThrottledCallback
- __docs__
- __tests__
- useThrottledEffect
- __docs__
- __tests__
- useThrottledState
- __docs__
- __tests__
- useTimeoutEffect
- __docs__
- __tests__
- useToggle
- __docs__
- __tests__
- useUnmountEffect
- __docs__
- __tests__
- useUpdateEffect
- __docs__
- __tests__
- useValidator
- __docs__
- __tests__
- useVibrate
- __docs__
- __tests__
- useWindowSize
- __docs__
- __tests__
- util
- __tests__
- utility
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
307 files changed
+1700
-9252
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
5 | 4 | | |
6 | | - | |
7 | 5 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 6 | + | |
| 7 | + | |
11 | 8 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | | - | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments