- Notifications
You must be signed in to change notification settings - Fork183
Experimental addon to the Firebase CLI to add web framework support
License
FirebaseExtended/firebase-framework-tools
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
App Hosting provides configuration-free build and deploy support for Web apps developed in these frameworks:
- Next.js 13+
- Angular 17.2+
This repo holds the code for the adapters that enable support for these frameworks. At a high level these adapters transform framework specific configurations into anoutput bundle spec that App Hosting can use to configure frameworks support. For more information seeFramework integration.
The App Hosting output bundle is a file based specification that allows different frameworks to configure and customize their App Hosting deployment for enhanced support.
Any framework that can generate a build output in accordance with the App Hosting output bundle can be deployed on App Hosting.
The output bundle primarily consists of abundle.yaml
file that sits inside of the.apphosting
directory. This bundle.yaml contains all the ways that frameworks can configure App Hosting when users deploy their applications.
Note
App Hosting technically supports all node applications, but no custom framework features will be enabled without the output bundle.
The output bundle is contained in a single file:
.apphosting/bundle.yaml
As long as this file exists and follows the schema, App Hosting will be able to process the build properly.
The schema can also be found insource
interfaceOutputBundle{version:"v1"runConfig:RunConfig;metadata:Metadata;outputFiles?:OutputFiles;}
Theversion
represents which output bundle version is currently being used. The current version is v1.
TherunConfig
fields configures the Cloud Run service associated with the App Hosting Backend.
interfaceRunConfig{runCommand:string;environmentVariables?:EnvVarConfig[];concurrency?:number;cpu?:number;memoryMiB?:number;minInstances?:number;maxInstances?:number;}
Field | Type | Description | Required? |
---|---|---|---|
runCommand | string | Command to start the server (e.g.node dist/index.js ). Assume this command is run from the root dir of the workspace. This should be the productionized version of the server start command. | y |
environmentVariables | EnvVarConfig[] | Environment variables present in the server execution environment. | n |
concurrency | number | The maximum number of concurrent requests that each server instance can receive. | n |
cpu | number | The number of CPUs used in a single server instance. | n |
memoryMiB | number | The amount of memory available for a server instance. | n |
minInstance | number | The limit on the minimum number of function instances that may coexist at a given time. | n |
MaxInstance | number | The limit on the maximum number of function instances that may coexist at a given time. | n |
Many of these fields are shared withapphosting.yaml
. See therunConfig reference documentation for additional context and default values.
interfaceEnvVarConfig{variable:string;value:string;availability:'RUNTIME'}
Field | Type | Description | Required? |
---|---|---|---|
variable | string | Name of the environment variable | y |
value | string | Value associated with the environment variable | y |
availability | RUNTIME | Where the variable will be available. For now this will always beRUNTIME | y |
interfaceMetadata{adapterPackageName:string;adapterVersion:string;framework:string;frameworkVersion?:string;}
Field | Type | Description | Required? |
---|---|---|---|
adapterPackageName | string | Name of the adapter (this should be the npm package name) | y |
adapterVersion | string | Version of the adapter | y |
framework | string | Name of the framework that is being supported | y |
frameworkVersion | string | Version of the framework that is being supported | n |
OutputFiles is an optional field to configure outputFiles and optimize server files + static assets.
interfaceOutputFiles{serverApp:ServerApp}
Field | Type | Description | Required? |
---|---|---|---|
serverApp | ServerApp | ServerApp holds configurations related to the serving files at runtime from Cloud Run | y |
OutputFiles is an optional field to configure outputFiles and optimize server files + static assets.
interfaceServerApp{include:string[]}
Field | Type | Description | Required? |
---|---|---|---|
include | string[] | include holds a list of directories + files relative to the app root dir that frameworks need to deploy to the App Hosting server, generally this will be the output/dist directory (e.g. .output or dist). In the case that the framework wants to include all files they can use [“.”] | y |
Here is a sample.apphosting/bundle.yaml
file putting all this together:
version:v1runConfig:runCommand:node dist/index.jsenvironmentVariables: -variable:VARvalue:8080availability:RUNTIMEconcurrency:80cpu:2memoryMiB:512minInstances:0maxInstances:14outputFiles:serverApp:include: -dist -.outputmetadata:adapterPackageName:npm-nameadapterVersion:12.0.0framework:framework-nameframeworkVersion:1.0.0
As long as you have thebundle.yaml
in this format, App Hosting will be able to deploy any framework that supports server side rendering.
About
Experimental addon to the Firebase CLI to add web framework support
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.