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
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,10 +113,18 @@ Parcel added a [data url](https://parceljs.org/features/bundle-inlining/#inlinin
113
113
importbackgroundfrom"data-url:./background.png";
114
114
```
115
115
116
+
Moddable added a [Resource](https://www.moddable.com/documentation/files/files#resource) class to inline a host buffer for embedded systems
117
+
118
+
```js
119
+
let resource =newResource("logo.bmp");
120
+
```
121
+
116
122
### What about ArrayBuffer vs Uint8Array?
117
123
118
124
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.
119
125
126
+
This is currently being discussed in https://github.com/styfle/proposal-import-bytes/issues/5
127
+
120
128
### What about Blob vs Uint8Array?
121
129
122
130
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.
0 commit comments