Skip to content

docs: fix broken code snippets in product guides - #3732

Open
armando-navarro wants to merge 1 commit into
angular:mainfrom
armando-navarro:docs-product-snippet-fixes
Open

docs: fix broken code snippets in product guides#3732
armando-navarro wants to merge 1 commit into
angular:mainfrom
armando-navarro:docs-product-snippet-fixes

Conversation

@armando-navarro

Copy link
Copy Markdown
Collaborator

Description

Fixes the broken copy-paste code samples in the modular product guides. Each change makes the sample compile or parse as written, so a developer can copy it directly.

  • Close the appConfig object literal with } (was })) in the App Check, Auth, Database, Functions, Messaging, Remote Config, Storage, and Performance guides.
  • Import ApplicationConfig in every appConfig sample so the type annotation resolves.
  • App Check: import getApp, which the sample calls.
  • Firestore: correct export Interface to export interface (twice), import Observable from rxjs, and import CollectionReference and DocumentReference.
  • Auth and Database: replace the @NgModule emulator and multiple-instance samples with the standalone appConfig form the rest of the guides teach, and inline the Firebase config instead of reading environment.firebase, which the current ng add setup does not generate.
  • Messaging: repair the FcmService example (declare message$, move its assignment into the constructor, make deleteToken async) and bump the service-worker CDN imports from 9.22.0 to 12.4.0 to match the firebase dependency.

Documentation only, no source or API changes.

Checklist

Fixes #3731
Refs #3369

Several product-guide snippets did not compile or parse as written, so a
reader copying them hit errors before reaching Firebase.

- Close the appConfig object literal with } instead of }) in the App
  Check, Auth, Database, Functions, Messaging, Remote Config, Storage,
  and Performance guides.
- Import ApplicationConfig in every appConfig snippet so the type
  annotation resolves.
- App Check: import getApp, which the snippet calls.
- Firestore: correct "export Interface" to "export interface" (twice),
  import Observable from rxjs, and import CollectionReference and
  DocumentReference.
- Auth and Database: replace the NgModule emulator and multi-instance
  examples with the standalone appConfig form the rest of the guides
  teach, and inline the Firebase config instead of reading a
  no-longer-generated environment file.
- Messaging: repair the FcmService example (declare message$, move its
  assignment into the constructor, make deleteToken async) and bump the
  service-worker CDN imports from 9.22.0 to 12.4.0 to match the firebase
  dependency.
@armando-navarro armando-navarro added comp: docs Documentation. type: chore Maintenance with no user-facing behavior change. labels Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: docs Documentation. type: chore Maintenance with no user-facing behavior change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: broken code samples in several product guides

1 participant