chore(core): Refactor core code and remove modifiable Client options #2619
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.
Follow-up to #2611
Summary
This refactors multiple parts of the core package, further reducing size (*.min.mjs) by -100B gzip'd down to nice and round 6kB.
This contains a breaking change (see changeset)
This pull request finally removes options on the
Client
and only leavesClient.suspense
around, which we're using internally and may be needed for some other React functionality.It removes all other options, like
url
,fetch
,fetchOptions
, and so on, which are now constant and not modifiable after theClient
has been created.This further builds on and encourages use of #2610. (
setContextExchange
). We could further consider deprecatingfetchOptions
, but I see that as too extreme, really.Set of changes
Client.createOperationContext
ClientOptions
inputsssrExchange
,fetchExchange
,fetchOptions
, andfetchSource
slightlySymbol.asyncIterator
directly infetchSource
as symbols are in our ES2015 scopeCombinedError
codemaskTypename