feat( react-sdk/vue-sdk): logger precedence browser dependents#542
Merged
feat( react-sdk/vue-sdk): logger precedence browser dependents#542
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for passing a custom logger into the React and Vue SDK providers, and ensures the custom logger takes precedence over debug mode (which otherwise uses console).
Changes:
- Add a
loggerprop to React/Vue providers and thread it into client initialization with precedence overdebug. - Update internal
useReflagClienthelpers to accept{ debug, logger }in the init options object and apply the precedence rule. - Add/adjust tests and README docs to cover/describe the new behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vue-sdk/test/usage.test.ts | Adds Vue tests asserting logger is used and overrides debug. |
| packages/vue-sdk/src/types.ts | Introduces logger?: Logger to provider props and omits logger from init-options passthrough types. |
| packages/vue-sdk/src/hooks.ts | Updates useReflagClient to accept debug/logger in options and apply logger ?? (debug ? console : undefined). |
| packages/vue-sdk/src/ReflagProvider.vue | Passes debug and logger into useReflagClient. |
| packages/vue-sdk/src/ReflagBootstrappedProvider.vue | Passes debug and logger into useReflagClient for bootstrapped usage. |
| packages/vue-sdk/README.md | Documents logger prop and precedence over debug. |
| packages/react-sdk/test/usage.test.tsx | Adds React tests asserting logger is used and overrides debug. |
| packages/react-sdk/src/index.tsx | Adds logger prop typing + threads logger into client creation with precedence over debug. |
| packages/react-sdk/README.md | Documents logger prop and precedence over debug. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.