From 0e6fdc3bde85021d725c8dffde9f27c581877dcf Mon Sep 17 00:00:00 2001 From: kimyouknow Date: Mon, 15 Dec 2025 20:41:20 +0900 Subject: [PATCH 1/3] chore: deprecate hooks that rely on browser-specific APIs The following hooks have been marked as deprecated due to their reliance on browser-specific APIs, as react-simplikit shifts focus to platform-independent, pure state/logic hooks: - useDoubleClick - useGeolocation - useImpressionRef - useIntersectionObserver - useLongPress - useOutsideClickEffect - useStorageState - useVisibilityEvent These hooks will be removed in a future major version. --- src/hooks/useDoubleClick/useDoubleClick.ts | 4 ++++ src/hooks/useGeolocation/useGeolocation.ts | 4 ++++ src/hooks/useImpressionRef/useImpressionRef.ts | 4 ++++ src/hooks/useIntersectionObserver/useIntersectionObserver.ts | 4 ++++ src/hooks/useLongPress/useLongPress.ts | 4 ++++ src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts | 4 ++++ src/hooks/useStorageState/useStorageState.ts | 4 ++++ src/hooks/useVisibilityEvent/useVisibilityEvent.ts | 4 ++++ 8 files changed, 32 insertions(+) diff --git a/src/hooks/useDoubleClick/useDoubleClick.ts b/src/hooks/useDoubleClick/useDoubleClick.ts index 4614a9ab..1b065b1d 100644 --- a/src/hooks/useDoubleClick/useDoubleClick.ts +++ b/src/hooks/useDoubleClick/useDoubleClick.ts @@ -9,6 +9,10 @@ type UseDoubleClickProps = { }; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (DOM events, window.setTimeout). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `useDoubleClick` is a React hook that differentiates between single and double click events. * 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. diff --git a/src/hooks/useGeolocation/useGeolocation.ts b/src/hooks/useGeolocation/useGeolocation.ts index 1f50e984..cfdd7964 100644 --- a/src/hooks/useGeolocation/useGeolocation.ts +++ b/src/hooks/useGeolocation/useGeolocation.ts @@ -33,6 +33,10 @@ type GeolocationOptions = { } & PositionOptions; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (navigator.geolocation). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `useGeolocation` is a React hook that retrieves and tracks the user's geographical location. * It uses the browser's `Geolocation API` to support both one-time position retrieval and continuous location tracking. diff --git a/src/hooks/useImpressionRef/useImpressionRef.ts b/src/hooks/useImpressionRef/useImpressionRef.ts index 8ff2b407..baca1cea 100644 --- a/src/hooks/useImpressionRef/useImpressionRef.ts +++ b/src/hooks/useImpressionRef/useImpressionRef.ts @@ -14,6 +14,10 @@ export type UseImpressionRefOptions = Partial<{ }>; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (IntersectionObserver, Visibility API). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `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. * It uses `IntersectionObserver` and the `Visibility API` to track the element's visibility. diff --git a/src/hooks/useIntersectionObserver/useIntersectionObserver.ts b/src/hooks/useIntersectionObserver/useIntersectionObserver.ts index ea57d227..627e9bb9 100644 --- a/src/hooks/useIntersectionObserver/useIntersectionObserver.ts +++ b/src/hooks/useIntersectionObserver/useIntersectionObserver.ts @@ -4,6 +4,10 @@ import { usePreservedCallback } from '../usePreservedCallback/index.ts'; import { useRefEffect } from '../useRefEffect/index.ts'; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (IntersectionObserver). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `useIntersectionObserver` is a React hook that detects whether a specific DOM element is visible on the screen. * It uses the `IntersectionObserver` API to execute a callback when the element enters or exits the viewport. diff --git a/src/hooks/useLongPress/useLongPress.ts b/src/hooks/useLongPress/useLongPress.ts index 9c8a7608..faa702cf 100644 --- a/src/hooks/useLongPress/useLongPress.ts +++ b/src/hooks/useLongPress/useLongPress.ts @@ -14,6 +14,10 @@ export type UseLongPressOptions = { }; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (DOM events, window.setTimeout). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `useLongPress` is a React hook that detects when an element is pressed and held for a specified duration. * It handles both mouse and touch events, making it work consistently across desktop and mobile devices. diff --git a/src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts b/src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts index eb83c4e1..cada9216 100644 --- a/src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts +++ b/src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts @@ -5,6 +5,10 @@ import { usePreservedCallback } from '../usePreservedCallback/index.ts'; type OneOrMore = T | T[]; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (DOM events, document). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `useOutsideClickEffect` is a React hook that triggers a callback when a click event occurs outside the specified container(s). * It is useful for closing modals, dropdowns, tooltips, and other UI components when clicking outside. diff --git a/src/hooks/useStorageState/useStorageState.ts b/src/hooks/useStorageState/useStorageState.ts index 5d87d2e3..8f280260 100644 --- a/src/hooks/useStorageState/useStorageState.ts +++ b/src/hooks/useStorageState/useStorageState.ts @@ -62,6 +62,10 @@ const ensureSerializable = (value: T): SerializableGua }; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (localStorage/sessionStorage). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `useStorageState` is a React that functions like `useState` but persists the state value in browser storage. * The value is retained across page reloads and can be shared between tabs when using `localStorage`. diff --git a/src/hooks/useVisibilityEvent/useVisibilityEvent.ts b/src/hooks/useVisibilityEvent/useVisibilityEvent.ts index adf0765f..64a7d61e 100644 --- a/src/hooks/useVisibilityEvent/useVisibilityEvent.ts +++ b/src/hooks/useVisibilityEvent/useVisibilityEvent.ts @@ -5,6 +5,10 @@ type Options = { }; /** + * @deprecated This hook is deprecated as it depends on browser-specific APIs (document.visibilityState). + * react-simplikit is now focused on platform-independent, pure state/logic hooks. + * This hook will be removed in a future major version. + * * @description * `useVisibilityEvent` is a React hook that listens to changes in the document's visibility state and triggers a callback. * From b29c61c8f4e840ffeac24ff9b00229e6a1ea24a3 Mon Sep 17 00:00:00 2001 From: kimyouknow Date: Mon, 15 Dec 2025 20:42:10 +0900 Subject: [PATCH 2/3] docs: update library direction and deprecate platform-dependent hooks Reposition react-simplikit as a Universal Hook Library focused on platform-independent, pure state/logic hooks. Maintain backward compatibility for existing hooks like `useToggle` and `usePrevious`, while deprecating browser/platform-dependent hooks such as `useGeolocation` and `useDoubleClick`, which will not receive new features and may be removed in future versions. --- src/docs/en/intro.md | 14 ++++++++++++++ src/docs/ko/intro.md | 16 +++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/docs/en/intro.md b/src/docs/en/intro.md index 8e7e2e48..87d8f0ca 100644 --- a/src/docs/en/intro.md +++ b/src/docs/en/intro.md @@ -4,6 +4,20 @@ How can we build React-based applications more safely and reliably? We defined t `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. +## Library Direction + +**react-simplikit is now maintained as a Universal Hook Library providing only pure state/logic hooks.** + +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. + +### What's Maintained + +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. + +### What's Deprecated + +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. + ## More Intuitive and Familiar Interface We provide a development experience as similar as possible to using React's declarative API. Write less and do more, more easily. diff --git a/src/docs/ko/intro.md b/src/docs/ko/intro.md index cb89c0f2..058cb735 100644 --- a/src/docs/ko/intro.md +++ b/src/docs/ko/intro.md @@ -1,9 +1,23 @@ # react-simplikit 소개 -어떻게 하면 React 기반 앱을 좀 더 안전하고 탄탄하게 만들 수 있을까? 우리는 그 답을 ‘리액트를 리액트답게’ 작성하는 것이라고 정의했고, `react-simplikit`으로 그 답을 구체화했어요. +어떻게 하면 React 기반 앱을 좀 더 안전하고 탄탄하게 만들 수 있을까? 우리는 그 답을 '리액트를 리액트답게' 작성하는 것이라고 정의했고, `react-simplikit`으로 그 답을 구체화했어요. `react-simplikit`은 React 환경에서 유용하게 사용할 수 있는 다양한 도구들을 제공하는 가볍고 강력한 라이브러리예요. React의 설계 원칙을 존중하면서 동시에, React의 개발 경험을 개선하기 위해 설계되었어요. +## 라이브러리 운영 방향 + +**react-simplikit은 이제 완전히 순수한 상태/로직 훅만을 위한 Universal Hook Library로 유지됩니다.** + +react-simplikit은 웹/앱(React Native 등) 어디서든 동작 가능한, **플랫폼에 종속되지 않은 순수 상태/로직 훅만을 제공하는 라이브러리**로 재편됩니다. 네트워크, 브라우저 API, DOM 등에 강하게 결합된 기능은 더 이상 react-simplikit의 관심사가 아니에요. + +### 유지되는 것 + +특정 플랫폼 API에 의존하지 않는 순수 로직 기반 훅들은 계속 제공돼요. 상태 관리 훅(`useToggle`, `useBooleanState`), 라이프사이클 훅(`usePrevious`), 유틸리티 훅(`useDebounce`, `useThrottle`) 등이 해당되며, 기존 프로젝트의 Backward Compatibility는 보존돼요. + +### Deprecated 되는 것 + +`useGeolocation`, `useStorageState`, `useIntersectionObserver`, `useImpressionRef`, `useDoubleClick`, `useLongPress`, `useOutsideClickEffect`, `useVisibilityEvent` 같은 브라우저/플랫폼 의존 훅들은 Deprecated 처리돼요. 이 훅들은 새 기능을 추가하지 않으며, 장기적으로는 메이저 버전 업데이트에서 제거를 검토할 수 있어요. + ## 더 직관적이고 익숙한 인터페이스 React의 선언적인 API를 사용할 때와 최대한 유사한 개발 경험을 제공해요. 더 적게 쓰고, 더 많은 것들을 더 직관적으로 구현해 보세요. From 0913231a589310421c284c0224f15a82fa4a3a44 Mon Sep 17 00:00:00 2001 From: kimyouknow Date: Mon, 15 Dec 2025 20:42:16 +0900 Subject: [PATCH 3/3] docs: clarify library direction and maintain focus on pure state/logic hooks Updated the README to emphasize that react-simplikit will exclusively support platform-independent pure state/logic hooks, while deprecating browser/platform-dependent hooks. Ensured backward compatibility for existing hooks and outlined the ongoing maintenance plan for the library. --- README-ko_kr.md | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) diff --git a/README-ko_kr.md b/README-ko_kr.md index 9c55c64a..3ad87c67 100644 --- a/README-ko_kr.md +++ b/README-ko_kr.md @@ -10,6 +10,46 @@ - `react-simplikit`은 100% 테스트 커버리지를 통해 신뢰성을 보장해요. - `react-simplikit`은 JSDoc과 풍부한 문서, 예제를 제공해서 어떤 개발자도 쉽게 사용할 수 있어요. +## 라이브러리 운영 방향 + +**react-simplikit은 이제 완전히 순수한 상태/로직 훅만을 위한 Universal Hook Library로 유지됩니다.** + +react-simplikit은 웹/앱(React Native 등) 어디서든 동작 가능한, **플랫폼에 종속되지 않은 순수 상태/로직 훅만을 제공하는 라이브러리**로 재편됩니다. + +### 유지되는 것: 순수 상태/로직 훅 + +특정 플랫폼 API에 의존하지 않는 순수 로직 기반 훅들은 계속 제공돼요: + +- `useToggle`, `useBooleanState`, `useCounter` 같은 상태 관리 훅 +- `usePrevious`, `useMount` 같은 라이프사이클 훅 +- `useDebounce`, `useThrottle` 같은 유틸리티 훅 +- **기존 프로젝트의 Backward Compatibility(BC)는 보존돼요** + +### Deprecated 되는 것: 브라우저/플랫폼 결합 훅 + +다음과 같이 브라우저에 강하게 의존하는 훅들은 Deprecated 처리돼요: + +- `useGeolocation` - `navigator.geolocation` 의존 +- `useStorageState` - `localStorage`/`sessionStorage` 의존 +- `useIntersectionObserver` - `IntersectionObserver` API 의존 +- `useImpressionRef` - `IntersectionObserver` + Visibility API 의존 +- `useDoubleClick`, `useLongPress` - DOM 이벤트 + `window.setTimeout` 의존 +- `useOutsideClickEffect` - DOM 이벤트 + `document` 의존 +- `useVisibilityEvent` - `document.visibilityState` 의존 + +이 훅들은: + +- 새 기능 추가나 적극적인 고도화는 진행하지 않고 +- 문서 상에서 `@deprecated`로 명시하고 +- 장기적으로는 메이저 버전 업데이트에서 제거를 검토할 수 있어요 + +### 패키지 상태 + +- react-simplikit은 **아카이브하지 않아요** +- 순수 상태/로직 훅들은 계속 유지돼요 +- 치명적인 버그 수정, 최소한의 유지보수는 계속 진행할 예정이에요 +- 새로운 브라우저/플랫폼 종속 훅을 추가하는 일은 이제 지양해요 + ## 예시 ```tsx diff --git a/README.md b/README.md index 6cb99c77..0bbab82d 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,46 @@ English | [Korean](./README-ko_kr.md) - `react-simplikit` guarantees reliability with 100% test coverage. - `react-simplikit` offers JSDoc comments, detailed documentation, and examples to ensure any developer can easily use it. +## Library Direction + +**react-simplikit is now maintained as a Universal Hook Library providing only pure state/logic hooks.** + +We are repositioning react-simplikit to focus exclusively on **platform-independent hooks** that work seamlessly across web and mobile (React Native, etc.). + +### What's Maintained: Pure State/Logic Hooks + +Hooks that don't depend on specific platform APIs will continue to be actively maintained: + +- State management hooks like `useToggle`, `useBooleanState`, `useCounter` +- Lifecycle hooks like `usePrevious`, `useMount` +- Utility hooks like `useDebounce`, `useThrottle` +- **Backward compatibility (BC) is preserved** for these existing pure logic hooks + +### What's Deprecated: Browser/Platform-Dependent Hooks + +The following hooks that strongly depend on browser-specific APIs are now deprecated: + +- `useGeolocation` - depends on `navigator.geolocation` +- `useStorageState` - depends on `localStorage`/`sessionStorage` +- `useIntersectionObserver` - depends on `IntersectionObserver` API +- `useImpressionRef` - depends on `IntersectionObserver` + Visibility API +- `useDoubleClick`, `useLongPress` - depend on DOM events + `window.setTimeout` +- `useOutsideClickEffect` - depends on DOM events + `document` +- `useVisibilityEvent` - depends on `document.visibilityState` + +These hooks: + +- Will not receive new features or major enhancements +- Are marked as `@deprecated` in documentation +- May be removed in future major versions + +### Package Status + +- react-simplikit will **not be archived** +- Pure state/logic hooks will continue to be maintained +- Critical bug fixes and minimal maintenance will continue +- No new browser/platform-dependent hooks will be added + ## Example ```tsx