From 5836445c5c92474055a5a57ba546676301ee17b8 Mon Sep 17 00:00:00 2001 From: Sam Stern Date: Thu, 12 Aug 2021 12:55:19 -0400 Subject: [PATCH] Perf initialize snippets --- perf-next/index.js | 4 +++- perf/index.js | 2 ++ snippets/perf-next/index/perf_imports.js | 10 ++++++++++ snippets/perf-next/index/perf_initialize.js | 3 --- 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 snippets/perf-next/index/perf_imports.js diff --git a/perf-next/index.js b/perf-next/index.js index 20f9b4f4..892f2b7e 100644 --- a/perf-next/index.js +++ b/perf-next/index.js @@ -4,10 +4,12 @@ const perf = getInstance(); function intialize() { - // [START perf_initialize] + // [START perf_imports] const { initializeApp } = require("firebase/app"); const { getPerformance } = require("firebase/performance"); + // [END perf_imports] + // [START perf_initialize] // TODO: Replace the following with your app's Firebase project configuration // See: https://firebase.google.com/docs/web/setup#config-object const firebaseConfig = { diff --git a/perf/index.js b/perf/index.js index 6d512e32..e4b46286 100644 --- a/perf/index.js +++ b/perf/index.js @@ -1,5 +1,7 @@ +// [START perf_imports] import firebase from "firebase/app"; import "firebase/performance"; +// [END perf_imports] const perf = firebase.performance(); diff --git a/snippets/perf-next/index/perf_imports.js b/snippets/perf-next/index/perf_imports.js new file mode 100644 index 00000000..83e0205f --- /dev/null +++ b/snippets/perf-next/index/perf_imports.js @@ -0,0 +1,10 @@ +// This snippet file was generated by processing the source file: +// ./perf-next/index.js +// +// To update the snippets in this file, edit the source and then run +// 'npm run snippets'. + +// [START perf_imports_modular] +import { initializeApp } from "firebase/app"; +import { getPerformance } from "firebase/performance"; +// [END perf_imports_modular] \ No newline at end of file diff --git a/snippets/perf-next/index/perf_initialize.js b/snippets/perf-next/index/perf_initialize.js index 3b87e9c8..6d0e6657 100644 --- a/snippets/perf-next/index/perf_initialize.js +++ b/snippets/perf-next/index/perf_initialize.js @@ -5,9 +5,6 @@ // 'npm run snippets'. // [START perf_initialize_modular] -import { initializeApp } from "firebase/app"; -import { getPerformance } from "firebase/performance"; - // TODO: Replace the following with your app's Firebase project configuration // See: https://firebase.google.com/docs/web/setup#config-object const firebaseConfig = {