Repository navigation
Preserve class-based API configuration in React options - #215
Open
sylvesterkaczmarek wants to merge 1 commit into
Open
sylvesterkaczmarek wants to merge 1 commit into
sylvesterkaczmarek wants to merge 1 commit into
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
This branch has not been deployed
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.
Problem
The React options wrapper recursively copies every object into a plain object, although its equality check already treats non-plain objects by identity. A structurally valid class-based HostedApiConfig consequently loses its prototype
getClientSecretmethod and private state before it reaches the component.Change
Traverse only plain objects and arrays when creating the latest-function wrappers. Retain other object instances by reference, consistent with the existing comparison policy. Nested functions in plain option objects continue to resolve through the latest options. Add a patch changeset; no dependencies or public types change.
Validation
CI=1 pnpm checkpassed formatting, lint, type checks, documentation generation, and tests.git diff --checkpasses.Node 26.8.1 and Vitest 3.2.4 on macOS arm64. Tests exercise the production option-shaping helper with synthetic configurations. No live authentication, hosted ChatKit, or browser session was used. This does not expand the public options schema or change listener timing.
Reproduced against
22613848a656077a408788f028c7727e38d10449.