Skip to content

Commit e01825a

Browse files
Standard Wasm abbreviation. Remove presigned url example. Include bundle.deno.dev reference. Update roadmap.
1 parent 4665b10 commit e01825a

File tree

11 files changed

+38
-199
lines changed

11 files changed

+38
-199
lines changed

cli/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export type Isolation = 'none' | 'isolate';
182182
### Bindings
183183

184184
Each [Script](#script) can have a bindings object which is keyed by binding name. Bindings give access to Environment
185-
Variables as well as Workers KV and Durable Object namespaces, Service Bindings, WASM Modules, and R2 Buckets.
185+
Variables as well as Workers KV and Durable Object namespaces, Service Bindings, Wasm Modules, and R2 Buckets.
186186

187187
```ts
188188
/** Binding definition for a worker script environment variable */

cli/push.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ By default, it will push once, but you can pass `--watch` to push on every chang
1212

1313
<Aside>
1414

15-
Learn how to use `denoflare serve` in the [Publish a Worker Guide](/guides/push).
15+
Learn how to use `denoflare push` in the [Publish a Worker Guide](/guides/push).
1616

1717
</Aside>
1818

@@ -41,7 +41,7 @@ OPTIONS:
4141
--secret-binding <name:secret-text>... Secret text environment variable binding, overrides config
4242
--kv-namespace-binding <name:namespace-id>... KV namespace environment variable binding, overrides config
4343
--do-namespace-binding <name:namespace-name:class-name>... DO namespace environment variable binding, overrides config
44-
--wasm-module-binding <name:path-to-local-wasm-file>... WASM module environment variable binding, overrides config
44+
--wasm-module-binding <name:path-to-local-wasm-file>... Wasm module environment variable binding, overrides config
4545
--service-binding <name:service:environment>... Service environment variable binding, overrides config
4646
--r2-bucket-binding <name:bucket-name>... R2 bucket environment variable binding, overrides config
4747

cli/serve.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ OPTIONS:
4141
--secret-binding <name:secret-text>... Secret text environment variable binding, overrides config
4242
--kv-namespace-binding <name:namespace-id>... KV namespace environment variable binding, overrides config
4343
--do-namespace-binding <name:namespace-name:class-name>... DO namespace environment variable binding, overrides config
44-
--wasm-module-binding <name:path-to-local-wasm-file>... WASM module environment variable binding, overrides config
44+
--wasm-module-binding <name:path-to-local-wasm-file>... Wasm module environment variable binding, overrides config
4545
--service-binding <name:service:environment>... Service environment variable binding, overrides config
4646
--r2-bucket-binding <name:bucket-name>... R2 bucket environment variable binding, overrides config
4747

examples/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ order: 3
77

88
- [Webtail for Cloudflare Workers](/examples/webtail) - View live requests and logs from Cloudflare Workers from the comfort of your browser.
99

10-
- [Transform Images with WASM in a Cloudflare Worker](/examples/transform-images-wasm) - Using WebAssembly from Photon and pngs.
10+
- [Transform Images with Wasm in a Cloudflare Worker](/examples/transform-images-wasm) - Using WebAssembly from Photon and pngs.

examples/r2-presigned-urls.md

Lines changed: 0 additions & 178 deletions
This file was deleted.

examples/transform-images-wasm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: Transform Images with WASM
3-
summary: Transform Images with WASM in a Cloudflare Worker, using WebAssembly from Photon and pngs.
2+
title: Transform Images with Wasm
3+
summary: Transform Images with Wasm in a Cloudflare Worker, using WebAssembly from Photon and pngs.
44
order: 2
55
---
66

7-
# Transform Images with WASM in a Cloudflare Worker
7+
# Transform Images with Wasm in a Cloudflare Worker
88

99
Prototype demonstrating running image resizing and other transforms completely inside a Cloudflare Worker.
1010

images/deno-bundle.png

178 KB
Loading

index.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ summary: Develop, test, and deploy Cloudflare Workers with Deno
66
# Overview
77
Develop, test, and deploy [Cloudflare Workers](https://workers.cloudflare.com) with [Deno](https://deno.land)
88

9-
<Aside header="New in v0.5.0">
9+
<Aside header="New in v0.5.0+">
1010

1111
Support for [Cloudflare R2](https://developers.cloudflare.com/r2/)
1212

@@ -53,17 +53,29 @@ Denoflare is still under active initial development (pre 1.0), but is completely
5353

5454
[Releases](https://github.com/skymethod/denoflare/releases)
5555

56-
After getting this documentation site ([denoflare.dev](https://denoflare.dev)) hosted on Cloudflare Pages generated by `denoflare site`, the next focus is fleshing out unimplemented parts of the local dev Workers emulation environment, making it handle even the most complicated worker scenarios.
56+
The core `serve`, `push`, `site`, and `analytics` subcommands have been stable for while, so the focus at the moment is to provide first-class support for the expanding suite of Cloudflare's platform products such as:
57+
- [Cloudflare R2](https://developers.cloudflare.com/r2/)
58+
- [Cloudflare Pub/Sub](https://developers.cloudflare.com/pub-sub)
59+
- [Workers Analytics Engine](https://developers.cloudflare.com/analytics/analytics-engine/)
60+
- [Cloudflare D1](https://blog.cloudflare.com/introducing-d1/)
5761

5862
Join the project over on [the Denoflare GitHub repo](https://github.com/skymethod/denoflare).
5963

6064
## Made with Denoflare
6165
These projects are known to have used `denoflare` for development.
6266

63-
[webtail.denoflare.dev · Watch live requests and logs for your Cloudflare Workers in the browser!](https://webtail.denoflare.dev)
67+
#### webtail.denoflare.dev
68+
69+
[Watch live requests and logs for your Cloudflare Workers in the browser!](https://webtail.denoflare.dev)
6470

6571
<img src="/images/webtail.png" class="large-img" style="margin: auto">
6672

73+
#### bundle.deno.dev
74+
75+
[deno bundle as a service](https://bundle.deno.dev/)
76+
77+
<img src="/images/deno-bundle.png" class="large-img" style="margin: auto">
78+
6779
## Support this project
6880
Contributions to help fund ongoing development of Denoflare are welcome and appreciated!
6981

r2/index.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ In the meantime, since making a bucket public for reading is so common, we've ma
2626

2727
<Button type="primary" href="/examples/r2-public-read">Learn more</Button>
2828

29-
## Easily make your R2 bucket readable via presigned URLs
29+
## Generate presigned URLs to your R2 buckets
3030

3131
Another common use-case for cloud storage is to make files available, but only to authenticated users via expiring URLs that are presigned.
3232

33-
This feature will eventually be supported in R2 directly, but in the meantime, we've made another open-source utility worker available to support this.
34-
Set up access with `denoflare r2 generate-credentials`, then a one-time `denoflare push` command to deploy it to your own account and zone (via [Custom Domains for Workers](https://blog.cloudflare.com/custom-domains-for-workers/)), no git commands or any other tools necessary.
33+
R2 now supports this feature directly, use the Denoflare CLI to generate presigned urls using your already configured credentials
3534

36-
<Button type="primary" href="/examples/r2-presigned-urls">Learn more</Button>
35+
TODO
36+
37+
<Button type="primary" href="TODO">Learn more</Button>
3738

3839
## Track R2 costs and usage
3940

reference/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ order: 5
55

66
# Reference
77

8-
- [WebAssembly/WASM with Denoflare](/reference/wasm) - Information about serving and publishing workers with WebAssembly/WASM components.
8+
- [WebAssembly/Wasm with Denoflare](/reference/wasm) - Information about serving and publishing workers with WebAssembly/Wasm components.

reference/wasm.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
---
22
order: 1
3-
summary: WebAssembly/WASM with Denoflare
3+
summary: WebAssembly/Wasm with Denoflare
44
type: overview
55
---
66

7-
# WebAssembly/WASM
7+
# WebAssembly/Wasm
88

99
Cloudflare Workers supports running small WebAssembly modules within either [script-based](https://blog.cloudflare.com/webassembly-on-cloudflare-workers/) or [module-based](https://blog.cloudflare.com/workers-javascript-modules/#are-there-non-javascript-modules) workers.
1010

1111
Denoflare provides a simple way to serve and deploy workers with WebAssembly components, building on Deno's [built-in WebAssembly support](https://deno.land/manual@v1.22.0/webassembly).
1212

1313
## Module-based workers
1414

15-
For module-based Cloudflare Workers, Cloudflare requires WASM to be specified with an ES6 import of the form `import module from "./hello.wasm"` (`module` is then a [WebAssembly.Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module)).
15+
For module-based Cloudflare Workers, Cloudflare requires Wasm to be specified with an ES6 import of the form `import module from "./hello.wasm"` (`module` is then a [WebAssembly.Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module)).
1616

1717
Since this is not valid in browsers/Deno, nor valid under the [proposed WebAssembly/ES Module Integration](https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration#webassemblyes-module-integration), Denoflare needs to slighty modify the standard bundled module worker it uploads to Cloudflare during a `denoflare push`.
1818

1919
It also needs to have syntax that will run in `denoflare serve` in both local isolation modes, as well incorporate well into other Deno projects unrelated to Denoflare.
2020

21-
To accomplish this, Denoflare provides a special function called `importWasm` that will load WASM properly in Deno and both modes of `denoflare serve`, and will be rewritten during `denoflare push` to the syntax required by Cloudflare. `importWasm` is just a [small standard Deno function](https://github.com/skymethod/denoflare/blob/v0.5.2/common/import_wasm.ts), it builds on [import.meta.url](https://deno.land/manual/examples/module_metadata) and Deno's recent support for local file:// `fetch`.
21+
To accomplish this, Denoflare provides a special function called `importWasm` that will load Wasm properly in Deno and both modes of `denoflare serve`, and will be rewritten during `denoflare push` to the syntax required by Cloudflare. `importWasm` is just a [small standard Deno function](https://github.com/skymethod/denoflare/blob/v0.5.2/common/import_wasm.ts), it builds on [import.meta.url](https://deno.land/manual/examples/module_metadata) and Deno's recent support for local file:// `fetch`.
2222

2323
*worker.ts*
2424
```ts
@@ -48,7 +48,7 @@ See the [hello-wasm-worker example](https://github.com/skymethod/denoflare/blob/
4848

4949
## Script-based workers
5050

51-
For the older script-based Cloudflare Workers, WebAssembly modules are injected using [global environment variable variable bindings](https://developers.cloudflare.com/workers/platform/environment-variables).
51+
For the older script-based Cloudflare Workers, WebAssembly modules are injected using [global environment variable bindings](https://developers.cloudflare.com/workers/platform/environment-variables).
5252

5353
Define your environment variable name and `wasmModule` in the script's `bindings` section in your [.denoflare configuration file](/cli/configuration), then use the injected global variable at runtime, it will be a [WebAssembly.Module](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module).
5454

@@ -82,3 +82,7 @@ async function safeHandleRequest(event) {
8282
}
8383
}
8484
```
85+
86+
## More
87+
88+
- See [Transform Images with Wasm](/examples/transform-images-wasm) for a larger example of using an existing Wasm library inside a worker.

0 commit comments

Comments
 (0)