0.8.9 • Published 2 years ago

pioche v0.8.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Note: To use Durable Objects and Websockets features of Pioche, you need a Cloudflare account with Durable Objects access

⭐ Features

  • Short development time
  • Decorator-based path-to-regexp router
  • Middleware support
  • Simplified, more powerful API for D/O Storage and KV
  • Simplified Worker -> D/O interaction
  • WebSocket handling
  • Minimized invokations and compute time

🔋 Tree Shakeable Batteries Available in pioche-extras

See the installation section of pioche-extras for prebuilt OAuth, log streaming, and middleware to use in your project

💾 Installation

To get started use pioche-scripts

npx pioche-scripts create <AppName>

This will setup an minimal project with a single TypeScript file: helloworld.ts
We can then make changes to functionality and run

npm run build // Generate wrangler.toml and program entry point
npm run dev // Deploy to Cloudflare with remote debugging session
npm run serve // Run locally, debug locally
npm run deploy // Deploy to Cloudflare

After npm run deploy you should see <AppName>.workers.dev gives Hello, World!

📕 Background and why Pioche Exists

Cloudflare (CF) workers platform has 3 major offerings:

  1. Workers: A serverless javascript environment for short lived code. There can be many of the same worker script executing globally at the same time

  2. Durable Objects (D/O): A serverless javascript environment for long lived code or code which requires transactional storage. There can only be one of a D/O script globally at the same time.

  3. Workers KV (KV): A non-transactional distributed key-value store

Workers are web-facing, D/Os are Workers-facing, KV Workers and D/O-facing.
Problem: There is a cumbersome dispatch process to call a D/O from a worker.

D/Os have an in-memory key value store (D/O storage)
Problem: This store has very similar capabilities but use a separate API from KV.

CPU time is charged per GB-sec, storage operations are charged per kB transferred, and Workers and D/Os are charged per invokation.
Problem: We want to only use D/Os when necessary and minimize CPU time and invokations.

Problem: There is no routing functionality

These 4 issues alone greatly increase upstart development time and complexity because orchestrating routing between services and resource management while minimizing cost is a huge task that developers shouldn't need to handle.

People

Pioche was created by Garrett Peake

License

MIT

0.8.9

2 years ago

0.7.11

2 years ago

0.8.8

2 years ago

0.7.10

2 years ago

0.7.12

2 years ago

0.8.5

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.8.7

2 years ago

0.7.8

2 years ago

0.8.6

2 years ago

0.7.7

2 years ago

0.8.1

2 years ago

0.7.2

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.7.3

2 years ago

0.7.0

2 years ago

0.3.0

2 years ago

0.6.3

2 years ago

0.6.2

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago