Menu
Libraries |
Category

svelte-adapter-firebase

  • Purpose: The library is a Firebase adapter for SvelteKit, enabling SSR on Cloud Functions while leveraging Firebase Hosting for static assets. It integrates SvelteKit apps with Firebase's infrastructure.
  • Key Features:
    • SSR on Cloud Functions
    • Integration with existing Cloud Functions
    • Local testing via Firebase Emulator
    • Cold-start mitigation with minInstances
    • Support for multiple Hosting sites
  • Target Audience: Developers using SvelteKit who want to deploy their apps on Firebase with SSR capabilities.
  • Svelte Support: Explicitly designed for SvelteKit, making it a primary framework for this adapter.
  • How It Works:
    • Static assets are deployed to Firebase Hosting.
    • SSR logic is bundled into Cloud Functions, with rewrite rules directing requests to these functions.
    • Configuration is driven by firebase.json, with adapter options for customization.
  • Caveats:
    • Firebase's first-party SvelteKit support may deprecate this adapter in the future.
    • Cloud Function rewrites only support the us-central1 region.
    • Firebase Hosting Preview Channels lack SSR support.
  • Non-Goals:
    • Automatically writing Cloud Function code to files (manual integration is required).
    • Handling Firebase deployments (left to the user).
  • FAQ: Addresses common questions like cold starts, Firebase SDK usage, and manual Cloud Function code integration.

For more details, visit the GitHub repository .

sveltesveltekitfirebasessrserverlesscloud-functionssveltekit-adaptersvelte-adaptercloud-run

Comments