beam.com 0.1.0-rc.2 → 0.1.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/js/beam.com.mjs +37 -6
- package/js/download.mjs +31 -4
- package/js/node.mjs +8 -3
- package/js/wrangler.mjs +47 -0
- package/package.json +1 -1
- package/runtime/beam.mjs +1 -1
- package/runtime/beam.wasm +0 -0
- package/runtime/browser.js +8 -7
- package/runtime/cloudflare/durable.js +32 -2
- package/runtime/cloudflare/index.js +15 -4
- package/runtime/cloudflare/worker.js +907 -83
- package/runtime/deno/worker.js +907 -83
- package/runtime/deno.js +2 -0
- package/runtime/durable.js +32 -2
- package/runtime/global.js +6 -3
- package/runtime/page/beam.mjs +1 -1
- package/runtime/page/browser.js +8 -7
- package/runtime/page/runtime-id.js +1 -1
- package/runtime/page/worker.js +907 -83
- package/runtime/release.json +1 -1
- package/runtime/runtime-id.js +1 -1
- package/runtime/worker.js +907 -83
package/runtime/page/browser.js
CHANGED
|
@@ -86,14 +86,15 @@ if (globalThis.caches && !caches.default) {
|
|
|
86
86
|
|
|
87
87
|
// A request to the app. A Request of a page drops the headers Upgrade and
|
|
88
88
|
// Sec-*, so the request is an object with the fields that worker.js reads,
|
|
89
|
-
// and a Headers of its own.
|
|
89
|
+
// and a Headers of its own. The body is a stream, as the body of a Request
|
|
90
|
+
// (bridgeUpload of worker.js reads it in parts), with its size.
|
|
90
91
|
function request(url, { method = 'GET', headers = {}, body = null } = {}) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
};
|
|
92
|
+
const h = new Headers(headers);
|
|
93
|
+
if (body != null && !h.has('content-length')) {
|
|
94
|
+
const size = typeof body === 'string' ? new TextEncoder().encode(body).length : body.byteLength ?? body.size;
|
|
95
|
+
if (size !== undefined) h.set('content-length', String(size));
|
|
96
|
+
}
|
|
97
|
+
return { url: url.href, method, headers: h, body: body == null ? null : new NativeResponse(body).body };
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
// A reader of the bytes of the file of url (app-com.js): one range for each
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// The identity of this runtime (beam_com_wasm:runtime_id/1): the SHA-256 of
|
|
2
2
|
// the output of "sha256sum app-com.js beam.mjs beam.wasm worker.js".
|
|
3
|
-
export default '
|
|
3
|
+
export default '6f6148b7c684c1118b9033a0e895df5091e4e0d063aef93417fa882c5fe3ceee';
|