-
Notifications
You must be signed in to change notification settings - Fork 0
feat!: support react 19 #9
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
Conversation
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.
There was a problem hiding this 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
useBucketeerClienthook 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.
cre8ivejp
left a comment
There was a problem hiding this 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 🎉
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
BucketeerContextwith a newuseBucketeerClienthook as the recommended public API.moduleResolutiontobundlerBreaking changes
BucketeerContextfrom public API to prevent compile error for a project that use React 18