-
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
Add the ability to preload a query outside of React #11412
Conversation
🦋 Changeset detectedLatest commit: 937ddda 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 |
64b23a0
to
642247c
Compare
size-limit report 📦
|
This ends up as a weird bundling change - either the |
I'm suggesting a couple of added diff --git a/config/inlineInheritDoc.ts b/config/inlineInheritDoc.ts
index 5222dafde..5c94a5336 100644
--- a/config/inlineInheritDoc.ts
+++ b/config/inlineInheritDoc.ts
@@ -128,7 +128,11 @@ function processComments() {
const sourceFiles = project.addSourceFilesAtPaths("dist/**/*.d.ts");
for (const file of sourceFiles) {
file.forEachDescendant((node) => {
- if (Node.isPropertySignature(node)) {
+ if (
+ Node.isPropertySignature(node) ||
+ Node.isMethodSignature(node) ||
+ Node.isCallSignatureDeclaration(node)
+ ) {
const docsNode = node.getJsDocs()[0];
if (!docsNode) return;
const oldText = docsNode.getInnerText(); |
Some more thoughts:
|
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.
This is looking very good, just some minor nits left! (And those can also be follow-ups!)
Co-authored-by: Lenz Weber-Tronic <[email protected]>
Co-authored-by: Lenz Weber-Tronic <[email protected]>
We need to make sure #11426 makes it into |
Adds the ability to preload a query outside of React to begin fetching as early as possible. To utilize this capability, you first create a preload function that accepts a
client
as input. Then call this function with a query and variables/options to create a query ref. This can then be passed touseReadQuery
which will suspend until the data is loaded and respond with cache updates.This API was created with React Router
loader
functions in mind. This unlocks the possibility of fetching data inside loader functions without the tradeoff of missing cache updates in your query components.One super power of React Router is that it can leave your old UI up while the new one is loading. This is done by simply using the
await
keyword inside of yourloader
. To take advantage of this functionality,queryRef
now has the capability toawait
its promise.