Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions README-ko_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions src/docs/en/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
16 changes: 15 additions & 1 deletion src/docs/ko/intro.md
Original file line number Diff line number Diff line change
@@ -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를 사용할 때와 최대한 유사한 개발 경험을 제공해요. 더 적게 쓰고, 더 많은 것들을 더 직관적으로 구현해 보세요.
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useDoubleClick/useDoubleClick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ type UseDoubleClickProps<E extends HTMLElement> = {
};

/**
* @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.
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useGeolocation/useGeolocation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useImpressionRef/useImpressionRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useLongPress/useLongPress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export type UseLongPressOptions<E extends HTMLElement> = {
};

/**
* @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.
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useOutsideClickEffect/useOutsideClickEffect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { usePreservedCallback } from '../usePreservedCallback/index.ts';
type OneOrMore<T> = 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.
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useStorageState/useStorageState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
deserializer: (value: string) => Serializable<T>;
};

type SerializableGuard<T extends readonly any[]> = T[0] extends any

Check warning on line 24 in src/hooks/useStorageState/useStorageState.ts

View workflow job for this annotation

GitHub Actions / quality (lint)

Unexpected any. Specify a different type

Check warning on line 24 in src/hooks/useStorageState/useStorageState.ts

View workflow job for this annotation

GitHub Actions / quality (lint)

Unexpected any. Specify a different type
? T
: T[0] extends never
? 'Received a non-serializable value'
Expand All @@ -33,7 +33,7 @@
listeners.forEach(listener => listener());
};

function isPlainObject(value: unknown): value is Record<PropertyKey, any> {

Check warning on line 36 in src/hooks/useStorageState/useStorageState.ts

View workflow job for this annotation

GitHub Actions / quality (lint)

Unexpected any. Specify a different type
if (typeof value !== 'object') {
return false;
}
Expand All @@ -49,7 +49,7 @@
return Object.prototype.toString.call(value) === '[object Object]';
}

const ensureSerializable = <T extends readonly any[]>(value: T): SerializableGuard<T> => {

Check warning on line 52 in src/hooks/useStorageState/useStorageState.ts

View workflow job for this annotation

GitHub Actions / quality (lint)

Unexpected any. Specify a different type
if (
value[0] != null &&
!['string', 'number', 'boolean'].includes(typeof value[0]) &&
Expand All @@ -62,6 +62,10 @@
};

/**
* @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`.
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/useVisibilityEvent/useVisibilityEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down
Loading