Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature-flag-firebase-remote-config #670

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

tengweiherr
Copy link

@tengweiherr tengweiherr commented May 2, 2023

Description

Feature flag with Firebase remote config, inspired by the example feature-flag-split

  1. Create three variant pages (index.tsx, B.tsx, C.tsx) in about folder.
  2. Run a script during the pre-build time to fetch the treatments from Firebase remote config.
  3. Save the treatments to a JSON file and store it in the directory.
  4. Proceed to build the app to generate static pages for each variant (/about, /about/B, /about/C).
  5. When a client requests the about page, instead of calling API routes and sending HTTP requests to fetch data from Firebase, the middleware can directly retrieve the data from the pre-generated JSON file and assign a variant to it.

Full article about this approach here.

Demo URL

https://feature-flag-firebase-remote-config.vercel.app

Type of Change

  • New Example
  • Example updates (Bug fixes, new features, etc.)
  • Other (changes to the codebase, but not to examples)

New Example Checklist

  • 🛫 npm run new-example was used to create the example
  • 📚 The template wasn't used but I carefully read the Adding a new example steps and implemented them in the example
  • 📱 Is it responsive? Are mobile and tablets considered?

@vercel
Copy link

vercel bot commented May 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app-dir-css-in-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
app-dir-i18n ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
app-dir-share-state ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-api-routes-cache-control ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-api-routes-hello-world ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-api-routes-json-response ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-api-routes-query-parameters ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-functions-authed-proxy ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-functions-cookies ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-functions-news ❌ Failed (Inspect) Jan 3, 2024 2:55pm
edge-functions-streams ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-geolocation-country-block ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-middleware-modify-request-header ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
edge-user-agent-based-rendering ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
example-auth-with-ory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
example-reduce-image-bandwidth-usage ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
examples ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
geolocation-script ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
i18n ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
next-edge-api-route-hello-world ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
next-flask ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
nodejs-api ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
redirect-with-fallback ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-combining-data-fetching-strategies ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-image-fallback ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-image-offset ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-loading-web-fonts ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-microfrontends ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-microfrontends-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-pagination-with-ssg ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-reuse-responses ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-script-component-ad ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-script-component-strategies ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
solutions-testing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
wasm-rust-hello-world ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm
wasm-rust-xor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2024 2:55pm

@vercel
Copy link

vercel bot commented May 2, 2023

@tengweiherr is attempting to deploy a commit to the Vercel Examples Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant