Skip to content
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

chore(core): Refactor core code and remove modifiable Client options #2619

Merged
merged 9 commits into from
Aug 18, 2022

Conversation

kitten
Copy link
Member

@kitten kitten commented Aug 18, 2022

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 leaves Client.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 the Client has been created.

This further builds on and encourages use of #2610. (setContextExchange). We could further consider deprecating fetchOptions, but I see that as too extreme, really.

Set of changes

  • Remove Client.createOperationContext
  • Remove on-client options that are modifiable copies of ClientOptions inputs
  • Reformat ssrExchange, fetchExchange, fetchOptions, and fetchSource slightly
  • Reference Symbol.asyncIterator directly in fetchSource as symbols are in our ES2015 scope
  • Reformat CombinedError code
  • Reformat and refactor maskTypename

@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2022

🦋 Changeset detected

Latest commit: 3844031

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@urql/core Major
@urql/preact Patch
urql Patch
@urql/svelte Patch
@urql/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kitten kitten changed the title chore(core): Refactor core code and remove redundant Client options chore(core): Refactor core code and remove modifiable Client options Aug 18, 2022
@kitten kitten merged commit c5c6cf0 into main Aug 18, 2022
@kitten kitten deleted the chore/shed-bytes-2 branch August 18, 2022 11:39
@urql-ci urql-ci mentioned this pull request Aug 18, 2022
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.

2 participants