arm64js 0.7.0 → 0.8.0

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.
@@ -1,6 +1,7 @@
1
1
  // A guest connection to `host.internal` as a byte stream. Writes wait while
2
2
  // `HOST_CONN_WINDOW` bytes are unacknowledged; guest bytes are acknowledged only
3
- // when read, so a slow page slows the guest.
3
+ // when read, so a slow page slows the guest. The page's side ends by itself once
4
+ // the page has read to the guest's end, as a Node socket's does.
4
5
  import { Arm64JSError, HOST_CONN_CHUNK, HOST_CONN_WINDOW } from '@arm64js/protocol';
5
6
  /** One TCP connection the guest opened to `host.internal:<port>`. */
6
7
  export class Connection {
@@ -45,6 +46,10 @@ export class Connection {
45
46
  }
46
47
  if (this.remoteEnded || this.isClosed) {
47
48
  controller.close();
49
+ // The guest has ended and the page has seen it: end the page's side
50
+ // too, after the writes already made. A page that forgot `end()`
51
+ // would otherwise keep the connection, and its buffers in the VM.
52
+ void this.end();
48
53
  return;
49
54
  }
50
55
  await this.waitForChange();
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "0.7.0";
1
+ export declare const VERSION = "0.8.0";
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by scripts/stamp-version.mjs from package.json. Do not edit.
2
- export const VERSION = "0.7.0";
2
+ export const VERSION = "0.8.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arm64js",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "Run a Linux VM inside your web page. Boots Alpine from the arm64js CDN, runs commands, keeps snapshots in the browser.",
5
5
  "type": "module",
6
6
  "license": "MIT",