You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,3 +94,17 @@ Bun 1.1.5 added a similar feature in [April 2024](https://bun.sh/blog/bun-v1.1.5
94
94
```js
95
95
importhtmlfrom"./index.html" with { type: "text" };
96
96
```
97
+
98
+
### What about ArrayBuffer vs Uint8Array?
99
+
100
+
Both are viable solutions. Uint8Array matches the [Response.bytes()](https://developer.mozilla.org/en-US/docs/Web/API/Response/bytes) method return type as well as [Deno's implementation](https://deno.com/blog/v2.4#importing-text-and-bytes). Uint8Array is also compatible with [Node.js Buffer](https://nodejs.org/api/buffer.html#buffer) which makes it widely compatible with existing JavaScript code.
101
+
102
+
### What about Blob vs Uint8Array?
103
+
104
+
Blob is part of the W3C [File API](https://www.w3.org/TR/FileAPI/), not part of JavaScript so it is not a viable solution to include in a TC39 Proposal. Blob also includes a type and is immutable.
105
+
106
+
### What about mutable vs immutable?
107
+
108
+
Both are viable solutions. Mutable would match the behavior of existing imports from [roposal-import-attributes](https://github.com/tc39/proposal-import-attributes) but there is still a possibility of making `bytes` default to immutable given the [proposal-immutable-arraybuffer](https://github.com/tc39/proposal-immutable-arraybuffer).
109
+
110
+
Ideally there would be a separate proposal for a new `immutable` attribute.
0 commit comments