Skip to content

Conversation

@duyhungtnn
Copy link
Collaborator

@duyhungtnn duyhungtnn commented Nov 18, 2025

Fix #10

This PR adds support for React 19 to the Bucketeer React Client SDK while maintaining backward compatibility with React 18.2.0+. The changes modernize the SDK's configuration and replace the exported BucketeerContext with a new useBucketeerClient hook as the recommended public API.

  • Updated React and TypeScript dependencies to support React 19
  • Added useBucketeerClient hook to replace direct context usage
  • Updated peer dependencies to support React 18.2.0 through 19.x
  • Enhanced CI/CD pipeline to test against both React 18 and 19
  • Change moduleResolution to bundler

Breaking changes

  • Hide BucketeerContext from public API to prevent compile error for a project that use React 18

Replaced BucketeerContext usage with the new useBucketeerClient hook in example components and tests for improved API consistency. Updated React, React DOM, and related type dependencies to latest versions in package.json and lock files. Added 'react/jsx-runtime' to Rollup externals for compatibility with React 18+. Upgraded Rollup and related plugins to latest versions.
Renamed the hook and its exports from useBKTClient to useBucketeerClient for clarity and consistency. Updated README to document useBucketeerClient and revised usage examples. Added tests for useBucketeerClient. Updated peer dependencies to require @bucketeer/js-client-sdk >=2.4.0 and adjusted React version ranges.
Introduces matrix testing for React 18 and 19 in E2E workflow, adds install scripts for both React versions, and updates example dependencies to React 18.3.1. Also refactors rollup config formatting and cleans up unused exports in src/index.ts.
@duyhungtnn duyhungtnn requested a review from Copilot November 19, 2025 07:45
Copilot finished reviewing on behalf of duyhungtnn November 19, 2025 07:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for React 19 to the Bucketeer React Client SDK while maintaining backward compatibility with React 18.2.0+. The changes modernize the SDK's configuration and replace the exported BucketeerContext with a new useBucketeerClient hook as the recommended public API.

  • Updated React and TypeScript dependencies to support React 19
  • Added useBucketeerClient hook to replace direct context usage
  • Updated peer dependencies to support React 18.2.0 through 19.x
  • Enhanced CI/CD pipeline to test against both React 18 and 19

Reviewed Changes

Copilot reviewed 19 out of 21 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/hooks/useBucketeerClient.ts New hook to access the Bucketeer client instance
src/hooks/useBucketeerClient.test.tsx Comprehensive test coverage for the new hook
src/index.ts Replaced exported context with new hook
package.json Updated peer dependencies and moved js-client-sdk to peer
tsconfig.json Updated to ESNext target and bundler module resolution
rollup.config.js Added react/jsx-runtime to externals for React 19 support
.github/workflows/e2e.yml Added matrix strategy to test React 18 and 19
example/install_react_19.sh Script to install React 19 for testing
example/install_react_18.sh Script to switch back to React 18
README.md Updated documentation to reflect new API and React 19 support
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Changed useBucketeerClient to return BKTClient or null instead of always BKTClient, updated README to reflect this, and removed unnecessary useMemo usage. Also fixed comments in React install scripts for clarity.
@duyhungtnn duyhungtnn requested a review from cre8ivejp November 19, 2025 08:10
@duyhungtnn duyhungtnn marked this pull request as ready for review November 19, 2025 08:10
@cre8ivejp cre8ivejp changed the title feat: support react 19 feat!: support react 19 Nov 20, 2025
Copy link
Member

@cre8ivejp cre8ivejp left a comment

Choose a reason for hiding this comment

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

Thank you so much 🎉

@cre8ivejp cre8ivejp merged commit aabff35 into main Nov 20, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support react 19

3 participants