@sproutboat/runtime 0.29.0 → 0.29.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @sproutboat/runtime
2
2
 
3
+ ## 0.29.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 65f03ae: Cold standalone builds are fast again. Runtime 0.29.0's Durable Object storage codec named
8
+ eight typed-array constructors, which linked each builtin into every app and added about
9
+ 7 s (45%) to an uncached build (16 s to 23 s for a one-line app on an M-series Mac). The
10
+ CLI's native-restore test passed its 600 s CI timeout.
11
+
12
+ From compatibility date `2026-10-28`, Durable Object storage round-trips `Uint8Array`,
13
+ `DataView` and `ArrayBuffer`. Any other typed array now throws a DataCloneError in
14
+ `put()` instead of being stored: keep its bytes in a `Uint8Array`. Before this change
15
+ they came back with the wrong type. Earlier dates are unchanged.
16
+
3
17
  ## 0.29.0
4
18
 
5
19
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutboat/runtime",
3
- "version": "0.29.0",
3
+ "version": "0.29.1",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -6805,19 +6805,11 @@ function __sbDOUnhex(text) {
6805
6805
  return out;
6806
6806
  }
6807
6807
 
6808
+ // Uint8Array and DataView only. Each other typed-array constructor named here links that
6809
+ // builtin into every app: the eight of them added about 7 s (45%) to a cold standalone
6810
+ // build. __sbDOPack refuses the other views instead of changing their type.
6808
6811
  function __sbDOView(name, bytes) {
6809
- const buf = bytes.buffer;
6810
- if (name === "Uint8Array") return bytes;
6811
- if (name === "Int8Array") return new Int8Array(buf);
6812
- if (name === "Uint8ClampedArray") return new Uint8ClampedArray(buf);
6813
- if (name === "Uint16Array") return new Uint16Array(buf);
6814
- if (name === "Int16Array") return new Int16Array(buf);
6815
- if (name === "Uint32Array") return new Uint32Array(buf);
6816
- if (name === "Int32Array") return new Int32Array(buf);
6817
- if (name === "Float32Array") return new Float32Array(buf);
6818
- if (name === "Float64Array") return new Float64Array(buf);
6819
- if (name === "DataView") return new DataView(buf);
6820
- return bytes;
6812
+ return name === "DataView" ? new DataView(bytes.buffer) : bytes;
6821
6813
  }
6822
6814
 
6823
6815
  // A value as JSON: null, booleans, strings and finite numbers are themselves; everything
@@ -6848,8 +6840,15 @@ function __sbDOPack(v, seen) {
6848
6840
  out.push(__sbDOPack(x, seen));
6849
6841
  });
6850
6842
  } else if (v instanceof ArrayBuffer) out = ["AB", __sbDOHex(new Uint8Array(v))];
6851
- else if (ArrayBuffer.isView(v))
6852
- out = ["V", Object.prototype.toString.call(v).slice(8, -1), __sbDOHex(new Uint8Array(v.buffer, v.byteOffset, v.byteLength))];
6843
+ else if (ArrayBuffer.isView(v)) {
6844
+ const name = Object.prototype.toString.call(v).slice(8, -1);
6845
+ if (name !== "Uint8Array" && name !== "DataView") {
6846
+ const error = new Error(name + " is not supported in Durable Object storage here yet; store a Uint8Array of its bytes.");
6847
+ error.name = "DataCloneError";
6848
+ throw error;
6849
+ }
6850
+ out = ["V", name, __sbDOHex(new Uint8Array(v.buffer, v.byteOffset, v.byteLength))];
6851
+ }
6853
6852
  else if (v instanceof RegExp) out = ["R", v.source, v.flags];
6854
6853
  else if (Array.isArray(v)) {
6855
6854
  out = ["A"];