Skip to content

Conversation

@AhyoungRyu
Copy link
Contributor

@AhyoungRyu AhyoungRyu commented Nov 5, 2024

Addresses https://sendbird.atlassian.net/browse/CLNP-5047

Overview

This PR migrates the GroupChannelProvider to use a new state management pattern. This change introduces a more predictable and maintainable way to manage channel state while maintaining backward compatibility.

Key Changes

  • Introduced new store-based state management
  • Separated concerns between state management and event handling
  • Added useGroupChannel hook for accessing state and actions
  • Optimized performance with proper memoization

Migration Path

Old pattern:

const { someState, someHandler } = useGroupChannelContext();

New pattern:

// For state and actions
const { state, actions } = useGroupChannel();

// For handlers and props (backward compatibility)
const { someHandler } = useGroupChannelContext();

Benefits

  • More predictable state updates
  • Better separation of concerns
  • Enhanced performance through optimized renders

Testing

  • All existing functionality remains unchanged
  • Added tests for new hooks and state management
  • Verified backward compatibility
  • Tested with real-time updates and message handling

Notes for Reviewers

  • useGroupChannelContext is kept for backward compatibility
  • Unit & integration tests will be added for new hooks and state management

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If unsure, ask the members.
This is a reminder of what we look for before merging your code.

  • All tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • Public components / utils / props are appropriately exported
  • I have added necessary documentation (if appropriate)

@AhyoungRyu AhyoungRyu self-assigned this Nov 5, 2024
@AhyoungRyu AhyoungRyu force-pushed the feat/CLNP-5047/groupchannel-migration branch from 9523b53 to a3c0ccf Compare November 5, 2024 14:18
@AhyoungRyu AhyoungRyu force-pushed the feat/CLNP-5047/groupchannel-migration branch from a3c0ccf to e175dd2 Compare November 6, 2024 04:46
@AhyoungRyu AhyoungRyu force-pushed the feat/CLNP-5047/groupchannel-migration branch 2 times, most recently from d119173 to 88fdea1 Compare November 7, 2024 07:41
@AhyoungRyu AhyoungRyu force-pushed the feat/CLNP-5047/groupchannel-migration branch from 88fdea1 to 74702f6 Compare November 7, 2024 07:52
@netlify
Copy link

netlify bot commented Nov 7, 2024

Deploy Preview for sendbird-uikit-react ready!

Name Link
🔨 Latest commit ea6a79f
🔍 Latest deploy log https://app.netlify.com/sites/sendbird-uikit-react/deploys/673ad7d727c1760008f0e3a3
😎 Deploy Preview https://deploy-preview-1246--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-5047/groupchannel-migration branch from 0fd6afd to 7f4737e Compare November 8, 2024 08:25
Copy link
Collaborator

@chrisallo chrisallo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@AhyoungRyu AhyoungRyu merged commit 2f69bd5 into feat/state-mgmt-migration-1 Nov 19, 2024
10 checks passed
@AhyoungRyu AhyoungRyu deleted the feat/CLNP-5047/groupchannel-migration branch November 19, 2024 02:42
AhyoungRyu added a commit that referenced this pull request Dec 2, 2024
…ern (#1246)

Addresses https://sendbird.atlassian.net/browse/CLNP-5047

This PR migrates the GroupChannelProvider to use a new state management
pattern. This change introduces a more predictable and maintainable way
to manage channel state while maintaining backward compatibility.

- Introduced new store-based state management
- Separated concerns between state management and event handling
- Added `useGroupChannel` hook for accessing state and actions
- Optimized performance with proper memoization

Old pattern:
```typescript
const { someState, someHandler } = useGroupChannelContext();
```
New pattern:
```typescript
// For state and actions
const { state, actions } = useGroupChannel();

// For handlers and props (backward compatibility)
const { someHandler } = useGroupChannelContext();
```

- More predictable state updates
- Better separation of concerns
- Enhanced performance through optimized renders

- All existing functionality remains unchanged
- Added tests for new hooks and state management
- Verified backward compatibility
- Tested with real-time updates and message handling

- [x] useGroupChannelContext is kept for backward compatibility
- [x] Unit & integration tests will be added for new hooks and state
management

Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If unsure, ask the members.
This is a reminder of what we look for before merging your code.

- [x] **All tests pass locally with my changes**
- [x] **I have added tests that prove my fix is effective or that my
feature works**
- [ ] **Public components / utils / props are appropriately exported**
- [ ] I have added necessary documentation (if appropriate)
HoonBaek pushed a commit that referenced this pull request Dec 3, 2024
…ern (#1246)

Addresses https://sendbird.atlassian.net/browse/CLNP-5047

This PR migrates the GroupChannelProvider to use a new state management
pattern. This change introduces a more predictable and maintainable way
to manage channel state while maintaining backward compatibility.

- Introduced new store-based state management
- Separated concerns between state management and event handling
- Added `useGroupChannel` hook for accessing state and actions
- Optimized performance with proper memoization

Old pattern:
```typescript
const { someState, someHandler } = useGroupChannelContext();
```
New pattern:
```typescript
// For state and actions
const { state, actions } = useGroupChannel();

// For handlers and props (backward compatibility)
const { someHandler } = useGroupChannelContext();
```

- More predictable state updates
- Better separation of concerns
- Enhanced performance through optimized renders

- All existing functionality remains unchanged
- Added tests for new hooks and state management
- Verified backward compatibility
- Tested with real-time updates and message handling

- [x] useGroupChannelContext is kept for backward compatibility
- [x] Unit & integration tests will be added for new hooks and state
management

Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If unsure, ask the members.
This is a reminder of what we look for before merging your code.

- [x] **All tests pass locally with my changes**
- [x] **I have added tests that prove my fix is effective or that my
feature works**
- [ ] **Public components / utils / props are appropriately exported**
- [ ] I have added necessary documentation (if appropriate)
AhyoungRyu added a commit that referenced this pull request Dec 11, 2024
…ern (#1246)

Addresses https://sendbird.atlassian.net/browse/CLNP-5047

This PR migrates the GroupChannelProvider to use a new state management
pattern. This change introduces a more predictable and maintainable way
to manage channel state while maintaining backward compatibility.

- Introduced new store-based state management
- Separated concerns between state management and event handling
- Added `useGroupChannel` hook for accessing state and actions
- Optimized performance with proper memoization

Old pattern:
```typescript
const { someState, someHandler } = useGroupChannelContext();
```
New pattern:
```typescript
// For state and actions
const { state, actions } = useGroupChannel();

// For handlers and props (backward compatibility)
const { someHandler } = useGroupChannelContext();
```

- More predictable state updates
- Better separation of concerns
- Enhanced performance through optimized renders

- All existing functionality remains unchanged
- Added tests for new hooks and state management
- Verified backward compatibility
- Tested with real-time updates and message handling

- [x] useGroupChannelContext is kept for backward compatibility
- [x] Unit & integration tests will be added for new hooks and state
management

Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If unsure, ask the members.
This is a reminder of what we look for before merging your code.

- [x] **All tests pass locally with my changes**
- [x] **I have added tests that prove my fix is effective or that my
feature works**
- [ ] **Public components / utils / props are appropriately exported**
- [ ] I have added necessary documentation (if appropriate)
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