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

0.10.0 (3) switch rehydration mismatch protection to useSyncExternalStore #207

Merged
merged 10 commits into from
Apr 4, 2024

Conversation

phryneas
Copy link
Member

@phryneas phryneas commented Feb 20, 2024

This would have been the right implementation from the start, but we couldn't do it in the beginning because of a bug in the canary version used at that time. Now it seems to be working nicely.

// one rerender with the actual client value (which is hopefull equal)
assert.equal(finishedRenderCount, 2);
assert.equal(finishedRenderCount, 1);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice improvement since it removes a double render that would in reality only be necessary on a server<->client race condition.

}

await testIn("browser")(
"race condition: client ahead of server renders without hydration mismatch",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our first test that directly tests stream rehydration 🎉

@phryneas phryneas added this to the 0.10.0 milestone Feb 27, 2024
Copy link

github-actions bot commented Mar 26, 2024

size-limit report 📦

Path Size
{ ApolloNextAppProvider, NextSSRApolloClient, NextSSRInMemoryCache } from '@apollo/experimental-nextjs-app-support/ssr' (Browser ESM) 7.78 KB (-0.08% 🔽)
{ WrapApolloProvider, ApolloClient, InMemoryCache } from '@apollo/client-react-streaming' (Browser ESM) 1.4 KB (-0.63% 🔽)
{ buildManualDataTransport } from '@apollo/client-react-streaming/manual-transport' (Browser ESM) 6.27 KB (-0.05% 🔽)
@apollo/client-react-streaming (Browser ESM) 2.13 KB (-0.6% 🔽)
@apollo/client-react-streaming (SSR ESM) 1.73 KB (-0.4% 🔽)
@apollo/client-react-streaming (RSC ESM) 1.33 KB (0%)
@apollo/client-react-streaming/manual-transport (Browser ESM) 6.45 KB (-0.13% 🔽)
@apollo/client-react-streaming/manual-transport (SSR ESM) 6.33 KB (-0.1% 🔽)
@apollo/experimental-nextjs-app-support/ssr (Browser ESM) 8.41 KB (-0.07% 🔽)
@apollo/experimental-nextjs-app-support/ssr (SSR ESM) 8.31 KB (-0.18% 🔽)
@apollo/experimental-nextjs-app-support/ssr (RSC ESM) 867 B (0%)
@apollo/experimental-nextjs-app-support/rsc (RSC ESM) 626 B (0%)

Copy link

relativeci bot commented Mar 26, 2024

Job #107: Bundle Size — 1.01MiB (~-0.01%).

1b5a903(current) vs e0b4862 main#104(baseline)

Warning

Bundle contains 1 duplicate package – View duplicate packages

Bundle metrics  Change 2 changes Improvement 1 improvement
                 Current
Job #107
     Baseline
Job #104
Improvement  Initial JS 890.58KiB(~-0.01%) 890.59KiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 21.11% 0.04%
No change  Chunks 24 24
No change  Assets 45 45
No change  Modules 512 512
No change  Duplicate Modules 30 30
No change  Duplicate Code 1.29% 1.29%
No change  Packages 29 29
No change  Duplicate Packages 1 1
Bundle size by type  Change 1 change Improvement 1 improvement
                 Current
Job #107
     Baseline
Job #104
Improvement  JS 1023.84KiB (~-0.01%) 1023.85KiB
Not changed  Other 5.99KiB 5.99KiB

View job #107 reportView pr/uSES branch activityView project dashboard

@phryneas phryneas changed the title switch rehydration mismatch protection to useSyncExternalStore 0.10.0 (3) switch rehydration mismatch protection to useSyncExternalStore Mar 26, 2024
@phryneas phryneas marked this pull request as ready for review March 26, 2024 14:53
@phryneas phryneas requested a review from a team as a code owner March 26, 2024 14:53
document.body.innerHTML,
`<!--$--><div id="user">Future me.</div><div id="parallel">suspending in parallel</div><!--/$-->`
);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super cool 🎉

Copy link
Member

@jerelmiller jerelmiller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

@phryneas phryneas merged commit 100952e into main Apr 4, 2024
16 checks passed
@phryneas phryneas deleted the pr/uSES branch April 4, 2024 10:08
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