René's URL Explorer Experiment


Title: Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twice · Issue #3757 · angular/angularfire · GitHub

Open Graph Title: Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twice · Issue #3757 · angular/angularfire

X Title: Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twice · Issue #3757 · angular/angularfire

Description: Summary An Angular app rendering on the server fetches Firestore data, renders the page with it, sends that HTML to the browser, and then fetches the same documents a second time when the app starts. Angular already solves this for its o...

Open Graph Description: Summary An Angular app rendering on the server fetches Firestore data, renders the page with it, sends that HTML to the browser, and then fetches the same documents a second time when the app start...

X Description: Summary An Angular app rendering on the server fetches Firestore data, renders the page with it, sends that HTML to the browser, and then fetches the same documents a second time when the app start...

Opengraph URL: https://github.com/angular/angularfire/issues/3757

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Use `TransferState` to hand server-rendered Firestore data to the browser, instead of reading every document twice","articleBody":"### Summary\n\nAn Angular app rendering on the server fetches Firestore data, renders the page with it, sends that HTML to the browser, and then fetches the same documents a second time when the app starts.\n\n- Angular already solves this for its own HTTP client. The server's responses go into the page and the browser reads them back instead of repeating the request.\n- Nothing does that for Firestore. `TransferState` appears in `src/` only in the legacy compat storage pipe.\n- Apps therefore write the handoff themselves, once per component, or accept the second read.\n\nThis proposes an opt-in transfer layer for Firestore reads.\n\n### What users hit today\n\n- The server-rendered content disappears for 319 to 506 ms after the app starts, until the browser's own read returns.\n- Every document read on the server is read again in the browser, so a page costs two reads per document rather than one.\n- The workaround is to write it by hand per component. The sample app in this repo does exactly that in five components, two of them Firestore reads, and [#3323](https://github.com/angular/angularfire/issues/3323) is eight comments of people doing the same thing with mixed results.\n\n### What is proposed\n\nAn app adds `provideFirestoreTransfer()` and marks the reads it wants transferred:\n\n- `docData(ref, { transfer: true })` stores the document's values on the server and emits them in the browser as the read's first value, so the rendered content stays on screen.\n- `collectionData(query, { transfer: true })` stores the query's serialized snapshot (`QuerySnapshot.toJSON()`), which carries the query itself, and the browser rebuilds a real snapshot from it with `querySnapshotFromJSON`.\n- Reads without the option, and every read in an app that does not add the provider, behave exactly as they do now.\n\nFor a query with no `limit` clause, the browser then attaches its listener with `onSnapshotResume`, which asks the backend for changes since the server's read rather than for the documents again. That is what removes the second read.\n\n### What this will not do\n\n- A query **with** a `limit` clause keeps its second read. Resuming a limited query makes the backend re-send the whole result set, which measured worse than not transferring at all, so the library will transfer the data for the first paint and attach an ordinary listener. Whether resume can support limited queries is a question for the Firestore team.\n- Aggregate reads such as `getCountFromServer` cannot participate, because their results have no public serialized form.\n- A read of a document that does not exist is skipped. There is no value to put in the page, and Firestore's serialized form for a missing document throws when the browser tries to rebuild it.\n- A `limitToLast` query is skipped. The serialized query does not record that the limit counted from the end, so the browser would rebuild a query that no longer matches the one the app is running, and the documents would come back in the wrong order.\n- Data read during a server render that is signed in as the visitor belongs to that visitor, and putting it in the HTML is a hazard wherever that HTML gets cached. The library will warn in development when this happens, and the documentation will cover it.\n\n### Earlier attempts in this repo\n\n- [#1225](https://github.com/angular/angularfire/issues/1225) asked for this in 2017.\n- [#2018](https://github.com/angular/angularfire/pull/2018) built an experimental version in 2019 and was closed in favor of exploring Firestore bundles, which is the serialized form the query half of this proposal now uses.\n- [#1547](https://github.com/angular/angularfire/pull/1547) was the same idea for the Realtime Database and was also left unfinished.\n\n### The same gap exists outside Firestore\n\nThe gap is library-wide rather than Firestore-only. Firestore is proposed first for three reasons:\n\n- Its values include types that plain JSON loses, such as `Timestamp` and `DocumentReference`.\n- Its queries carry no obvious identity for the browser to match a transferred value against.\n- Its reads are billed per document, so the second read has a direct cost.\n\nRealtime Database and Storage are simpler on all three counts, since their values are already JSON or a plain string and the path identifies the read. Both should be able to reuse whatever this builds, and each is worth its own PR rather than being folded into this one.\n\nIf you are hitting this today, saying which reads and whether your queries are paginated would help, since the paginated case is the one with an open constraint above.","author":{"url":"https://github.com/armando-navarro","@type":"Person","name":"armando-navarro"},"datePublished":"2026-08-31T18:35:31Z","url":"https://github.com/angular/angularfire/issues/3757"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3d1df738-0909-22e4-097f-db16dbd7423f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC6B6:30BA3B:6D1E05:8B2C20:6B0356C4
html-safe-nonce4b31d9e405c1ee86f9eddd72e985632a10b1fbae5c0be8741e1fee851c9be816
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNkI2OjMwQkEzQjo2RDFFMDU6OEIyQzIwOjZCMDM1NkM0IiwidmlzaXRvcl9pZCI6IjczMDUwOTQzMTk3NDMxMjkyODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf218e55f46dec2d8e15f209c1dae96ebb1525b525af6cc26e9fcf55f2d388ef9
hovercard-subject-tagissue:5303585544
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angularfire/3757/issue_layout
twitter:imagehttps://opengraph.githubassets.com/57c814656fb50ac9c60f2f3cfc5ad526a37acd4bda893470cc2d307251f30618/angular/angularfire/issues/3757
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/57c814656fb50ac9c60f2f3cfc5ad526a37acd4bda893470cc2d307251f30618/angular/angularfire/issues/3757
og:image:altSummary An Angular app rendering on the server fetches Firestore data, renders the page with it, sends that HTML to the browser, and then fetches the same documents a second time when the app start...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamearmando-navarro
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/angular/angularfire git https://github.com/angular/angularfire.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id49453413
octolytics-dimension-repository_nwoangular/angularfire
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49453413
octolytics-dimension-repository_network_root_nwoangular/angularfire
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angularfire/issues/3757#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fissues%2F3757
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangularfire%2Fissues%2F3757
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangularfire
Reloadhttps://github.com/angular/angularfire/issues/3757
Reloadhttps://github.com/angular/angularfire/issues/3757
Reloadhttps://github.com/angular/angularfire/issues/3757
angularhttps://github.com/angular
angularfirehttps://github.com/angular/angularfire
Codehttps://github.com/angular/angularfire
Issues162 (162)https://github.com/angular/angularfire/issues
Pull requests5 (5)https://github.com/angular/angularfire/pulls
Discussionshttps://github.com/angular/angularfire/discussions
Actionshttps://github.com/angular/angularfire/actions
Projectshttps://github.com/angular/angularfire/projects
Security and qualityhttps://github.com/angular/angularfire/security
Insightshttps://github.com/angular/angularfire/insights
https://github.com/angular/angularfire
New issuehttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3757
New issuehttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3757
Enhancementhttps://github.com/angular/angularfire/issues?q=type:"Enhancement"
Use TransferState to hand server-rendered Firestore data to the browser, instead of reading every document twicehttps://github.com/angular/angularfire/issues/3757#top
https://github.com/armando-navarro
comp: firestoreCloud Firestore (src/firestore).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20firestore%22
comp: ssrServer-side rendering, hydration, @angular/ssr interop.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20ssr%22
priority: P0 (critical)Data loss, security, or broad breakage with no workaround.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22priority%3A%20P0%20(critical)%22
type: featureNew capability or enhancement.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
version: current (v17+)Targets the current modular API (v17+).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22version%3A%20current%20(v17%2B)%22
https://github.com/armando-navarro
armando-navarrohttps://github.com/armando-navarro
on Aug 31, 2026https://github.com/angular/angularfire/issues/3757#issue-5303585544
#3323https://github.com/angular/angularfire/issues/3323
#1225https://github.com/angular/angularfire/issues/1225
#2018https://github.com/angular/angularfire/pull/2018
#1547https://github.com/angular/angularfire/pull/1547
armando-navarrohttps://github.com/armando-navarro
on Aug 31, 2026https://github.com/angular/angularfire/issues/3757#event-30298131094
armando-navarrohttps://github.com/armando-navarro
comp: firestoreCloud Firestore (src/firestore).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20firestore%22
comp: ssrServer-side rendering, hydration, @angular/ssr interop.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20ssr%22
type: featureNew capability or enhancement.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
version: current (v17+)Targets the current modular API (v17+).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22version%3A%20current%20(v17%2B)%22
priority: P0 (critical)Data loss, security, or broad breakage with no workaround.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22priority%3A%20P0%20(critical)%22
on Aug 31, 2026https://github.com/angular/angularfire/issues/3757#event-30298141411
armando-navarrohttps://github.com/armando-navarro
Enhancementhttps://github.com/angular/angularfire/issues?q=type:"Enhancement"
on Sep 2, 2026https://github.com/angular/angularfire/issues/3757#event-30443412717
armando-navarrohttps://github.com/armando-navarro
on Sep 21, 2026https://github.com/angular/angularfire/issues/3757#event-31558245530
build: require Angular 21.2 and compile with its toolchain (#3763)https://github.com/angular/angularfire/commit/345726a6efb2c4e5d0620604b9e2f23fbc116fd7
#3763https://github.com/angular/angularfire/pull/3763
345726ahttps://github.com/angular/angularfire/commit/345726a6efb2c4e5d0620604b9e2f23fbc116fd7
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angularfire/issues/3757
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angularfire/issues/3757
armando-navarrohttps://github.com/armando-navarro
comp: firestoreCloud Firestore (src/firestore).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20firestore%22
comp: ssrServer-side rendering, hydration, @angular/ssr interop.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22comp%3A%20ssr%22
priority: P0 (critical)Data loss, security, or broad breakage with no workaround.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22priority%3A%20P0%20(critical)%22
type: featureNew capability or enhancement.https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22type%3A%20feature%22
version: current (v17+)Targets the current modular API (v17+).https://github.com/angular/angularfire/issues?q=state%3Aopen%20label%3A%22version%3A%20current%20(v17%2B)%22
Enhancementhttps://github.com/angular/angularfire/issues?q=type:"Enhancement"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.