functions_framework
0.4.3+1, released 3 years ago by cloud.google.com
FaaS framework for writing portable Dart functions.
What it does
An open source FaaS (Function as a Service) framework that lets you write lightweight functions in Dart which run portably across local machines, Google Cloud Run, Google App Engine, and Knative-based environments without writing explicit HTTP server boilerplate.
AI-written summary of version 0.4.3+1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to deploy serverless Dart functions to Google Cloud Run or Knative environments.
- You want to handle HTTP requests or CloudEvents without writing custom server request-handling logic.
Skip it when
- You need an officially supported Google Cloud Functions Dart runtime (currently not provided).
- You require an official enterprise-level SLA or deprecation policy, as this is a community-supported project.
Strengths
- Portable between multiple serverless and container platforms like Cloud Run and App Engine.
- Supports automatic unmarshaling of CloudEvents and handling of JSON data.
- Removes the boilerplate of setting up an HTTP server and request-handling logic.
Weaknesses
- Community-supported project with no official level of support or SLA.
- Google Cloud Functions does not currently provide an officially supported Dart language runtime.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 10
Annotate functions with @CloudFunction() and run inside serverless containers or local environments.
import 'package:functions_framework/functions_framework.dart';
import 'package:shelf/shelf.dart';
@CloudFunction()
Response function(Request request) => Response.ok('Hello, World!');Alternatives
Packages that do the same job and could replace functions_framework.
- cloud_functions_web
Web implementation of Firebase Cloud Functions for Flutter web apps
78Compare - conduit
A modern HTTP server framework, ORM and OAuth2 provider for Dart services.
73Compare
Works with
Packages commonly used together with functions_framework: ones it builds on, ones built on it, and its own family.
- stack_tracefunctions_framework depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- iofunctions_framework depends on itUtilities for the Dart VM Runtime including ANSI colors, file copying, and exit code values.
- shelffunctions_framework depends on itComposable web server middleware for Dart
- json_annotationfunctions_framework depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- argsfunctions_framework depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- http_parserfunctions_framework depends on itA platform-independent package for parsing and serializing HTTP formats.
- google_cloudfunctions_framework depends on itUtilities for running Dart code correctly on the Google Cloud Platform.