-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
feat(hydration): dehydrate.serialize
and hydrate.deserialize
#7615
feat(hydration): dehydrate.serialize
and hydrate.deserialize
#7615
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit eb19eab. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 1 targetSent with 💌 from NxCloud. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit eb19eab:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7615 +/- ##
===========================================
+ Coverage 43.98% 62.47% +18.49%
===========================================
Files 185 125 -60
Lines 7043 4504 -2539
Branches 1544 1248 -296
===========================================
- Hits 3098 2814 -284
+ Misses 3579 1459 -2120
+ Partials 366 231 -135 |
HydrateOptions.transformData
to restore resolved prefetchesdehydrate.serialize
and hydrate.deserialize
Note
Given that the feature is brand new and there were likely not many people using it, combined with it not really working to begin with, we have decided to make a breaking change and replace
transformPromise
withserialize
/deserialize
.When a query gets resolved on the server before we dehydrate, the dehydrated query will contain the serialized data, but the
transformPromise
function will never run to deserialize it, leading to serialized data being put in the query cache:You can simulate the failing behavior like this:
To solve this, I've (as discussed) replaced the
transformPromise
option withtransformData
and added the transformation step to the other necessary places as well