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

[CLNP-5043] Migrate MessageSearchProvider #1216

Merged
merged 5 commits into from
Sep 27, 2024

Conversation

AhyoungRyu
Copy link
Contributor

@AhyoungRyu AhyoungRyu commented Sep 9, 2024

Overview

This PR refactors the MessageSearch state management system, introducing a custom store solution and several hooks for improved performance, maintainability, and type safety.

New Files

  • src/utils/storeManager.ts: Implements a custom store creation utility
  • src/contexts/_MessageSearchContext.tsx: Provides the MessageSearch context and store \w new state mgmt logic. It's just temporal name.
  • src/hooks/useStore.ts: A generic hook for accessing and updating store state
  • src/hooks/useMessageSearchStore.ts: A specialized hook for MessageSearch state management
  • src/components/MessageSearchManager.tsx: Manages MessageSearch state and side effects
  • src/hooks/useMessageSearchActions.ts: Manages action handlers

Updated Hooks

  • useSetChannel: Now uses useMessageSearchStore directly
  • useSearchStringEffect: Refactored to work with the new store
  • useGetSearchMessages: Updated to utilize the new state management system
  • useScrollCallback: Adapted to work with the custom store

Key Changes

  1. Introduced a custom store solution to replace the previous reducer-based state management.
  2. Implemented useStore hook for type-safe and efficient state access and updates.
  3. Created MessageSearchManager to centralize state management logic.
  4. Refactored existing hooks to work with the new store system.
  5. Improved type safety throughout the MessageSearch module.

Copy link

netlify bot commented Sep 9, 2024

Deploy Preview for sendbird-uikit-react ready!

Name Link
🔨 Latest commit 4117ab6
🔍 Latest deploy log https://app.netlify.com/sites/sendbird-uikit-react/deploys/66f62089e18bbf000831b9eb
😎 Deploy Preview https://deploy-preview-1216--sendbird-uikit-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@AhyoungRyu AhyoungRyu force-pushed the feat/CLNP-5043 branch 3 times, most recently from fe4bec9 to f54d0fe Compare September 10, 2024 04:26
@AhyoungRyu AhyoungRyu self-assigned this Sep 10, 2024
@AhyoungRyu AhyoungRyu force-pushed the feat/CLNP-5043 branch 4 times, most recently from ad527d6 to 1ac94eb Compare September 13, 2024 05:03
@AhyoungRyu AhyoungRyu changed the base branch from main to feat/state-mgmt-migration-1 September 27, 2024 03:04
@AhyoungRyu
Copy link
Contributor Author

It seems there's an issue in Circle CI so the unit tests fail on the prepare stage.
Screenshot 2024-09-27 at 1 41 41 PM

So I ran the test on my local machine.
Screenshot 2024-09-27 at 1 41 15 PM

@AhyoungRyu AhyoungRyu merged commit 22f5c1b into feat/state-mgmt-migration-1 Sep 27, 2024
10 checks passed
@AhyoungRyu AhyoungRyu deleted the feat/CLNP-5043 branch September 27, 2024 08:06
AhyoungRyu added a commit that referenced this pull request Oct 29, 2024
## Overview
This PR refactors the MessageSearch state management system, introducing
a custom store solution and several hooks for improved performance,
maintainability, and type safety.

## New Files
- `src/utils/storeManager.ts`: Implements a custom store creation
utility
- `src/contexts/_MessageSearchContext.tsx`: Provides the MessageSearch
context and store \w new state mgmt logic. It's just temporal name.
- `src/hooks/useStore.ts`: A generic hook for accessing and updating
store state
- `src/hooks/useMessageSearchStore.ts`: A specialized hook for
MessageSearch state management
- `src/components/MessageSearchManager.tsx`: Manages MessageSearch state
and side effects
- `src/hooks/useMessageSearchActions.ts`: Manages action handlers 

## Updated Hooks
- `useSetChannel`: Now uses `useMessageSearchStore` directly
- `useSearchStringEffect`: Refactored to work with the new store
- `useGetSearchMessages`: Updated to utilize the new state management
system
- `useScrollCallback`: Adapted to work with the custom store

