From 34b3d16f933b151df5ac8337c2f0933808996764 Mon Sep 17 00:00:00 2001 From: Andreas Thomas Date: Tue, 31 May 2022 08:47:01 +0200 Subject: [PATCH] workers naming (#102) * fix broken links * Update README.md * Update README.md * Update README.md * style: fmt * style: fmt * chore: rename cloudflare examples * ci: fix paths * revert: readme * ci: wait for server * ci: log response * ci: redeploy workers Co-authored-by: Enes Akar --- .github/workflows/tests.yaml | 66 ++-- README.md | 323 +++++++++++++++++- .../.gitignore | 0 .../README.md | 2 +- .../bindings.d.ts | 0 .../build.js | 0 .../package.json | 0 .../src/index.ts | 0 .../test.ts | 0 .../tsconfig.json | 0 .../wrangler.toml | 2 +- .../README.md | 0 .../index.js | 0 .../package.json | 2 +- .../test.ts | 3 + .../wrangler.toml | 2 +- 16 files changed, 354 insertions(+), 46 deletions(-) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/.gitignore (100%) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/README.md (95%) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/bindings.d.ts (100%) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/build.js (100%) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/package.json (100%) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/src/index.ts (100%) rename examples/{cloudflare-worker-wrangler2 => cloudflare-workers-with-wrangler-1}/test.ts (100%) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/tsconfig.json (100%) rename examples/{cloudflare-worker => cloudflare-workers-with-wrangler-1}/wrangler.toml (90%) rename examples/{cloudflare-worker-wrangler2 => cloudflare-workers}/README.md (100%) rename examples/{cloudflare-worker-wrangler2 => cloudflare-workers}/index.js (100%) rename examples/{cloudflare-worker-wrangler2 => cloudflare-workers}/package.json (91%) rename examples/{cloudflare-worker => cloudflare-workers}/test.ts (87%) rename examples/{cloudflare-worker-wrangler2 => cloudflare-workers}/wrangler.toml (83%) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d50a22cb..63f3802d 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -54,7 +54,6 @@ jobs: working-directory: dist nextjs-local: - environment: local needs: - test env: @@ -110,7 +109,6 @@ jobs: DEPLOYMENT_URL: http://localhost:3000 nextjs-edge-local: - environment: local needs: - test env: @@ -168,7 +166,6 @@ jobs: nextjs-deployed: runs-on: ubuntu-latest concurrency: vercel - environment: deployed needs: - release steps: @@ -202,7 +199,6 @@ jobs: nextjs-edge-deployed: runs-on: ubuntu-latest concurrency: vercel - environment: deployed needs: - release steps: @@ -233,8 +229,7 @@ jobs: - name: Test run: deno test --allow-net --allow-env ./examples/nextjs_edge/test.ts - cloudflare-worker-local: - environment: local + cloudflare-workers-with-wrangler-1-local: needs: - test env: @@ -268,22 +263,22 @@ jobs: run: | pnpm add @upstash/redis@../../dist pnpm install -g miniflare @cloudflare/wrangler - working-directory: examples/cloudflare-worker + working-directory: examples/cloudflare-workers-with-wrangler-1 - name: Start example run: miniflare -b UPSTASH_REDIS_REST_URL=http://127.0.0.1:6379 -b UPSTASH_REDIS_REST_TOKEN=${{ secrets.UPSTASH_AUTH_TOKEN }} & - working-directory: examples/cloudflare-worker + working-directory: examples/cloudflare-workers-with-wrangler-1 - run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8787)" != "200" ]]; do sleep 1; done timeout-minutes: 2 - name: Test - run: deno test -A ./examples/cloudflare-worker/test.ts + run: deno test -A ./test.ts + working-directory: examples/cloudflare-workers-with-wrangler-1 env: DEPLOYMENT_URL: http://localhost:8787 - cloudflare-worker-deployed: - environment: deployed + cloudflare-workers-with-wrangler-1-deployed: needs: - release env: @@ -306,23 +301,23 @@ jobs: run: | pnpm add @upstash/redis@${{needs.release.outputs.version}} pnpm install -g @cloudflare/wrangler - working-directory: examples/cloudflare-worker + working-directory: examples/cloudflare-workers-with-wrangler-1 - name: Deploy run: wrangler publish - working-directory: examples/cloudflare-worker + working-directory: examples/cloudflare-workers-with-wrangler-1 env: CF_API_TOKEN: ${{secrets.CF_API_TOKEN}} - name: Test - run: deno test -A ./examples/cloudflare-worker/test.ts + run: deno test -A ./test.ts + working-directory: examples/cloudflare-workers-with-wrangler-1 env: - DEPLOYMENT_URL: https://upstash-modules-worker.upstash.workers.dev + DEPLOYMENT_URL: https://upstash-redis-with-wrangler-1.upstash.workers.dev - cloudflare-worker-wrangler2-local: - environment: local + cloudflare-workers-local: needs: - test env: @@ -354,28 +349,28 @@ jobs: - name: Install example run: pnpm add @upstash/redis@../../dist - working-directory: examples/cloudflare-worker-wrangler2 + working-directory: examples/cloudflare-workers - name: Add account ID run: echo 'account_id = "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}"' >> wrangler.toml - working-directory: examples/cloudflare-worker-wrangler2 + working-directory: examples/cloudflare-workers - name: Start example - run: pnpm dev & - working-directory: examples/cloudflare-worker-wrangler2 + run: pnpm dev & sleep 5 + working-directory: examples/cloudflare-workers env: CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }} - - run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8787)" != "200" ]]; do sleep 1; done - timeout-minutes: 2 + # - run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8787)" != "200" ]]; do sleep 1; done + # timeout-minutes: 2 - name: Test - run: deno test -A ./examples/cloudflare-worker-wrangler2/test.ts + run: deno test -A ./test.ts + working-directory: examples/cloudflare-workers env: DEPLOYMENT_URL: http://localhost:8787 - cloudflare-worker-wrangler2-deployed: - environment: deployed + cloudflare-workers-deployed: needs: - release env: @@ -398,25 +393,25 @@ jobs: - name: Install example run: | pnpm add @upstash/redis@${{needs.release.outputs.version}} - working-directory: examples/cloudflare-worker-wrangler2 + working-directory: examples/cloudflare-workers - name: Add account ID run: echo 'account_id = "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}"' >> wrangler.toml - working-directory: examples/cloudflare-worker-wrangler2 + working-directory: examples/cloudflare-workers - name: Deploy run: pnpm deploy - working-directory: examples/cloudflare-worker-wrangler2 + working-directory: examples/cloudflare-workers env: CLOUDFLARE_API_TOKEN: ${{secrets.CF_API_TOKEN}} - name: Test - run: deno test -A ./examples/cloudflare-worker-wrangler2/test.ts + run: deno test -A ./test.ts + working-directory: examples/cloudflare-workers env: - DEPLOYMENT_URL: https://cloudflare-worker-wrangler2.upstash.workers.dev + DEPLOYMENT_URL: https://upstash-redis.upstash.workers.dev fastly-local: - environment: local needs: - test env: @@ -472,7 +467,6 @@ jobs: DEPLOYMENT_URL: http://localhost:7676 fastly-deployed: - environment: deployed needs: - release env: @@ -526,7 +520,6 @@ jobs: DEPLOYMENT_URL: https://terminally-flowing-lizard.edgecompute.app nodejs-local: - environment: local needs: - test env: @@ -571,7 +564,6 @@ jobs: working-directory: examples/nodejs nodejs-18-local: - environment: local needs: - test env: @@ -623,8 +615,8 @@ jobs: - fastly-local - nextjs-local - nextjs-edge-local - - cloudflare-worker-local - - cloudflare-worker-wrangler2-local + - cloudflare-workers-with-wrangler-1-local + - cloudflare-workers-local name: Release runs-on: ubuntu-latest diff --git a/README.md b/README.md index 7911c899..d22f1783 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ It is the only connectionless (HTTP based) Redis client and designed for: - Serverless functions (AWS Lambda ...) - Cloudflare Workers (see - [the example](https://github.com/upstash/upstash-redis/tree/master/examples/cloudflare-workers)) + [the example](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers)) - Fastly Compute@Edge (see - [the example](https://github.com/upstash/upstash-redis/tree/master/examples/fastly)) + [the example](https://github.com/upstash/upstash-redis/tree/main/examples/fastly)) - Next.js, Jamstack ... - Client side web/mobile applications - WebAssembly @@ -23,11 +23,324 @@ See [the list of APIs](https://docs.upstash.com/features/restapi#rest---redis-api-compatibility) supported. +## Upgrading to v1.4.0 **(ReferenceError: fetch is not defined)** + +If you are running on nodejs v17 and earlier, `fetch` will not be natively +supported. Platforms like Vercel, Netlify, Deno, Fastly etc. provide a polyfill +for you. But if you are running on bare node, you need to either specify a +polyfill yourself or change the import path to: + +```typescript +import { Redis } from "@upstash/redis/with-fetch"; +``` + +## Upgrading from v0.2.0? + +Please read the +[migration guide](https://github.com/upstash/upstash-redis#migrating-to-v1). For +further explanation we wrote a +[blog post](https://blog.upstash.com/upstash-redis-sdk-v1). + +## Quick Start + +### Install + +#### npm + +```bash +npm install @upstash/redis +``` + +#### Deno + +```ts +import { Redis } from "https://deno.land/x/upstash_redis/mod.ts"; +``` + +### Create database + +Create a new redis database on [upstash](https://console.upstash.com/) + +### Environments + +We support various platforms, such as nodejs, cloudflare and fastly. Platforms +differ slightly when it comes to environment variables and their `fetch` api. +Please use the correct import when deploying to special platforms. + +#### Node.js + +Examples: Vercel, Netlify, AWS Lambda + +If you are running on nodejs you can set `UPSTASH_REDIS_REST_URL` and +`UPSTASH_REDIS_REST_TOKEN` as environment variable and create a redis instance +like this: + +```ts +import { Redis } from "@upstash/redis" + +const redis = new Redis({ + url: , + token: , +}) + +// or load directly from env +const redis = Redis.fromEnv() +``` + +If you are running on nodejs v17 and earlier, `fetch` will not be natively +supported. Platforms like Vercel, Netlify, Deno, Fastly etc. provide a polyfill +for you. But if you are running on bare node, you need to either specify a +polyfill yourself or change the import path to: + +```typescript +import { Redis } from "@upstash/redis/with-fetch"; +``` + +- [Code example](https://github.com/upstash/upstash-redis/blob/main/examples/nodejs) + +#### Cloudflare Workers + +Cloudflare handles environment variables differently than nodejs. Please add +`UPSTASH_REDIS_REST_URL` and `UPSTASH_REDIS_REST_TOKEN` using +`wrangler secret put ...` or in the cloudflare dashboard. + +Afterwards you can create a redis instance: + +```ts +import { Redis } from "@upstash/redis/cloudflare" + +const redis = new Redis({ + url: , + token: , +}) + + +// or load directly from global env + +// service worker +const redis = Redis.fromEnv() + + +// module worker +export default { + async fetch(request: Request, env: Bindings) { + const redis = Redis.fromEnv(env) + // ... + } +} +``` + +- [Code example Wrangler 2](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers) +- [Code example Wrangler 1](https://github.com/upstash/upstash-redis/tree/main/examples/cloudflare-workers-with-wrangler-1) +- [Documentation](https://docs.upstash.com/redis/tutorials/cloudflare_workers_with_redis) + +#### Fastly + +Fastly introduces a concept called +[backend](https://developer.fastly.com/reference/api/services/backend/). You +need to configure a backend in your `fastly.toml`. An example can be found +[here](https://github.com/upstash/upstash-redis/blob/main/examples/fastly/fastly.toml). +Until the fastly api stabilizes we recommend creating an instance manually: + +```ts +import { Redis } from "@upstash/redis/fastly" + +const redis = new Redis({ + url: , + token: , + backend: , +}) +``` + +- [Code example](https://github.com/upstash/upstash-redis/tree/main/examples/fastly) +- [Documentation](https://blog.upstash.com/fastly-compute-edge-with-redi) + +#### Deno + +Examples: [Deno Deploy](https://deno.com/deploy), +[Netlify Edge](https://www.netlify.com/products/edge/) + +```ts +import { Redis } from "https://deno.land/x/upstash_redis/mod.ts" + +const redis = new Redis({ + url: , + token: , +}) + +// or +const redis = Redis.fromEnv(); +``` + +### Working with types + +Most commands allow you to provide a type to make working with typescript +easier. + +```ts +const data = await redis.get("key"); +// data is typed as `MyCustomType` +``` + +## Migrating to v1 + +### Explicit authentication + +The library is no longer automatically trying to load connection secrets from +environment variables. You must either supply them yourself: + +```ts +import { Redis } from "@upstash/redis" + +const redis = new Redis({ + url: , + token: , +}) +``` + +Or use one of the static constructors to load from environment variables: + +```ts +// Nodejs +import { Redis } from "@upstash/redis"; +const redis = Redis.fromEnv(); +``` + +```ts +// or when deploying to cloudflare workers +import { Redis } from "@upstash/redis/cloudflare"; +const redis = Redis.fromEnv(); +``` + +### Error handling + +Errors are now thrown automatically instead of being returned to you. + +```ts +// old +const { data, error } = await set("key", "value"); +if (error) { + throw new Error(error); +} + +// new +const data = await redis.set("key", "value"); // error is thrown automatically +``` + +## Pipeline + +`v1.0.0` introduces redis pipelines. Pipelining commands allows you to send a +single http request with multiple commands. + +```ts +import { Redis } from "@upstash/redis"; + +const redis = new Redis({ + /* auth */ +}); + +const p = redis.pipeline(); + +// Now you can chain multiple commands to create your pipeline: + +p.set("key", 2); +p.incr("key"); + +// or inline: +p.hset("key2", "field", { hello: "world" }).hvals("key2"); + +// Execute the pipeline once you are done building it: +// `exec` returns an array where each element represents the response of a command in the pipeline. +// You can optionally provide a type like this to get a typed response. +const res = await p.exec<[Type1, Type2, Type3]>(); +``` + +For more information about pipelines using REST see +[here](https://blog.upstash.com/pipeline). + +### Advanced + +A low level `Command` class can be imported from `@upstash/redis` in case you +need more control about types and or (de)serialization. + +By default all objects you are storing in redis are serialized using +`JSON.stringify` and recursively deserialized as well. Here's an example how you +could customize that behaviour. Keep in mind that you need to provide a `fetch` +polyfill if you are running on nodejs. We recommend +[isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch). + +```ts +import { Command } from "@upstash/redis/commands" +import { HttpClient } from "@upstash/redis/http" + +/** + * TData represents what the user will enter or receive, + * TResult is the raw data returned from upstash, which may need to be + * transformed or parsed. + */ +const deserialize: (raw: TResult) => TData = ... + +class CustomGetCommand extends Command { + constructor(key: string, ) { + super(["get", key], { deserialize }) + } +} + +const client = new HttpClient({ + baseUrl: , + headers: { + authorization: `Bearer ${}`, + }, +}) + +const res = new CustomGetCommand("key").exec(client) +``` + +### Additional information + +#### `keepalive` + +`@upstash/redis` is capable of reusing connections where possible to minimize +latency. Connections can be reused if the client is stored in memory and not +initialized with every new function invocation. The easiest way to achieve this +is by creating the client outside of your handler and adding an https agent: + +```ts +// Nextjs api route +import { Redis } from "@upstash/redis"; +import https from "https"; + +const redis = Redis.fromEnv({ + agent: new https.Agent({ keepAlive: true }), +}); + +export default async function (req, res) { + // use redis here +} +``` + +Whenever your hot lambda receives a new request the client is already +initialized and the previously established connection to upstash is reused. + +#### Javascript MAX_SAFE_INTEGER + +Javascript can not handle numbers larger than `2^53 -1` safely and would return +wrong results when trying to deserialize them. In these cases the default +deserializer will return them as string instead. This might cause a mismatch +with your custom types. + +```ts +await redis.set("key", "101600000000150081467"); +const res = await redis("get"); +``` + +In this example `res` will still be a string despite the type annotation. Please +keep that in mind and adjust accordingly. + ## Docs -See -[the documentation](https://docs.upstash.com/redis/sdks/javascriptsdk/getstarted) -for details. +See [the documentation](https://docs.upstash.com/features/javascriptsdk) for +details. ## Contributing diff --git a/examples/cloudflare-worker/.gitignore b/examples/cloudflare-workers-with-wrangler-1/.gitignore similarity index 100% rename from examples/cloudflare-worker/.gitignore rename to examples/cloudflare-workers-with-wrangler-1/.gitignore diff --git a/examples/cloudflare-worker/README.md b/examples/cloudflare-workers-with-wrangler-1/README.md similarity index 95% rename from examples/cloudflare-worker/README.md rename to examples/cloudflare-workers-with-wrangler-1/README.md index 1b6182c6..c3251bc3 100644 --- a/examples/cloudflare-worker/README.md +++ b/examples/cloudflare-workers-with-wrangler-1/README.md @@ -1,4 +1,4 @@ -# Cloudflare Worker Example +# Cloudflare Workers Example This example uses [Wrangler 1](https://developers.cloudflare.com/workers/wrangler/) to create a diff --git a/examples/cloudflare-worker/bindings.d.ts b/examples/cloudflare-workers-with-wrangler-1/bindings.d.ts similarity index 100% rename from examples/cloudflare-worker/bindings.d.ts rename to examples/cloudflare-workers-with-wrangler-1/bindings.d.ts diff --git a/examples/cloudflare-worker/build.js b/examples/cloudflare-workers-with-wrangler-1/build.js similarity index 100% rename from examples/cloudflare-worker/build.js rename to examples/cloudflare-workers-with-wrangler-1/build.js diff --git a/examples/cloudflare-worker/package.json b/examples/cloudflare-workers-with-wrangler-1/package.json similarity index 100% rename from examples/cloudflare-worker/package.json rename to examples/cloudflare-workers-with-wrangler-1/package.json diff --git a/examples/cloudflare-worker/src/index.ts b/examples/cloudflare-workers-with-wrangler-1/src/index.ts similarity index 100% rename from examples/cloudflare-worker/src/index.ts rename to examples/cloudflare-workers-with-wrangler-1/src/index.ts diff --git a/examples/cloudflare-worker-wrangler2/test.ts b/examples/cloudflare-workers-with-wrangler-1/test.ts similarity index 100% rename from examples/cloudflare-worker-wrangler2/test.ts rename to examples/cloudflare-workers-with-wrangler-1/test.ts diff --git a/examples/cloudflare-worker/tsconfig.json b/examples/cloudflare-workers-with-wrangler-1/tsconfig.json similarity index 100% rename from examples/cloudflare-worker/tsconfig.json rename to examples/cloudflare-workers-with-wrangler-1/tsconfig.json diff --git a/examples/cloudflare-worker/wrangler.toml b/examples/cloudflare-workers-with-wrangler-1/wrangler.toml similarity index 90% rename from examples/cloudflare-worker/wrangler.toml rename to examples/cloudflare-workers-with-wrangler-1/wrangler.toml index 60bb1ce1..a13e487e 100644 --- a/examples/cloudflare-worker/wrangler.toml +++ b/examples/cloudflare-workers-with-wrangler-1/wrangler.toml @@ -1,4 +1,4 @@ -name = "upstash-modules-worker" +name = "upstash-redis-with-wrangler-1" type = "javascript" workers_dev = true diff --git a/examples/cloudflare-worker-wrangler2/README.md b/examples/cloudflare-workers/README.md similarity index 100% rename from examples/cloudflare-worker-wrangler2/README.md rename to examples/cloudflare-workers/README.md diff --git a/examples/cloudflare-worker-wrangler2/index.js b/examples/cloudflare-workers/index.js similarity index 100% rename from examples/cloudflare-worker-wrangler2/index.js rename to examples/cloudflare-workers/index.js diff --git a/examples/cloudflare-worker-wrangler2/package.json b/examples/cloudflare-workers/package.json similarity index 91% rename from examples/cloudflare-worker-wrangler2/package.json rename to examples/cloudflare-workers/package.json index c87fee7c..c4c6a8e9 100644 --- a/examples/cloudflare-worker-wrangler2/package.json +++ b/examples/cloudflare-workers/package.json @@ -1,5 +1,5 @@ { - "name": "wrangler2", + "name": "cloudflare-workers", "version": "1.0.0", "description": "Example project using wrangler2", "author": "Andreas Thomas ", diff --git a/examples/cloudflare-worker/test.ts b/examples/cloudflare-workers/test.ts similarity index 87% rename from examples/cloudflare-worker/test.ts rename to examples/cloudflare-workers/test.ts index 158a75b4..88349c63 100644 --- a/examples/cloudflare-worker/test.ts +++ b/examples/cloudflare-workers/test.ts @@ -9,6 +9,9 @@ Deno.test("works", async () => { console.log({ deploymentURL }); const url = `${deploymentURL}/`; const res = await fetch(url); + if (res.status !== 200) { + console.log(await res.text()); + } assertEquals(res.status, 200); const json = (await res.json()) as { count: number }; assertEquals(typeof json.count, "number"); diff --git a/examples/cloudflare-worker-wrangler2/wrangler.toml b/examples/cloudflare-workers/wrangler.toml similarity index 83% rename from examples/cloudflare-worker-wrangler2/wrangler.toml rename to examples/cloudflare-workers/wrangler.toml index 6d51a082..8020e229 100644 --- a/examples/cloudflare-worker-wrangler2/wrangler.toml +++ b/examples/cloudflare-workers/wrangler.toml @@ -1,4 +1,4 @@ -name = "cloudflare-worker-wrangler2" +name = "upstash-redis" main = "index.js" compatibility_date = "2022-05-27"