Jarred Sumner
a31eb6a80c
Add missing getRandomValues to crypto polyfill
2022-09-14 19:15:05 -07:00
Jarred Sumner
a291c1676f
5x faster crypto.randomValues()
2022-09-14 18:23:22 -07:00
Jarred Sumner
7bfa302b75
Make crypto.getRandomValues() faster + fix > 1 byte/element typed arrays
...
Fix crypto.getRandomValues() with > 1 byte element typed arrays
Fixes https://github.com/oven-sh/bun/issues/1237
2022-09-14 04:12:32 -07:00
Jarred Sumner
0935ab14d6
Fix Linux 200ms http client delay
...
https://man7.org/linux/man-pages/man2/send.2.html See the section on MSG_MORE
2022-09-13 17:47:50 -07:00
Jarred Sumner
2b02f7eb99
Fix bug with Buffer.from([123], "utf8")
...
cc @worm-emoji
2022-09-11 17:11:11 -07:00
Jarred Sumner
71e2c26577
Resolve rope strings in dynamic import paths
...
Fixes https://github.com/oven-sh/bun/issues/1230
2022-09-11 15:30:21 -07:00
Jarred Sumner
b78b36ce33
Fix build issue on Linux?
2022-09-11 15:01:57 -07:00
Jarred Sumner
0130efeedf
Hardcode localhost on macOS
2022-09-11 14:59:48 -07:00
Jarred Sumner
9a5aa059f9
New HTTP client ( #1231 )
...
* wip
* It mostly works!
* Support `bun install`
* Support `bun create`
* Support chunked transfer encoding
* Handle Keep Alive when redirecting to a different domain
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com >
2022-09-11 13:37:17 -07:00
Zilin Zhu
8b91360a33
Fix segfault due to GC and some more helper functions ( #1221 )
...
* Fix segfault due to GC and some more helper functions
* fix upon reviews
* add visitChildren
2022-09-09 22:48:55 -07:00
Jarred Sumner
c600196b1a
[node:fs] Fix readFileSync on non-regular files
...
Fixes https://github.com/oven-sh/bun/issues/1220
2022-09-09 19:26:02 -07:00
Jarred Sumner
3d8edcb77b
Fix potential crash when returning an empty string
2022-09-09 19:20:24 -07:00
Jarred Sumner
f496740c19
[bun:ffi] Add f32, f64, i64, u64 to read`
2022-09-09 18:10:36 -07:00
Jarred Sumner
0c2a207d82
Fix failing tests after ptr change
2022-09-09 17:19:34 -07:00
Jarred Sumner
e9c456ff5c
[breaking][bun:ffi] Change the pointer representation to be a 52-bit integer
...
Storing the pointer this way enables DOMJIT to be used with a new API in `bun:ffi` that lets you efficiently read values from a pointer without creating a new `DataView`
```js
import {read} from 'bun:ffi';
const myPtr = myFunctionThatReturnsAPtr();
// new:
const value = read.u32(myPtr, 0);
// old:
const view = new DataView(toArrayBuffer(myPtr));
const otherValue = view.getUint32(0, true);
```
cc @bwasti this might be a breaking change for that call to `napi_add_finalizer`
2022-09-09 03:12:03 -07:00
Jarred Sumner
bcbe1b410a
Last commit was missing some code
2022-09-08 23:37:59 -07:00
Jarred Sumner
206820d27a
[bun:ffi] Implement read.{u8,i8,i16,i32,u16,u32,ptr,intptr}
...
`read` in `bun:ffi` lets you read data from a pointer without creating a new DataView/ArrayBufferView
```
import {read} from 'bun:ffi';
expect(read.i8(ptr_, i)).toBe(view.getInt8(i, true));
expect(read.i16(ptr_, i)).toBe(view.getInt16(i, true));
expect(read.i32(ptr_, i)).toBe(view.getInt32(i, true));
expect(read.u8(ptr_, i)).toBe(view.getUint8(i, true));
expect(read.u16(ptr_, i)).toBe(view.getUint16(i, true));
expect(read.u32(ptr_, i)).toBe(view.getUint32(i, true));
}
```
2022-09-08 23:29:30 -07:00
Zilin Zhu
8d8b72cf3f
Add native helper functions for Readable and convert ReadableState properties to getter/setter ( #1218 )
2022-09-08 19:52:27 -07:00
Jarred Sumner
a3cc9aaf6f
Make some more globals modifiable
2022-09-08 00:00:18 -07:00
Jarred Sumner
812424bf46
Fix crash with file descriptor
2022-09-07 21:21:18 -07:00
Jarred Sumner
970600724d
Helper for seeing if a File Blob is seekable
2022-09-07 21:06:00 -07:00
Jarred Sumner
c038f513d3
[Bun.write] clean up some error handling
2022-09-07 20:59:51 -07:00
Jarred Sumner
1e5978ad4f
Bun.write - only truncate if its a path string
2022-09-07 19:59:49 -07:00
Jarred Sumner
d7759b88ee
Handle default better with ESM node
2022-09-07 19:56:11 -07:00
Jarred Sumner
25e4fcf5c8
Fast path for Bun.write with short-ish strings & typed arrays
...
Helps with https://github.com/oven-sh/bun/issues/646 but does not fully fix
2022-09-07 19:54:51 -07:00
Jarred Sumner
ce382788b0
Mild perf improvement for bindings
2022-09-07 19:53:49 -07:00
Jarred Sumner
c7874ed3fe
Fix issue with loading bundled entry points
2022-09-07 00:18:25 -07:00
Jarred Sumner
6e9159a9ad
workaround test failure
2022-09-06 20:59:18 -07:00
Jarred Sumner
dda23a6076
Move some things to the stack
2022-09-06 18:32:16 -07:00
Jarred Sumner
8d71a931a3
Add a helper for static strings
2022-09-06 18:31:20 -07:00
Jarred Sumner
0a67d7e951
[Bun.plugin] Fix validating loader
2022-09-06 17:38:08 -07:00
Jarred Sumner
52f3377d9e
[Bun.plugin] Throw an error when the loader is invalid
2022-09-06 17:32:00 -07:00
Jarred Sumner
b24a9b29d7
Fix potential crash when resolving package.json "exports"
...
Have not seen a crash happen here yet
2022-09-06 17:25:22 -07:00
Jarred Sumner
bac93e14ad
Fix bug with macros
2022-09-06 17:24:45 -07:00
Jarred Sumner
1454e448e6
[Bun.plugin] Allow slashes in namespaces
2022-09-06 17:24:39 -07:00
Jarred Sumner
c2f59e72d6
Rename LinkerMap to Aliases to be less confusing
2022-09-06 07:23:05 -07:00
Jarred Sumner
7a5cfc4bae
Return a Buffer object for fs.readFile
2022-09-06 07:22:52 -07:00
Jarred Sumner
f5129dbd1a
Fix issue with process esm node export
2022-09-06 07:22:25 -07:00
Jarred Sumner
07cbc0193a
Set a default Loader based on filename
2022-09-06 07:22:14 -07:00
Jarred Sumner
1c1346dfa9
Add node:assert to list of hardcoded modules to fix ESM compat issue
2022-09-06 07:21:49 -07:00
Jarred Sumner
93cfc7edbb
preserve statements when generating a separate module for bun plugin
2022-09-06 03:37:58 -07:00
Jarred Sumner
5b6a2d9efe
Loosen-up the streams polyfill
2022-09-06 03:37:58 -07:00
Jarred Sumner
5ddfd912ef
Add @ to acceptable namespace characters
2022-09-06 03:37:58 -07:00
Jarred Sumner
e9cc9ae816
Make the plugins a little more resilient
2022-09-06 03:37:58 -07:00
Jarred Sumner
ba2a7d72e7
Add missing Blob
2022-09-06 03:37:58 -07:00
Jarred Sumner
308affdcf0
Make fs extensible
2022-09-06 03:37:58 -07:00
Jarred Sumner
07e2c898c6
Fix crash in Buffer module
2022-09-06 03:37:58 -07:00
Zilin Zhu
b9fad14f87
Add native ReadableState ( #1210 )
...
* use functionSpace for JSStringDecoderConstructor and fix console.log on prototype
* Add native ReadableState
* move kPaused to class property
2022-09-06 00:57:16 -07:00
Jarred Sumner
5a71521021
[Bun.plugin] Clean up exception handling
2022-09-05 23:43:34 -07:00
Jarred Sumner
11aa17a57c
Support async onLoad callbacks in Bun.plugin
2022-09-05 23:05:22 -07:00