From c0bd3c88616109124b8c7ab53b488587f2558bdc Mon Sep 17 00:00:00 2001 From: Chalo Salvador Date: Tue, 8 Aug 2023 12:27:32 +0200 Subject: [PATCH 1/2] Add frameworks/docs/react.md --- src/frameworks/docs/react.md | 50 ++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/frameworks/docs/react.md diff --git a/src/frameworks/docs/react.md b/src/frameworks/docs/react.md new file mode 100644 index 00000000000..06cee13ab0f --- /dev/null +++ b/src/frameworks/docs/react.md @@ -0,0 +1,50 @@ +# Integrate React + +Using the Firebase CLI, you can deploy your React static web apps to Firebase +and serve them with Firebase Hosting. + +Note: Framework-aware Hosting is an early public preview. This means +that the functionality might change in backward-incompatible ways. A preview +release is not subject to any SLA or deprecation policy and may receive limited +or no support. + +## Before you begin + +Before you get started deploying your app to Firebase, +review the following requirements and options: + +- Firebase CLI version 12.1.0 or later. Make sure to + [install the CLI](/docs/cli#install_the_firebase_cli) using your preferred + method. +- Optional: An existing React project using Vite. You can create one with + `npm create vite@latest -- --template react` or you can let the Firebase CLI + to [initialize one](#initialize-a-new-project) for you. + + +## Initialize Firebase + +To get started, initialize Firebase for your framework project. +Use the Firebase CLI for a new project, or modify `firebase.json` for an +existing project. + +### Initialize a new project + +1. In the Firebase CLI, enable the web frameworks preview: +
firebase experiments:enable webframeworks
+1. Run the initialization command from the CLI and then follow the prompts: +
firebase init hosting
+1. Answer yes to "Do you want to use a web framework? (experimental)" +1. Choose your hosting source directory. If there is an existing React + codebase (with Vite), the CLI detects it and the process completes. + +## Serve static content + +After initializing Firebase, you can serve static content with the standard +deployment command: + +```shell +firebase deploy +``` + +You can [view your deployed app](/docs/hosting/test-preview-deploy#view-changes) +on its live site. From 7570e0cb377b66fcdde6907b0e5b11d4e7bc6e80 Mon Sep 17 00:00:00 2001 From: Chalo Salvador Date: Wed, 9 Aug 2023 10:44:54 +0200 Subject: [PATCH 2/2] Suggested update. --- src/frameworks/docs/react.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frameworks/docs/react.md b/src/frameworks/docs/react.md index 06cee13ab0f..7c0242c2a71 100644 --- a/src/frameworks/docs/react.md +++ b/src/frameworks/docs/react.md @@ -17,8 +17,8 @@ review the following requirements and options: [install the CLI](/docs/cli#install_the_firebase_cli) using your preferred method. - Optional: An existing React project using Vite. You can create one with - `npm create vite@latest -- --template react` or you can let the Firebase CLI - to [initialize one](#initialize-a-new-project) for you. + `npm create vite@latest -- --template react` or let the Firebase CLI + [initialize a new project](#initialize-a-new-project) for you. ## Initialize Firebase