Bring back a Firebase Hosting + Cloud Functions (2nd gen) preset in v3: we would maintain it

Aperta
#5,204 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
firebase, typescript
Ambito
backend, cloud

Direzione di ricerca

Start by reading the v3 preset and migration changes in PR #3215, then check how the existing firebase_app_hosting preset wraps and configures its handler. The proposed scope is a separate preset for Firebase Hosting with a 2nd-gen Cloud Function, using onRequest and the user's httpsOptions; the report offers to add the implementation, docs and tests. Confirm maintainers accept the preset and its name before treating the design as settled.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

pending triage
Describe the feature

Nitro 3 removed the firebase preset (Firebase Hosting in front of a Cloud Function) in #3215 in favour of firebase_app_hosting. The merge comment said it was "on outdated versions and not actively maintained", and that it could come back on user request. This is that request, with an offer to do the work.

Who is asking. We run 16 production Nuxt sites on the classic setup: Firebase Hosting with a rewrite to one 2nd-gen function built by preset: 'firebase' with firebase.gen: 2. We also run two sites on App Hosting, so we know both sides.

Why App Hosting does not replace it for us yet.

  • Region: 2nd-gen functions run in europe-west6 (Zürich), which our Swiss clients ask for. App Hosting's only European region is europe-west4.
  • Deploys: one firebase deploy ships hosting, function, Firestore rules and indexes together in a fixed order. On App Hosting the app rollout and the rules deploy are two separate steps that we have to sequence ourselves.
  • The Hosting edge: header rules, redirects, the CDN cache for static files and rewrites to other functions (Python, in our case) all live in firebase.json.
  • Classic Hosting and 2nd-gen functions are both supported Firebase products with no announced end.

What we propose. A slim preset for Nitro 3, 2nd gen only:

  • no 1st-gen code path and no firebase.gen switch;
  • current firebase-functions and firebase-admin versions, current Node runtimes;
  • the entry wraps the Nitro handler in onRequest with the user's httpsOptions;
  • named so it is clear what it is (for example firebase_functions), with firebase staying mapped to App Hosting as the migration guide says.

What we offer. We would write the PR, the docs page and the tests, and stay on as maintainers of the preset: triage its issues and keep it working with new firebase-functions, firebase-tools and Node releases. We deploy with it regularly, so breakage shows up for us first.

Questions.

  1. Would you accept such a preset back into Nitro 3?
  2. If not in core, is an external preset package the way you would recommend, and is the preset API stable enough in v3 to build on?
Additional information
  • Would you be willing to help implement this feature?
Lingua principale
TypeScript
Stelle
11.5k
Fork
968
Merge medio
4g 9h
PR unite (30g)
64

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nitrojs/nitro

Tutte le issue di nitrojs/nitro

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.