🆕 Firebase Integrations (Codebases, deploy)
See original GitHub issueDescribe the problem
Firebase have recently added features which will impact the development of this Adapter.
1: codebases - allow the configuration of multiple folders of functions. This would be useful to separate out the Cloud Function used for SSR from the rest of your codebases functions.
2: firebase deploy - is using some other mechanism referred to as “Firebase Frameworks” to allow the deploy command to know how to build and deploy SSR applications from meta-frameworks like Next.js etc. Next.js & Angular are currently supported.
Describe the proposed solution
I need to experiment with how these features work and might impact this adapter.
Given there was no closed-alpha or beta of these features (that I am aware of, I am part of the alpha and active in this space but never heard anything), I wouldn’t be surprised if the Firebase team implemented their own SvelteKit integration with the new firebase deploy
feature.
Depending on the boundaries of the firebase deploy
feature, the adapter may still be required.
If this adapter is still required, I am thinking that Codebases gives a nice boundary for us to separate out the Cloud Function for SSR from the rest of peoples apps, which means pre-deployment compilation is easier, as is support for TypeScript.
With Codebases being a user-land feature I propose we implement that now, regardless of the firebase deploy
status, and we can at least simplify the usage of the current adapter.
Alternatives considered
NA
Importance
would make my life easier
EDIT:
- Here is the repo for Firebase Frameworks - https://github.com/FirebaseExtended/firebase-framework-tools/
- https://github.com/firebase/firebase-tools/blob/master/src/frameworks/index.ts
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top GitHub Comments
I’d vote for exposing an
firebaseSsrOutputFolder
in the adapter’s config, and ignore thefunctions
property infirebase.json
.If the option is passed, the adapter would overwrite (in this case)
functions-ssr/lib
safely, including theindex.js
that currently has to be modified by hand.If the option is missing, then the adapter would output the code to the console, as it does now.
I think this would be the least confusing way to do it, at least for my simpler use case/firebase config. (Alternatives would be to specify the codebase name in the adapter config, or say that everyone has to use the same hardcoded codebase name.)
BTW, my current workaround is to copy
firebase.json
(which has thecodebase
array config) tofirebase-ssr.json
, removing the array and pointingsource
directly to the ssr folder. This works and deploys fine, but is obviously not ideal.https://github.com/FirebaseExtended/firebase-framework-tools/issues/32