Orientação gerada a partir de informações públicas. Apenas para referência.
O pacote supabase_functions permite que desenvolvedores escrevam, implantem e invoquem funções sem servidor baseadas em Dart diretamente no Supabase Functions. Criado pela invertase.io, ele permite a integração fluida de lógica Dart nos fluxos de trabalho do backend, aproveitando a infraestrutura do Supabase para execução escalonável e segura de funções. Esse pacote é ideal para expandir o Supabase com lógica de negócios personalizada, lidar com webhooks ou processar dados em tempo real. Ele suporta implantação via CLI e se integra perfeitamente a aplicativos Flutter. O pacote faz parte do ecossistema mais amplo do Dart Edge, destacando desempenho e experiência do desenvolvedor.
Casos de uso
Lógica de backend sem servidor
Manipuladores de webhook
Processamento de dados em tempo real
Pontos de extremidade da API personalizados
Extensões de autenticação
fluxos de trabalho de processamento de arquivos
Principais recursos
Funções sem servidor com foco em Dart
Integração sem interrupções com o Supabase
Suporte de implantação por CLI
Definições de funções seguras por tipo
Tratamento de erro embutido
Tempo de execução leve
Indicado para
Desenvolvedores Flutter usando o Supabase
Lógica de backend em Dart
Arquiteturas sem servidor
Aplicações Dart de ponta a ponta
Equipes que preferem Dart em vez de JavaScript
Considerações
Requer conta do Supabase
Limitado à plataforma Supabase Functions
Nenhum ambiente de desenvolvimento local nativo
Depende do tempo de execução Dart Edge
Os limites de execução de função se aplicam
Latência de inicialização fria possível
README original
Snapshot do README original do repositório-fonte vinculado. Consulte o repositório para o conteúdo mais recente.
[!WARNING]
This repository is no longer maintained and is left archived for educational purposes. Whilst an interesing project, there were too many issues around DX and stability (testing, compilation times etc) to take it any further.
Dart Edge (Experimental)
Run Dart on the Edge - supporting Vercel, Cloudflare Workers & Supabase Edge Functions (more coming soon).
Edge functions are serverless functions which run on Edge networks, providing a number of benefits to server based environments (but also carried some limitations). Some of these benefits include:
⚡ Decreased Latency: Edge functions run close to your users, reducing request latency (rather than running in a region(s)).
⏱ Code Boot Times: Edge functions have minimal code boot times vs traditional serverless functions.
✨ Platform APIs: Access powerful platform specific APIs, such as Cloudflare Workers HTMLRewriter, KV,
Durable Objects & more.
🌎 Runtime APIs: Edge functions run on the JavaScript V8 runtime, and provides a subset of standard Web APIs to access familar APIs such as Cache, Crypto, Fetch, etc.
This project provides Dart bindings to the Edge runtime APIs, allowing you to write Dart code which can be run on Edge functions. Your code is compiled to JavaScript and deployed to the Edge network (WASM support possible in the future).
Supported Platforms
We are working to enable Dart Edge to be deployed to many platforms as possible. Currently we support:
This project is a new concept, and we're still figuring out things such as the public APIs, testing, best practices for local development & deployment and other complicated matters such as error handling and debugging (since Dart is compiled to minified JavaScript). We use this project in production ourselves as a dog-fooding exercise, however we'll keep it as experimental until we're happy we've covered all bases of what you'd expect from Dart development.
We will probably be making breaking changes without following semver until we're happy for a major release. So please be aware of this.
There's also some unimplemented APIs which we're working on. Please see the API documentation for more information.
❓ What is the motivation for this project?
We're big fans of serverless environments, and are using both Cloudflare Workers & Vercel Edge Functions on our own projects. Some of these projects (including Zapp!) are written in Dart. We wanted to be able to write Dart code and deploy it to these platforms to allow for code sharing & collaboration between the team, hence this project started.
❓ What are the limitations of Edge functions?
If you're not familar with the concept of serverless functions, you should be aware of the limitations. Typically to run Dart as a backend service, you will most likely reach for Shelf, (or use a framework such as as ServerPod, Dart Frog etc) which are deployed to services such as Google Cloud Run, AWS etc. These setups run your code in a container, running one or more long lived processed to keep your service running. You can access the file system, use a single database connection, establish a long-lived WebSocket connection, etc.
Serverless functions on the Edge are different. They are invoked once-per-request and are not long lived. You cannot access the file system, and in some cases cannot establish long-lived connections (depending on the platform). Netlify
has a great article explaining the differences.