패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.0.4+4

cloudflare_workers

Dart 함수를 Cloudflare Workers에 작성하고 배포합니다.

30일 다운로드
21
좋아요
7
Pub 점수
100

패키지 설치

flutter pub add cloudflare_workers

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter/Dart 패키지로 개발자가 Dart 기반 함수를 Cloudflare Workers(서버리스 플랫폼)에 작성하고 배포할 수 있도록 합니다. Cloudflare의 글로벌 엣지 네트워크를 활용하여 낮은 지연 시간으로 실행되는 가볍고 고성능의 백엔드 로직을 Dart로 직접 구축할 수 있습니다. Flutter 프로젝트와 원활하게 통합되며 CLI 도구를 통해 배포를 지원하고, 엣지 컴퓨팅 사용 사례를 위한 간편한 워크플로우를 제공합니다. 서버 관리 없이 API, 미들웨어 또는 실시간 서비스를 만들기에 적합합니다. 이 패키지는 invertase.io에서 유지보수되며 GitHub에 호스팅되어 있습니다.

사용 사례

  • 서버리스 API
  • 에지 컴퓨팅
  • 실시간 데이터 처리
  • 인증 미들웨어
  • 동적 콘텐츠 전달

주요 기능

  • Cloudflare Workers용 Dart 지원
  • 무결점 플러터 통합
  • 글로벌 엣지 배포
  • 경량 함수 실행
  • CLI 배포 도구

적합한 대상

  • Flutter 개발자
  • 백엔드 엔지니어
  • 엣지 애플리케이션 생성자
  • 서버리스 애호가
  • 풀스택 개발자

고려 사항

  • Cloudflare Workers 플랫폼에 한정
  • 에지 컴퓨팅에 대한 이해가 필요합니다
  • 클라우드플레어 외 환경에 대한 네이티브 지원 없음
  • invertase.io 유지보수에 따라 다름
  • 복잡한 배포를 위해 추가 구성이 필요할 수 있습니다

원본 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).

Melos docs.page Chat on Discord

Documentation • Examples • License

About

Dart Edge is a project aimed at running Dart code on Edge functions, including support for platforms such as Cloudflare Workers, Vercel Edge Functions & Supabase Edge Functions (more to come).

import 'package:vercel_edge/vercel_edge_shelf.dart';
import 'package:shelf_router/shelf_router.dart';
import 'package:shelf/shelf.dart';

void main() {
  VercelEdgeShelf(
    fetch: (request) async {
      final app = Router();

      app.get('/user/<id>', (request, String id) async {
        return Response.ok('Welcome, $id');
      });

      app.all('/<ignored|.*>', (request) {
        return Response.notFound('Resource not found');
      });

      final handler = const Pipeline().addMiddleware(logRequests()).addHandler(app);
      return handler(request);
    },
  );
}

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:

Please see the platform documentation for API status.

Other platforms we'll likely add support for are; Netlify Edge, Deno Deploy, Supabase Functions, AWS Lambda@Edge. Feel free to reach out if you'd like to see support for a specific platform.

FAQs

❓ Why is it experimental?

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.


Built and maintained by Invertase.

카테고리

의존성

의존성 목록 4 개

  • edge^0.0.7
  • edge_runtime^0.0.4+2
  • js^0.6.5
  • js_bindings^0.1.0

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.