Repository navigation
docs: fix examples, SSR notes, imports, and typos across guides - #3858
AdamBoczula wants to merge 4 commits into
Conversation
…and document performance RxJS operators
b70614a to
60e262e
Compare
armando-navarro
left a comment
There was a problem hiding this comment.
Hi Adam, thank you for this. Three small things are needed before I can approve, and three more are optional.
1. The compat callable example still does not compile on Angular 22
With the PR's version, ngc reports NG8004: No pipe found with name 'async' at docs/compat/functions/functions.md:64.
Components are standalone by default now, so the template has no async pipe unless the component imports it. To compile cleanly, add:
import { AsyncPipe } from '@angular/common'at the top of the snippet, andimports: [AsyncPipe]to the@Componentatdocs/compat/functions/functions.md:62-65
That matches what you did in the Firestore guide.
This one blocks the approve because Fixes #3210 would close the issue on merge.
2. #3210 also points at one sentence that is still unchanged
The reporter's comment on #3210 flags the sentence at docs/compat/functions/functions.md:76: "It creates a function, which when called creates an Observable, subscribe or convert it to a Promise to initiate the request."
Their suggested wording works for me: "It creates a function, which when called creates an Observable. Subscribe to the Observable or convert it to a Promise to initiate the request."
3. NEW_ORIGIN_BEHAVIOR is still documented on the compat emulators page
You removed the token from the Functions guide, but docs/compat/emulators/emulators.md:120-135 still imports and provides it. I would delete docs/compat/emulators/emulators.md:120-135 entirely.
The Firebase Hosting section of the Functions guide (docs/compat/functions/functions.md:128-171), which you just fixed, already covers ORIGIN.
4. Optional: Writing data now reads as a full replacement
Some inconsistencies remain between two UserProfileComponent code snippets:
docs/firestore.md:181says "we'll update the code" in the sameuser-profile.component.ts, but the snippet atdocs/firestore.md:184-206no longer hasusers$or the constructor.- A reader who replaces the Reading data class with it breaks the Reading data template, which still uses
users$atdocs/firestore.md:159.
A ... line after docs/firestore.md:196, where users$ and the constructor were, would show that the rest of the class stays.
5. Optional: traces reach Firebase only after Performance is injected
The problem:
providePerformancecreates the Performance instance only when something injectsPerformance.- Firebase reads the User Timing measures only once that instance exists.
ItemsComponentatdocs/performance.md:67does not inject it, so in an app where nothing else does, the traces never reach Firebase.
Adding "once Performance has been injected, as shown above" to the sentence at docs/performance.md:59 would cover it. "As shown above" would point at the inject(Performance) example at docs/performance.md:42.
6. Optional: the server-rendering note
docs/app-check.md:51 also says the injected value is null "although its type says AppCheck".
Saying the same in your notes at docs/analytics.md:47 and docs/performance.md:47 tells the reader why the check is needed.
If I got any of this wrong, let me know and I'll take another look.
|
Thanks for the thorough review, @armando-navarro! Applied all six points:
Ready for another look! |
Checklist
yarn install,yarn testrun successfully? not run (Markdown only)Description
Fixes #3210
Cleans up code examples, missing imports, SSR notes, and typos across several documentation guides (kept as three separate commits by topic):
Firestore (
docs/firestore.md)Pipeline operationssnippet intoloadBooksChained()andloadBooksFunctional()soconst pipelineis not redeclared in the same method.AsyncPipeto theReading datacomponent snippet, update the template from*ngForto@for, and fix a typo ("that can we can use").Writing datasnippet sousersCollectionis initialized withwithConverter(userProfileConverter)instead of leavingusersCollectionuninitialized and using a legacy<UserProfile>cast, and fix"the the"..../reference/js/firestore_->.../reference/js/firestore).SSR notes,
ApplicationConfigimports, and Performance RxJS operators (docs/analytics.md,docs/performance.md,docs/ai.md,docs/data-connect.md)import { ApplicationConfig } from '@angular/core';(and fix...,) indocs/analytics.md,docs/ai.md, anddocs/data-connect.md.AnalyticsandPerformancearenullduring server rendering (isPlatformBrowserguard inanalytics.module.ts/performance.module.ts).@angular/fire/performance(traceUntilFirst,traceUntilComplete,traceUntil,traceWhile) indocs/performance.md.Compat Functions (
docs/compat/functions/functions.md, fixes "AngularFireFunctions" documentation has two errors #3210){ data$ | async }->{{ data$ | async }}), declaredata$: Observable<any>, and importObservableso the snippet compiles.compatability,@angular/fire/functions->@angular/fire/compat/functions,AngularFireFunction->AngularFireFunctions,httpCallable->httpsCallablewith its actual signature).NEW_ORIGIN_BEHAVIORtoken from the Hosting integration example and note thatREGIONandORIGINcannot be provided at the same time.