aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-10-14Merge branch 'main' into sdlsdlGravatar Dylan Conway 40-102/+2800
2023-10-13fix(error): correct the `path` field in syscall error message. (#6370)Gravatar Ai Hoshino 1-6/+23
* fix(error): correct the `path` field in syscall error message. Close: #6336 * fix pathlike union case
2023-10-13Fix dns.lookup returning wrong address for family (#6474)Gravatar Ashcon Partovi 1-3/+4
* Fix #6452 * Fix formatting
2023-10-12Upgrade zig to 0.12.0-dev.888+130227491 (#6471)Gravatar dave caruso 4-13/+15
* update build.zig * save * works? * better workaround * fix install * Fix compiler crash
2023-10-12fix(install): re-evaluate overrides when removedbun-v1.0.6Gravatar dave caruso 1-0/+0
2023-10-11Bump WebKitGravatar Jarred Sumner 1-0/+0
2023-10-11Update JSCUSocketsLoopIntegration.cppGravatar Dylan Conway 1-2/+2
2023-10-11feat(install): automatically migrate package-lock.json to bun.lockb (#6352)bun-v1.0.5Gravatar dave caruso 1-1/+19
* work so far * stuff * a * basics work * stuff * yoo * build lockfile * correct * f * a * install fixture havent tested * i made it worse * lol * be more reasonable * make the test easier to pass because bun install doesn't handle obscure lockfile edge cases :/ * a * works now * ok * a * a * cool * nah * fix stuff * l * a * idfk * LAME * prettier errors * does this fix tests? * Add more safety checks to Integrity * Add another check * More careful lifetime handling * Fix linux debugger issue * a * tmp dir and snapshot test --------- Co-authored-by: Jarred SUmner <jarred@jarredsumner.com>
2023-10-10feat(test): implement `toEqualIgnoringWhitespace` (#6293)Gravatar Elad Bezalel 4-0/+116
* feat(test): implement `toEqualIgnoringWhitespace` * equality check in matcher & incorrect arg error
2023-10-10make peer dependencies install by default (#6396)Gravatar Dylan Conway 1-0/+2
* peer dependencies * default true * add test * cleanup * some tests * skip peer deps if they are non optional * remove debug print, fix build * iterate peer dependencies
2023-10-09hex colorsGravatar Dylan Conway 1-13/+86
2023-10-09fix(AbortSignal/fetch) fix AbortSignal.timeout, fetch lock behavior and ↵Gravatar Ciro Spaciari 9-23/+50
fetch errors (#6390) * fix abort signal and fetch error * fix fetch error and lock behavior
2023-10-09fix: support uint8 exit code range (#6303)Gravatar Liz 1-2/+2
The exit code support is between 0-255 and not only in the signed positive range (0-127). Node.js does not seam to throw on a bigger integer and just wraps around, but throwing a error is a good approach and makes the behaviour more defined. This allows the range to be 0-255 Fixes: https://github.com/oven-sh/bun/issues/6284
2023-10-09keep color in `u32`Gravatar Dylan Conway 1-194/+236
2023-10-09renameGravatar Dylan Conway 3-69/+73
2023-10-092d rendering contextGravatar Dylan Conway 11-65/+1537
2023-10-07canvas classGravatar Dylan Conway 14-67/+637
2023-10-07feat(KeyObject) (#5940)Gravatar Ciro Spaciari 23-52/+2567
* oops * createSecretKey but weird error * use the right prototype, do not add a function called export lol * HMAC JWT export + base64 fix * Fix Equals, Fix Get KeySize, add complete export RSA * fix RSA export * add EC exports * X25519 and ED25519 export + fixes * fix default exports * better asymmetricKeyType * fix private exports * fix symmetricKeySize * createPublicKey validations + refactor * jwt + der fixes * oopsies * add PEM into createPublicKey * cleanup * WIP * bunch of fixes * public from private + private OKP * encrypted keys fixes * oops * fix clear tls error, add some support to jwk and other formats on publicEncrypt/publicDecrypt * more fixes and tests working * more fixes more tests * more clear hmac errors * more tests and fixes * add generateKeyPair * more tests passing, some skips * fix EC key from private * fix OKP JWK * nodejs ignores ext and key_ops on KeyObject.exports * add EC sign verify test * some fixes * add crypto.generateKeyPairSync(type, options) * more fixes and more tests * fix hmac tests * jsonwebtoken tests * oops * oops2 * generated files * revert package.json * vm tests * todos instead of failues * toBunString -> toString * undo simdutf * improvements * unlikely * cleanup * cleanup 2 * oops * move _generateKeyPairSync checks to native
2023-10-05WebCryptoAPI: remove JWK "EdDSA" alg checks (#6294)Gravatar Filip Skokan 1-2/+0
2023-10-04fix os test failureGravatar Dylan Conway 1-0/+3
2023-10-04Create `AbortSignal` without JS (#6278)Gravatar Jarred Sumner 4-15/+24
* Create `AbortSignal` without JS * Don't leak --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-03Upgrade webkit (#6277)Gravatar Dylan Conway 4-10/+14
* `reportExtraMemoryAllocated` parameters changed * bump webkit * Update Dockerfile * format
2023-10-03compat: Buffer: allow optional positional arguments to be undefined (#4911)Gravatar Andrey Smirnov 1-14/+51
* fix `Buffer` compat with Node.js: compare * fix `Buffer` compat with Node.js: copy
2023-10-03fix(blob): Add the current offset to the new blob. (#6259)Gravatar Ai Hoshino 1-1/+2
Close: #6252
2023-10-03feat(encoding): support BOM detection with test passed (#6074)Gravatar WingLim 4-7/+47
2023-10-02Set `fetch` timeout to 5 minutes (#6217)Gravatar Jarred Sumner 1-2/+13
* Increase timeouts * Update uws.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-02Warn at start when using AVX build of Bun without AVX support (#6242)Gravatar Jarred Sumner 1-1/+28
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-10-01fix(node:process): fix return value of `process.kill` (#6207)Gravatar Ai Hoshino 1-1/+1
2023-09-29Implement virtual module support in `Bun.plugin` (#6167)Gravatar Jarred Sumner 10-108/+361
* Add support for `build.module` in `Bun.plugin` * Another test * Update docs * Update isBuiltinModule.cpp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2023-09-29fix(runtime): followup for `server.requestIP` (#6185)Gravatar dave caruso 3-6/+8
* fix(runtime): followup for `server.requestIP` * oops * yeah * sure * Update src/deps/libuwsockets.cpp * Update Dockerfile * lol --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com> Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-29fix: don't set default request method when creating a Request (#6154)Gravatar Liz 1-13/+14
In the case of creating a Request with the parameters `(Request, object)`, there was a bug that method and headers are set from the default created by the init rather then the already present value from the request param. This is because for a to me unknown reason the order in which the parameters are processed is reversed. This fixes that by adding a check which stops the defaults from being set, unless they are explicitly passed. Fixes: https://github.com/oven-sh/bun/issues/6144
2023-09-29fix(resolver): support encoded file urls (#5766)Gravatar dave caruso 6-32/+87
* start working on this * it works now * better implementation imo * yippee * more tests and better unrefing * fix leak?
2023-09-29feat(runtime): implement `server.requestIp` + node:http `socket.address()` ↵Gravatar dave caruso 9-26/+354
(#6165) * [server] requestIp and AnyRequestContext Changed Request.uws_request to the new AnyRequestContext. This allows grabbing the IP from a Request. Unfinished. * [server] basic `requestIp` implementation Currently using uws's requestIpAsText, which always returns a ipv6 string. We should return a `SocketAddress` object to the user instead, which will contain the formatted address string and what type it is. We'll have to use requestIpAsBinary and parse that ourselves. * TypeScript docs, use `bun.String`, return `undefined` instead of `null` if we can't get the ip. * binary address formatting * uws getRemoteAddress binding * remove dead code * working * final touches:sparkles: * I will abide by the results of this poll. --------- Co-authored-by: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com>
2023-09-28Upgrade to latest Node.js version (#6158)Gravatar Jarred Sumner 1-5/+5
* Upgrade to latest reported Node.js version * Upgrade --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-28Reduce memory usage of HTTP server (#6135)Gravatar Jarred Sumner 3-18/+32
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-28Revert WebKit submodule to where it should beGravatar dave caruso 1-0/+0
2023-09-28Revert "Update prisma guide"Gravatar Colin McDonnell 1-0/+0
This reverts commit e62fef67658240a4137320729ff26e09498a93fd.
2023-09-28Update prisma guideGravatar Colin McDonnell 1-0/+0
2023-09-28Get Next.js Pages Router to work (#6095)Gravatar dave caruso 8-115/+169
* hell * make it so bun-debug-src * teag * wild * yippee * fas * fix async hooks assertions * yap * yeah that's wild * aa * a * increase time allowed * so trivial
2023-09-27Complete rework of the majority of `node:util`, primarily `util.inspect` (#4493)Gravatar jhmaster 1-1/+4
* 1st revision of new util.inspect impl. (not done) * fix util.types.isArrayBuffer * fix some utl tests and bugs * fix node:tty missing primordials * fix utl stackoverflow handling & some tests * narrow down diff. context test * util.inspect indirect circulars optimization * temp workaround for buggy is...Function checks * impl. Map/Set/Iterator entries inspection * fix bigint & symbol objects inspection * error inspection fixes * misc util tests stuff * inline getExternalValue stub * leftovers * util.inspect promise internals * run bun fmt * commit make js changes * cut out unnecessary utl files * reorganize utl folder structure * remove browserify buffer check * Try to revert git messing up uws somehow This reverts commit 2c27e16e7d361657b9c3a7dc7892117cf31e15ee. * commit src/js/out files again * redo this edit too * refresh js/out files * Removed uws submodule * tidy up * unused primordials * run fmt --------- Co-authored-by: dave caruso <me@paperdave.net>
2023-09-27`deadCodeElimination` toggle for Bun.Transpiler (#5932)Gravatar jhmaster 1-0/+6
* add Bun.Transpiler DCE option * mark DCE toggle experimental + tests * full (hopefully) DCE toggle * update DCE toggle tests * add DCE option to types * run fmt * Removed uws submodule
2023-09-27fix: implement correct behaviour for urls with blob: scheme (#5825)Gravatar Liz 1-1/+8
* fix: implement correct behaviour for urls with blob: scheme Urls using the blob scheme can have special behaviour if their origin itself is a url. This fixes that by parsing the subdomain and if valid and the schemes(protocols) are valid returns its origin. Ive used node.js here a lot to make sure its behaviour is copied 1:1 and enabled the automated tests for it. Fixes https://github.com/oven-sh/bun/issues/5805 * fix: subUrl can be const, we are not modifying it * style: add spaces after `if` keyword
2023-09-26fix: support console.dir options object correctly (#6059)Gravatar Liz 1-8/+28
* fix: support console,dir options object correctly `console.dir` can be passed a second argument which is a object of options. This implements that logic with the currently supported properties: `depth` and `colors`. I used node as a reference for implementation details. Fixes: https://github.com/oven-sh/bun/issues/6039 * style: format zig file * fix: implement changes from review Implements changes requested from review, like adding more test cases and refactoring code style.
2023-09-26fix server end of stream, fix fetch not streaming without content-length or ↵Gravatar Ciro Spaciari 2-2/+19
chunked encoding, fix case when stream do not return a promise on pull (#6086)
2023-09-25no this value (#6063)Gravatar Dylan Conway 1-1/+1
2023-09-25Drain microtasks at end of abort() if called into JS (#6036)Gravatar Jarred Sumner 1-5/+14
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-25Add Module._extensions (#5998)Gravatar Jarred Sumner 1-2/+7
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-25Make error message for `new URL(invalid)` better (#6032)Gravatar Jarred Sumner 1-5/+15
* Make error message for `new URL(invalid)` better Thanks to @karlcow https://github.com/WebKit/WebKit/pull/13802 * redact --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24Do not use removefileat() (#6001)Gravatar Jarred Sumner 1-91/+9
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-09-24Fixes #5985 (#5986)Gravatar Jarred Sumner 3-5/+9
* Fixes #5985 * Update confirm-fixture.js --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>