supabase_functions 패키지는 개발자가 Supabase Functions에서 직접 Dart 기반 서버리스 함수를 작성하고 배포하며 호출할 수 있도록 해줍니다. invertase.io가 개발한 이 패키지는 Dart 로직을 백엔드 워크플로에 원활하게 통합할 수 있게 하며, 확장성 있고 보안이 강화된 함수 실행을 위해 Supabase의 인프라를 활용합니다. 이 패키지는 사용자 정의 비즈니스 로직을 추가하거나 웹훅을 처리하거나 실시간으로 데이터를 처리하는 데 이상적입니다. CLI를 통해 배포를 지원하며, Flutter 앱과 원활하게 통합됩니다. 이 패키지는 성능과 개발자 경험을 중시하는 광범위한 Dart Edge 생태계의 일부입니다.
사용 사례
서버리스 백엔드 로직
웹훅 핸들러
실시간 데이터 처리
사용자 정의 API 엔드포인트
인증 확장
파일 처리 워크플로우
주요 기능
Dart 우선 서버리스 함수
Supabase와의 원활한 통합
CLI 배포 지원
타입 안전한 함수 정의
내장된 오류 처리
경량 런타임
적합한 대상
Supabase를 사용하는 Flutter 개발자
Dart의 백엔드 로직
서버리스 아키텍처
풀스택 Dart 애플리케이션
자바스크립트보다 다트를 선호하는 팀
고려 사항
Supabase 계정이 필요합니다
Supabase Functions 플랫폼에 한정
네이티브 로컬 개발 환경 없음
Dart Edge 런타임에 의존합니다
함수 실행 제한이 적용됩니다
콜드 스타트 지연 가능성
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
[!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.