Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rename all hook implementation files to index.ts #1065

Merged
merged 4 commits into from
Jan 5, 2023
Merged

Conversation

xobotyi
Copy link
Contributor

@xobotyi xobotyi commented Jan 4, 2023

Current scheme of files naming implied redundant duplication of hook name in case of direct imports, leading to more verbose and kind of littered imports block.

New scheme assumes that hook implementation should be within index.ts file, allowing directory imports and more granular control over hook exports overall.

@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Merging #1065 (a0df3e0) into master (5a622af) will increase coverage by 1.85%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1065      +/-   ##
==========================================
+ Coverage   96.66%   98.52%   +1.85%     
==========================================
  Files          63       63              
  Lines        1111     1082      -29     
  Branches      180      180              
==========================================
- Hits         1074     1066       -8     
+ Misses         23        2      -21     
  Partials       14       14              
Impacted Files Coverage Δ
src/useConditionalEffect/index.ts 100.00% <ø> (ø)
src/useCustomCompareMemo/index.ts 100.00% <ø> (ø)
src/useFirstMountState/index.ts 100.00% <ø> (ø)
src/useIsMounted/index.ts 100.00% <ø> (ø)
src/useIsomorphicLayoutEffect/index.ts 100.00% <ø> (ø)
src/useLifecycleLogger/index.ts 100.00% <ø> (ø)
src/useMediaQuery/index.ts 100.00% <ø> (ø)
src/useMountEffect/index.ts 100.00% <ø> (ø)
src/usePrevious/index.ts 100.00% <ø> (ø)
src/useRenderCount/index.ts 100.00% <ø> (ø)
... and 50 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

BREAKING CHANGE: 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"
```
@xobotyi xobotyi merged commit 34c36f2 into master Jan 5, 2023
github-actions bot pushed a commit that referenced this pull request Jan 5, 2023
# [22.0.0](v21.0.0...v22.0.0) (2023-01-05)

### Features

* rename all hook implementation files to `index.ts` ([#1065](#1065)) ([34c36f2](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"
```
@xobotyi
Copy link
Contributor Author

xobotyi commented Jan 5, 2023

🎉 This PR is included in version 22.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

1 participant