From ca57fef740c1cc2fbce6f8e1f903e52372e5b299 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 13 Feb 2025 14:17:05 -0800 Subject: [PATCH 1/5] Fixed issue where react apps were causing a crash due to improper prompt setup --- src/init/features/dataconnect/sdk.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/init/features/dataconnect/sdk.ts b/src/init/features/dataconnect/sdk.ts index bce8a0ecd85..5a613857358 100644 --- a/src/init/features/dataconnect/sdk.ts +++ b/src/init/features/dataconnect/sdk.ts @@ -116,24 +116,30 @@ async function askQuestions(setup: Setup, config: Config): Promise { ); if (targetPlatform === Platform.WEB) { const unusedFrameworks = SUPPORTED_FRAMEWORKS.filter( - (framework) => newConnectorYaml!.generate?.javascriptSdk![framework], + (framework) => !newConnectorYaml!.generate?.javascriptSdk![framework], ); if (unusedFrameworks.length > 0) { - const additionalFrameworks: { features: (keyof SupportedFrameworks)[] } = await prompt( + const additionalFrameworks: { fdcFrameworks: (keyof SupportedFrameworks)[] } = await prompt( setup, [ { type: "checkbox", - name: "features", + name: "fdcFrameworks", message: "Which framework would you like to generate SDKs for? " + "Press Space to select features, then Enter to confirm your choices.", - choices: unusedFrameworks, + choices: unusedFrameworks.map((frameworkStr) => ({ + value: frameworkStr, + name: frameworkStr, + checked: false, + })), }, ], ); - for (const framework of additionalFrameworks.features) { - newConnectorYaml!.generate!.javascriptSdk![framework] = true; + if (additionalFrameworks.fdcFrameworks) { + for (const framework of additionalFrameworks.fdcFrameworks) { + newConnectorYaml!.generate!.javascriptSdk![framework] = true; + } } } } From 60d1bdff112b1477f836854cdb277460d3753a6c Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 13 Feb 2025 14:33:45 -0800 Subject: [PATCH 2/5] Updated changelog and emulators --- CHANGELOG.md | 2 ++ src/emulator/downloadableEmulators.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69de29bb2d..22bcd345dc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +- Data Connect: Fixed issue where react-based web apps were crashing when users initialize Data Connect. +- Data Connect: Fixed issue where users who are using a version lower than 11.3.0 of `firebase` get a "missing import" error. \ No newline at end of file diff --git a/src/emulator/downloadableEmulators.ts b/src/emulator/downloadableEmulators.ts index bcb2ea15791..7c52ff2515c 100755 --- a/src/emulator/downloadableEmulators.ts +++ b/src/emulator/downloadableEmulators.ts @@ -57,22 +57,22 @@ const EMULATOR_UPDATE_DETAILS: { [s in DownloadableEmulators]: EmulatorUpdateDet expectedChecksum: "a9025b3e53fdeafd2969ccb3ba1e1d38", }, dataconnect: - process.platform === "darwin" + process.platform === "darwin" // macos ? { - version: "1.8.0", + version: "1.8.1", expectedSize: 25469696, - expectedChecksum: "d20a4240b4290a262caff3d0d3a85a4f", + expectedChecksum: "dc8b5c38838ebe667e2e93c51c14578a", } - : process.platform === "win32" + : process.platform === "win32" // windows ? { - version: "1.8.0", - expectedSize: 25903616, - expectedChecksum: "dda0350259449493ecc5cc24187ce752", + version: "1.8.1", + expectedSize: 25904128, + expectedChecksum: "4ba969a49ade413c3f68f5bb0287af22", } : { - version: "1.8.0", + version: "1.8.1", // linux expectedSize: 25383064, - expectedChecksum: "54a19e336f4118854c4c2d4eeeccb506", + expectedChecksum: "1117c1c3cc0fca725dd7a869c1d2e90f", }, }; From 93c8b3a13aca6f1550d71b4f42e0b04e2e44b206 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 13 Feb 2025 14:36:44 -0800 Subject: [PATCH 3/5] Updated changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 22bcd345dc3..08a4881236e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,3 @@ -- Data Connect: Fixed issue where react-based web apps were crashing when users initialize Data Connect. -- Data Connect: Fixed issue where users who are using a version lower than 11.3.0 of `firebase` get a "missing import" error. \ No newline at end of file +- Fixed issue where react-based web apps were crashing when users initialize Data Connect. +- Updated the Firebase Dat Connect local toolkit to v.1.8.0, which: + - Fixed issue where users who are using a version lower than 11.3.0 of `firebase` get a "missing import" error. \ No newline at end of file From 86a2ec068af6d42076b6ce7f912b0aaa033dc493 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 13 Feb 2025 14:44:36 -0800 Subject: [PATCH 4/5] Fixed formatting --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08a4881236e..a1564fa3326 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ - Fixed issue where react-based web apps were crashing when users initialize Data Connect. - Updated the Firebase Dat Connect local toolkit to v.1.8.0, which: - - Fixed issue where users who are using a version lower than 11.3.0 of `firebase` get a "missing import" error. \ No newline at end of file + - Fixed issue where users who are using a version lower than 11.3.0 of `firebase` get a "missing import" error. From a74ddcf0edb985056c95f39e5929f9849a871a93 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Thu, 13 Feb 2025 14:49:03 -0800 Subject: [PATCH 5/5] Addressed comments --- CHANGELOG.md | 4 ++-- src/init/features/dataconnect/sdk.ts | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1564fa3326..4c7557c6f03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -- Fixed issue where react-based web apps were crashing when users initialize Data Connect. -- Updated the Firebase Dat Connect local toolkit to v.1.8.0, which: +- Fixed issue where `firebase init dataconnect` would crash on React-based web apps. +- Updated the Firebase Data Connect local toolkit to v.1.8.1, which: - Fixed issue where users who are using a version lower than 11.3.0 of `firebase` get a "missing import" error. diff --git a/src/init/features/dataconnect/sdk.ts b/src/init/features/dataconnect/sdk.ts index 5a613857358..cb852db0311 100644 --- a/src/init/features/dataconnect/sdk.ts +++ b/src/init/features/dataconnect/sdk.ts @@ -136,10 +136,8 @@ async function askQuestions(setup: Setup, config: Config): Promise { }, ], ); - if (additionalFrameworks.fdcFrameworks) { - for (const framework of additionalFrameworks.fdcFrameworks) { - newConnectorYaml!.generate!.javascriptSdk![framework] = true; - } + for (const framework of additionalFrameworks.fdcFrameworks) { + newConnectorYaml!.generate!.javascriptSdk![framework] = true; } } }