Skip to content

Commit 9a73aa0

Browse files
authored
refactor: next step (#302)
1 parent d9a9159 commit 9a73aa0

13 files changed

Lines changed: 159 additions & 1 deletion

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'react-simplikit': patch
3+
---
4+
5+
Deprecate hooks that depend on browser-specific APIs
6+
7+
The following hooks are now marked as deprecated:
8+
9+
- `useDoubleClick`
10+
- `useGeolocation`
11+
- `useImpressionRef`
12+
- `useIntersectionObserver`
13+
- `useLongPress`
14+
- `useOutsideClickEffect`
15+
- `useStorageState`
16+
- `useVisibilityEvent`
17+
18+
These hooks will be removed in a future major version as react-simplikit is now focused on platform-independent, pure state/logic hooks.

README-ko_kr.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,46 @@
1010
- `react-simplikit`은 100% 테스트 커버리지를 통해 신뢰성을 보장해요.
1111
- `react-simplikit`은 JSDoc과 풍부한 문서, 예제를 제공해서 어떤 개발자도 쉽게 사용할 수 있어요.
1212

13+
## 라이브러리 운영 방향
14+
15+
**react-simplikit은 이제 완전히 순수한 상태/로직 훅만을 위한 Universal Hook Library로 유지됩니다.**
16+
17+
react-simplikit은 웹/앱(React Native 등) 어디서든 동작 가능한, **플랫폼에 종속되지 않은 순수 상태/로직 훅만을 제공하는 라이브러리**로 재편됩니다.
18+
19+
### 유지되는 것: 순수 상태/로직 훅
20+
21+
특정 플랫폼 API에 의존하지 않는 순수 로직 기반 훅들은 계속 제공돼요:
22+
23+
- `useToggle`, `useBooleanState`, `useCounter` 같은 상태 관리 훅
24+
- `usePrevious`, `useMount` 같은 라이프사이클 훅
25+
- `useDebounce`, `useThrottle` 같은 유틸리티 훅
26+
- **기존 프로젝트의 Backward Compatibility(BC)는 보존돼요**
27+
28+
### Deprecated 되는 것: 브라우저/플랫폼 결합 훅
29+
30+
다음과 같이 브라우저에 강하게 의존하는 훅들은 Deprecated 처리돼요:
31+
32+
- `useGeolocation` - `navigator.geolocation` 의존
33+
- `useStorageState` - `localStorage`/`sessionStorage` 의존
34+
- `useIntersectionObserver` - `IntersectionObserver` API 의존
35+
- `useImpressionRef` - `IntersectionObserver` + Visibility API 의존
36+
- `useDoubleClick`, `useLongPress` - DOM 이벤트 + `window.setTimeout` 의존
37+
- `useOutsideClickEffect` - DOM 이벤트 + `document` 의존
38+
- `useVisibilityEvent` - `document.visibilityState` 의존
39+
40+
이 훅들은:
41+
42+
- 새 기능 추가나 적극적인 고도화는 진행하지 않고
43+
- 문서 상에서 `@deprecated`로 명시하고
44+
- 장기적으로는 메이저 버전 업데이트에서 제거를 검토할 수 있어요
45+
46+
### 패키지 상태
47+
48+
- react-simplikit은 **아카이브하지 않아요**
49+
- 순수 상태/로직 훅들은 계속 유지돼요
50+
- 치명적인 버그 수정, 최소한의 유지보수는 계속 진행할 예정이에요
51+
- 새로운 브라우저/플랫폼 종속 훅을 추가하는 일은 이제 지양해요
52+
1353
## 예시
1454

1555
```tsx

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,46 @@ English | [Korean](./README-ko_kr.md)
1010
- `react-simplikit` guarantees reliability with 100% test coverage.
1111
- `react-simplikit` offers JSDoc comments, detailed documentation, and examples to ensure any developer can easily use it.
1212

13+
## Library Direction
14+
15+
**react-simplikit is now maintained as a Universal Hook Library providing only pure state/logic hooks.**
16+
17+
We are repositioning react-simplikit to focus exclusively on **platform-independent hooks** that work seamlessly across web and mobile (React Native, etc.).
18+
19+
### What's Maintained: Pure State/Logic Hooks
20+
21+
Hooks that don't depend on specific platform APIs will continue to be actively maintained:
22+
23+
- State management hooks like `useToggle`, `useBooleanState`, `useCounter`
24+
- Lifecycle hooks like `usePrevious`, `useMount`
25+
- Utility hooks like `useDebounce`, `useThrottle`
26+
- **Backward compatibility (BC) is preserved** for these existing pure logic hooks
27+
28+
### What's Deprecated: Browser/Platform-Dependent Hooks
29+
30+
The following hooks that strongly depend on browser-specific APIs are now deprecated:
31+
32+
- `useGeolocation` - depends on `navigator.geolocation`
33+
- `useStorageState` - depends on `localStorage`/`sessionStorage`
34+
- `useIntersectionObserver` - depends on `IntersectionObserver` API
35+
- `useImpressionRef` - depends on `IntersectionObserver` + Visibility API
36+
- `useDoubleClick`, `useLongPress` - depend on DOM events + `window.setTimeout`
37+
- `useOutsideClickEffect` - depends on DOM events + `document`
38+
- `useVisibilityEvent` - depends on `document.visibilityState`
39+
40+
These hooks:
41+
42+
- Will not receive new features or major enhancements
43+
- Are marked as `@deprecated` in documentation
44+
- May be removed in future major versions
45+
46+
### Package Status
47+
48+
- react-simplikit will **not be archived**
49+
- Pure state/logic hooks will continue to be maintained
50+
- Critical bug fixes and minimal maintenance will continue
51+
- No new browser/platform-dependent hooks will be added
52+
1353
## Example
1454

1555
```tsx

src/docs/en/intro.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@ How can we build React-based applications more safely and reliably? We defined t
44

55
`react-simplikit` is a lightweight yet powerful library that provides various useful tools in React environments. It is designed to respect React's design principles while improving the React development experience.
66

7+
## Library Direction
8+
9+
**react-simplikit is now maintained as a Universal Hook Library providing only pure state/logic hooks.**
10+
11+
We are repositioning react-simplikit to focus exclusively on **platform-independent hooks** that work seamlessly across web and mobile (React Native, etc.). Network-intensive, browser API-dependent, and DOM-coupled features are no longer part of react-simplikit's scope.
12+
13+
### What's Maintained
14+
15+
Hooks that don't depend on specific platform APIs will continue to be actively maintained, such as state management hooks (`useToggle`, `useBooleanState`), lifecycle hooks (`usePrevious`), and utility hooks (`useDebounce`, `useThrottle`). Backward compatibility is preserved for these pure logic hooks.
16+
17+
### What's Deprecated
18+
19+
Browser/platform-dependent hooks like `useGeolocation`, `useStorageState`, `useIntersectionObserver`, `useImpressionRef`, `useDoubleClick`, `useLongPress`, `useOutsideClickEffect`, and `useVisibilityEvent` are now deprecated. These hooks will not receive new features and may be removed in future major versions.
20+
721
## More Intuitive and Familiar Interface
822

923
We provide a development experience as similar as possible to using React's declarative API. Write less and do more, more easily.

src/docs/ko/intro.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
# react-simplikit 소개
22

3-
어떻게 하면 React 기반 앱을 좀 더 안전하고 탄탄하게 만들 수 있을까? 우리는 그 답을 리액트를 리액트답게 작성하는 것이라고 정의했고, `react-simplikit`으로 그 답을 구체화했어요.
3+
어떻게 하면 React 기반 앱을 좀 더 안전하고 탄탄하게 만들 수 있을까? 우리는 그 답을 '리액트를 리액트답게' 작성하는 것이라고 정의했고, `react-simplikit`으로 그 답을 구체화했어요.
44

55
`react-simplikit`은 React 환경에서 유용하게 사용할 수 있는 다양한 도구들을 제공하는 가볍고 강력한 라이브러리예요. React의 설계 원칙을 존중하면서 동시에, React의 개발 경험을 개선하기 위해 설계되었어요.
66

7+
## 라이브러리 운영 방향
8+
9+
**react-simplikit은 이제 완전히 순수한 상태/로직 훅만을 위한 Universal Hook Library로 유지됩니다.**
10+
11+
react-simplikit은 웹/앱(React Native 등) 어디서든 동작 가능한, **플랫폼에 종속되지 않은 순수 상태/로직 훅만을 제공하는 라이브러리**로 재편됩니다. 네트워크, 브라우저 API, DOM 등에 강하게 결합된 기능은 더 이상 react-simplikit의 관심사가 아니에요.
12+
13+
### 유지되는 것
14+
15+
특정 플랫폼 API에 의존하지 않는 순수 로직 기반 훅들은 계속 제공돼요. 상태 관리 훅(`useToggle`, `useBooleanState`), 라이프사이클 훅(`usePrevious`), 유틸리티 훅(`useDebounce`, `useThrottle`) 등이 해당되며, 기존 프로젝트의 Backward Compatibility는 보존돼요.
16+
17+
### Deprecated 되는 것
18+
19+
`useGeolocation`, `useStorageState`, `useIntersectionObserver`, `useImpressionRef`, `useDoubleClick`, `useLongPress`, `useOutsideClickEffect`, `useVisibilityEvent` 같은 브라우저/플랫폼 의존 훅들은 Deprecated 처리돼요. 이 훅들은 새 기능을 추가하지 않으며, 장기적으로는 메이저 버전 업데이트에서 제거를 검토할 수 있어요.
20+
721
## 더 직관적이고 익숙한 인터페이스
822

923
React의 선언적인 API를 사용할 때와 최대한 유사한 개발 경험을 제공해요. 더 적게 쓰고, 더 많은 것들을 더 직관적으로 구현해 보세요.

src/hooks/useDoubleClick/useDoubleClick.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ type UseDoubleClickProps<E extends HTMLElement> = {
99
};
1010

1111
/**
12+
* @deprecated This hook is deprecated as it depends on browser-specific APIs (DOM events, window.setTimeout).
13+
* react-simplikit is now focused on platform-independent, pure state/logic hooks.
14+
* This hook will be removed in a future major version.
15+
*
1216
* @description
1317
* `useDoubleClick` is a React hook that differentiates between single and double click events.
1418
* It delays the single click callback execution for a specified time, and cancels it if a second click (i.e. a double click) occurs within that time.

src/hooks/useGeolocation/useGeolocation.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ type GeolocationOptions = {
3333
} & PositionOptions;
3434

3535
/**
36+
* @deprecated This hook is deprecated as it depends on browser-specific APIs (navigator.geolocation).
37+
* react-simplikit is now focused on platform-independent, pure state/logic hooks.
38+
* This hook will be removed in a future major version.
39+
*
3640
* @description
3741
* `useGeolocation` is a React hook that retrieves and tracks the user's geographical location.
3842
* It uses the browser's `Geolocation API` to support both one-time position retrieval and continuous location tracking.

src/hooks/useImpressionRef/useImpressionRef.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export type UseImpressionRefOptions = Partial<{
1414
}>;
1515

1616
/**
17+
* @deprecated This hook is deprecated as it depends on browser-specific APIs (IntersectionObserver, Visibility API).
18+
* react-simplikit is now focused on platform-independent, pure state/logic hooks.
19+
* This hook will be removed in a future major version.
20+
*
1721
* @description
1822
* `useImpressionRef` is a React hook that measures the time a specific DOM element is visible on the screen and executes callbacks when the element enters or exits the viewport.
1923
* It uses `IntersectionObserver` and the `Visibility API` to track the element's visibility.

src/hooks/useIntersectionObserver/useIntersectionObserver.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import { usePreservedCallback } from '../usePreservedCallback/index.ts';
44
import { useRefEffect } from '../useRefEffect/index.ts';
55

66
/**
7+
* @deprecated This hook is deprecated as it depends on browser-specific APIs (IntersectionObserver).
8+
* react-simplikit is now focused on platform-independent, pure state/logic hooks.
9+
* This hook will be removed in a future major version.
10+
*
711
* @description
812
* `useIntersectionObserver` is a React hook that detects whether a specific DOM element is visible on the screen.
913
* It uses the `IntersectionObserver` API to execute a callback when the element enters or exits the viewport.

src/hooks/useLongPress/useLongPress.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export type UseLongPressOptions<E extends HTMLElement> = {
1414
};
1515

1616
/**
17+
* @deprecated This hook is deprecated as it depends on browser-specific APIs (DOM events, window.setTimeout).
18+
* react-simplikit is now focused on platform-independent, pure state/logic hooks.
19+
* This hook will be removed in a future major version.
20+
*
1721
* @description
1822
* `useLongPress` is a React hook that detects when an element is pressed and held for a specified duration.
1923
* It handles both mouse and touch events, making it work consistently across desktop and mobile devices.

0 commit comments

Comments
 (0)