-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
QueryManager.inFlightLinkObservables
: use a strong Trie
#11345
Conversation
🦋 Changeset detectedLatest commit: 7fb21fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
size-limit report 📦
|
@phryneas just to clarify the intent of this change, is this strictly to shave off some bytes from the end build size, or will this have a memory impact as well since the printed query string can now be shared for multiple variables in the |
@jerelmiller This is really just a "shaving off bytes" - the structure was a Map of Maps before and is a Map of Maps (in the form of a Trie) now. Thing is, we add slightly more bundle size as the => Implementation changes, but no observable behaviour will change in any way. That will happen in other places where we will use the new |
@phryneas thats helpful to understand! Appreciate the context here :) |
/release:pr |
A new release has been made for this PR. You can install it with |
/release:pr |
A new release has been made for this PR. You can install it with |
I've fixed up some tests, added a runtime warning if used with oudated versions of Requesting a re-review for that reason :) You can see these changes here: On the other side, I've opened the PR apollographql/apollo-client-nextjs#144 to accommodate for the changes in this PR. Please give it a review, too :) |
// TODO: remove before we release 3.9 | ||
Object.defineProperty(this.inFlightLinkObservables, "get", { | ||
value: () => { | ||
throw new Error( | ||
"This version of Apollo Client requires at least @apollo/experimental-nextjs-app-support version 0.5.2." | ||
); | ||
}, | ||
}); |
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.
You can see this work out over in apollographql/apollo-client-nextjs#144 (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.
Thanks for catching that update to the Next.js package!
Since
@wryware/trie@0.5.0
now has aremove
function, we can use that data structure inQueryManager.inFlightLinkObservables
and shave off a few bytes here.Should not be merged before we have a new
optimism
versionBefore merging/releasing: add handling to
@apollo/experimental-nextjs-app-support
Checklist: