docs: fix broken code snippets in product guides - #3732
Open
armando-navarro wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
appConfigobject literal with}(was})) in the App Check, Auth, Database, Functions, Messaging, Remote Config, Storage, and Performance guides.ApplicationConfigin everyappConfigsample so the type annotation resolves.getApp, which the sample calls.export Interfacetoexport interface(twice), importObservablefrom rxjs, and importCollectionReferenceandDocumentReference.@NgModuleemulator and multiple-instance samples with the standaloneappConfigform the rest of the guides teach, and inline the Firebase config instead of readingenvironment.firebase, which the currentng addsetup does not generate.FcmServiceexample (declaremessage$, move its assignment into the constructor, makedeleteTokenasync) 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
yarn install,yarn testrun successfully?: not applicable, no code changedFixes #3731
Refs #3369