## Key Changes
1. Introduced a custom store solution to replace the previous
reducer-based state management.
2. Implemented `useStore` hook for type-safe and efficient state access
and updates.
3. Created `MessageSearchManager` to centralize state management logic.
4. Refactored existing hooks to work with the new store system.
5. Improved type safety throughout the MessageSearch module.
AhyoungRyu added a commit that referenced this pull request Dec 2, 2024
## Overview
This PR refactors the MessageSearch state management system, introducing
a custom store solution and several hooks for improved performance,
maintainability, and type safety.

## New Files
- `src/utils/storeManager.ts`: Implements a custom store creation
utility
- `src/contexts/_MessageSearchContext.tsx`: Provides the MessageSearch
context and store \w new state mgmt logic. It's just temporal name.
- `src/hooks/useStore.ts`: A generic hook for accessing and updating
store state
- `src/hooks/useMessageSearchStore.ts`: A specialized hook for
MessageSearch state management
- `src/components/MessageSearchManager.tsx`: Manages MessageSearch state
and side effects
- `src/hooks/useMessageSearchActions.ts`: Manages action handlers 

## Updated Hooks
- `useSetChannel`: Now uses `useMessageSearchStore` directly
- `useSearchStringEffect`: Refactored to work with the new store
- `useGetSearchMessages`: Updated to utilize the new state management
system
- `useScrollCallback`: Adapted to work with the custom store

## Key Changes
1. Introduced a custom store solution to replace the previous
reducer-based state management.
2. Implemented `useStore` hook for type-safe and efficient state access
and updates.
3. Created `MessageSearchManager` to centralize state management logic.
4. Refactored existing hooks to work with the new store system.
5. Improved type safety throughout the MessageSearch module.
HoonBaek pushed a commit that referenced this pull request Dec 3, 2024
## Overview
This PR refactors the MessageSearch state management system, introducing
a custom store solution and several hooks for improved performance,
maintainability, and type safety.

## New Files
- `src/utils/storeManager.ts`: Implements a custom store creation
utility
- `src/contexts/_MessageSearchContext.tsx`: Provides the MessageSearch
context and store \w new state mgmt logic. It's just temporal name.
- `src/hooks/useStore.ts`: A generic hook for accessing and updating
store state
- `src/hooks/useMessageSearchStore.ts`: A specialized hook for
MessageSearch state management
- `src/components/MessageSearchManager.tsx`: Manages MessageSearch state
and side effects
- `src/hooks/useMessageSearchActions.ts`: Manages action handlers 

## Updated Hooks
- `useSetChannel`: Now uses `useMessageSearchStore` directly
- `useSearchStringEffect`: Refactored to work with the new store
- `useGetSearchMessages`: Updated to utilize the new state management
system
- `useScrollCallback`: Adapted to work with the custom store

## Key Changes
1. Introduced a custom store solution to replace the previous
reducer-based state management.
2. Implemented `useStore` hook for type-safe and efficient state access
and updates.
3. Created `MessageSearchManager` to centralize state management logic.
4. Refactored existing hooks to work with the new store system.
5. Improved type safety throughout the MessageSearch module.
AhyoungRyu added a commit that referenced this pull request Dec 11, 2024
## Overview
This PR refactors the MessageSearch state management system, introducing
a custom store solution and several hooks for improved performance,
maintainability, and type safety.

## New Files
- `src/utils/storeManager.ts`: Implements a custom store creation
utility
- `src/contexts/_MessageSearchContext.tsx`: Provides the MessageSearch
context and store \w new state mgmt logic. It's just temporal name.
- `src/hooks/useStore.ts`: A generic hook for accessing and updating
store state
- `src/hooks/useMessageSearchStore.ts`: A specialized hook for
MessageSearch state management
- `src/components/MessageSearchManager.tsx`: Manages MessageSearch state
and side effects
- `src/hooks/useMessageSearchActions.ts`: Manages action handlers 

## Updated Hooks
- `useSetChannel`: Now uses `useMessageSearchStore` directly
- `useSearchStringEffect`: Refactored to work with the new store
- `useGetSearchMessages`: Updated to utilize the new state management
system
- `useScrollCallback`: Adapted to work with the custom store

## Key Changes
1. Introduced a custom store solution to replace the previous
reducer-based state management.
2. Implemented `useStore` hook for type-safe and efficient state access
and updates.
3. Created `MessageSearchManager` to centralize state management logic.
4. Refactored existing hooks to work with the new store system.
5. Improved type safety throughout the MessageSearch module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants