Migrating to Firebase Functions V2

I’ll be honest - I’ve been putting this off for a while. The Firebase Functions v1 to v2 migration has been sitting in my backlog since its announcement, and like many developers, I kept thinking “well, if it’s not broken…”. But after diving into some new features in v2, I realized it was time to bite the bullet and modernize. Why TypeScript? The decision to rewrite in TypeScript wasn’t just about following trends. The v2 SDK is written in TypeScript, and the type safety it provides is particularly valuable when dealing with cloud functions. No more scratching your head wondering what properties are available in that data object - TypeScript tells you right there in your editor. ...

April 22, 2025 · 2 min · Alastair

Local Firebase Development with Emulators

Why Emulators Matter If you’re building anything substantial with Firebase, running your entire stack locally isn’t just convenient - it’s essential. I’ve been diving deep into Firebase development lately, and the emulators have become an indispensable part of my workflow. The Setup First things first, you’ll need the Firebase CLI. Here’s what a typical firebase.json looks like for a full-stack setup: { "hosting": { "public": "dist", "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], "rewrites": [ { "source": "**", "destination": "/index.html" } ] }, "emulators": { "auth": { "port": 9099 }, "functions": { "port": 5001 }, "firestore": { "port": 8080 }, "hosting": { "port": 5000 }, "ui": { "enabled": true } } } Connecting Your App The most crucial part is telling your app to use the emulators. With the latest SDK, it’s pretty straightforward: ...

December 15, 2023 · 3 min · Alastair