firebase / firebase/firebase-functions
Bun Compatibility Support
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 232
- Avg merge
- 20h 46m
- Merged PRs (30d)
- 15
Description
### Related issues
While there are discussions in the community regarding Bun compatibility (such as https://github.com/oven-sh/bun/issues/8549), there does not appear to be an official tracking issue in `firebase-functions` for native Bun runtime support for Gen 1/2 Cloud Functions and the local emulator suite.
### [REQUIRED] Test case
A `package.json` for a project attempting to declare Bun as the primary engine:
```json
{
"scripts": {
"build": "bun run build:ts",
"build:ts": "tsc",
"serve": "firebase emulators:start --only functions",
"deploy": "firebase deploy --only functions"
},
"engines": {
"bun": "1.x"
},
"main": "lib/index.js",
"dependencies": {
"firebase-admin": "...",
"firebase-functions": "..."
},
"devDependencies": {
"typescript": "..."
}
}
```
### [REQUIRED] Expected behavior
**Local Emulator:** The emulator suite should respect the declared package manager and runtime environment, executing the function code natively via Bun. This would allow for native TypeScript execution without strictly requiring a `tsc` build step, alongside significantly faster startup times. Currently, the emulator defaults to spinning up a Node.js process.
**Deployment:** The Firebase CLI should recognize `bun` as a valid runtime engine for functions. Because Gen 2 functions are built on top of Cloud Run, the CLI should seamlessly package the function into a container equipped with Bun.
Contributor guide
Assessment
This issue has not been assessed yet.