Skip to content

docs: fix examples, SSR notes, imports, and typos across guides - #3858

Open
AdamBoczula wants to merge 4 commits into
angular:mainfrom
AdamBoczula:docs/fix-guides-examples-and-notes
Open

AdamBoczula wants to merge 4 commits into
angular:mainfrom
AdamBoczula:docs/fix-guides-examples-and-notes

Conversation

@AdamBoczula

Copy link
Copy Markdown
Contributor

Checklist

  • Issue number for this PR: "AngularFireFunctions" documentation has two errors #3210 (plus additional docs fixes)
  • Docs included?: yes (docs only)
  • Test units included?: no (docs only)
  • Breaking change?: no
  • In a clean directory, yarn install, yarn test run 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):

  1. Firestore (docs/firestore.md)

    • Split the Pipeline operations snippet into loadBooksChained() and loadBooksFunctional() so const pipeline is not redeclared in the same method.
    • Add AsyncPipe to the Reading data component snippet, update the template from *ngFor to @for, and fix a typo ("that can we can use").
    • Fix the Writing data snippet so usersCollection is initialized with withConverter(userProfileConverter) instead of leaving usersCollection uninitialized and using a legacy <UserProfile> cast, and fix "the the".
    • Fix the dead JS SDK reference link (.../reference/js/firestore_ -> .../reference/js/firestore).
  2. SSR notes, ApplicationConfig imports, and Performance RxJS operators (docs/analytics.md, docs/performance.md, docs/ai.md, docs/data-connect.md)

    • Add the missing import { ApplicationConfig } from '@angular/core'; (and fix ...,) in docs/analytics.md, docs/ai.md, and docs/data-connect.md.
    • Note that Analytics and Performance are null during server rendering (isPlatformBrowser guard in analytics.module.ts / performance.module.ts).
    • Document the RxJS trace operators exported from @angular/fire/performance (traceUntilFirst, traceUntilComplete, traceUntil, traceWhile) in docs/performance.md.
  3. Compat Functions (docs/compat/functions/functions.md, fixes "AngularFireFunctions" documentation has two errors #3210)

    • Fix template interpolation ({ data$ | async } -> {{ data$ | async }}), declare data$: Observable<any>, and import Observable so the snippet compiles.
    • Fix typos (compatability, @angular/fire/functions -> @angular/fire/compat/functions, AngularFireFunction -> AngularFireFunctions, httpCallable -> httpsCallable with its actual signature).
    • Remove the removed NEW_ORIGIN_BEHAVIOR token from the Hosting integration example and note that REGION and ORIGIN cannot be provided at the same time.

@AdamBoczula
AdamBoczula force-pushed the docs/fix-guides-examples-and-notes branch from b70614a to 60e262e Compare December 3, 2026 19:12
@armando-navarro armando-navarro added comp: analytics Google Analytics (src/analytics). comp: compat Compatibility layer for the pre-modular API (src/compat). comp: docs Documentation. comp: firestore Cloud Firestore (src/firestore). comp: functions Callable Cloud Functions (src/functions). comp: performance Performance Monitoring (src/performance). comp: ssr Server-side rendering, hydration, @angular/ssr interop. type: chore Maintenance with no user-facing behavior change. labels Dec 3, 2026

@armando-navarro armando-navarro left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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, and
  • imports: [AsyncPipe] to the @Component at docs/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:181 says "we'll update the code" in the same user-profile.component.ts, but the snippet at docs/firestore.md:184-206 no longer has users$ or the constructor.
  • A reader who replaces the Reading data class with it breaks the Reading data template, which still uses users$ at docs/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:

  • providePerformance creates the Performance instance only when something injects Performance.
  • Firebase reads the User Timing measures only once that instance exists.
  • ItemsComponent at docs/performance.md:67 does 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.

@AdamBoczula

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review, @armando-navarro! Applied all six points:

  1. Added import { AsyncPipe } from '@angular/common'; and imports: [AsyncPipe] to AppComponent in docs/compat/functions/functions.md.
  2. Updated the httpsCallable() sentence in docs/compat/functions/functions.md as suggested.
  3. Removed the obsolete NEW_ORIGIN_BEHAVIOR section from docs/compat/emulators/emulators.md.
  4. Added ... in UserProfileComponent under Writing data in docs/firestore.md to show that users$ and the constructor remain.
  5. Updated docs/performance.md to note that Performance must be injected for Firebase to collect the traces, and injected Performance directly in ItemsComponent as well so the snippet works standalone.
  6. Added , although its type says \Analytics` / `Performance`to the SSR notes indocs/analytics.mdanddocs/performance.md`.

Ready for another look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: analytics Google Analytics (src/analytics). comp: compat Compatibility layer for the pre-modular API (src/compat). comp: docs Documentation. comp: firestore Cloud Firestore (src/firestore). comp: functions Callable Cloud Functions (src/functions). comp: performance Performance Monitoring (src/performance). comp: ssr Server-side rendering, hydration, @angular/ssr interop. type: chore Maintenance with no user-facing behavior change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"AngularFireFunctions" documentation has two errors

2 participants