aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-04-28bundler tests: rest of default.test.ts and starting jsx tests (#2765)Gravatar dave caruso 6-21/+53
2023-04-28fix several memory issues related to pluginsGravatar Jarred Sumner 1-2/+5
2023-04-28cargo cult some code from JSCGravatar Jarred Sumner 2-6/+7
2023-04-28Fix crash with invalid input in fetch()Gravatar Jarred Sumner 1-2/+14
2023-04-28Improves Body.Value life cycle and Signal life cycle on server.zig (#2752)Gravatar Ciro Spaciari 6-218/+211
* reestruct request body value and signal * revert react-hello-world * fix constructInto and test * fmt * fix body nullable * Request can outlive RequestContext * fmt * BodyValue is now HiveRef * hasDecl for Ref and HiveRef * fix deinit call on Ref/HiveRef * adds InlineBlob * fix Bun.inspect when using InlineBlob * revert InlineBlob * Fix mimalloc-debug * Add TODO note * fix: make node:crypto Hash.copy work correctly (#2761) This commit will also: - add a CryptoHasher.copy function - make CryptoHasher.digest reset the hasher so it can be reused Resolves #2651 * :nail_care: * address unicode issue (#2763) * Fix an oopsie * Another oopsie * use inline for * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> * Request can outlive RequestContext * fmt * garantee to have the abort signnal attached to the server before abort the client on bun-server test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: Silver <14016168+silversquirl@users.noreply.github.com> Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-04-28Bundler docs updates + support for `naming` string (#2767)Gravatar Colin McDonnell 1-15/+26
* Bundler docs updates * Remove comments * Updates * Fix bunx usages * Add info about metafile
2023-04-27fix: make node:crypto Hash.copy work correctly (#2761)Gravatar Silver 9-8940/+7711
This commit will also: - add a CryptoHasher.copy function - make CryptoHasher.digest reset the hasher so it can be reused Resolves #2651
2023-04-27Implement `outdir` in `Bun.build`Gravatar Jarred Sumner 2-5/+5
2023-04-27Don't preallocate unless its profitableGravatar Jarred Sumner 1-3/+3
2023-04-27very slightly faster open() and writeFileSync() (#2759)Gravatar Jarred Sumner 2-45/+105
* Make open() slightly faster on macOS * Support using `writeFileSync` from native code * Add `openat$NOCANCEL` symbol * fixups for linux * do benchmark --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-26more esbuild compatGravatar Jarred Sumner 1-7/+8
2023-04-26Implement `file` loader in `Bun.build` (#2745)Gravatar Jarred Sumner 1-0/+18
* Update bundle_v2.zig * Implement `file` loader * Hash in parallel * Implement `publicPath` * simplify * Update bundle_v2.zig * Implement `#!` * Remove unnecessary optional --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-25Avoid unnecessary copiesGravatar Jarred Sumner 1-2/+14
2023-04-25now it worksGravatar Jarred Sumner 3-17/+15
2023-04-25typoGravatar Jarred Sumner 2-3/+7
2023-04-25Implement `onResolve` plugins in `Bun.build()`, support multiple onLoad and ↵Gravatar Jarred Sumner 66-786/+1629
onResolve plugins (#2739) * its 2023 * WIP `onResolve` plugins * more progress * it compiles * Lots of small fixes * Seems to work excluding entry points * Update BundlerPluginBuiltins.cpp --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-25Log HTTP requests and responses by default when log level is debug or verboseGravatar Jarred Sumner 1-2/+4
2023-04-24Support plugins in `Bun.build` (#2720)Gravatar Jarred Sumner 9-89/+1210
* wip * Implement `onLoad` plugins * Support exceptions and async `onLoad` plugins * Fix filtering * Handle empty files * Fix JSON loader --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-22Make `Bun.build` more reliable (#2718)Gravatar Jarred Sumner 1-2/+2
* One possible implementation to make `Bun.build` work better * Pass allocator in * Make our temporary buffers a little safer * rename * Fix memory corruption in symbol table * Add support for deferred idle events in ThreadPool * Free more memory * Use a global allocator FS cache * more `inline` * Make duping keys optional in StringMap * Close file handles more often * Update router.zig * wip possibly delete this commit * Fix memory issues and reduce memory usage * > 0.8 * Switch to AsyncIO.Waker and fix memory leak in JSBundleCompletionTask * We don't need to clone this actually * Fix error * Format * Fixup * Fixup --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-21Fix `minify: true` not applying to identifiersGravatar Jarred Sumner 1-1/+1
2023-04-21[breaking] In Bun.Transpiler, don't wrap CommonJS modules in `export default`Gravatar Jarred Sumner 1-0/+2
2023-04-21Add `minify` option to Bun.TranspilerGravatar Jarred Sumner 1-0/+30
2023-04-21Revert "use a lazyily initialized stream for `node:crypto` `createHash` (#2652)"Gravatar Jarred Sumner 1-130/+42
This reverts commit 3a2fd65f20d3b4e99c89f789acec5e5e40615008.
2023-04-21Revert "implement `node:events` in javascript (#2604)"Gravatar Jarred Sumner 2-473/+1
This reverts commit 96a2ed1040d5a0ca51ae41267cba4f8e5d0a6142.
2023-04-21`Bun.build()` partial implementationGravatar Jarred Sumner 3-19/+47
2023-04-21Add commentGravatar Jarred Sumner 1-0/+2
2023-04-20Symbol minification (#2695)Gravatar Dylan Conway 1-0/+2
* minify * Update renamer.zig * --minify-whitespace * Speed up minification a little * handle private names * 5% faster minification * use helper function * fix nested scope slots * `bun build --minify` gets another +8% faster * print semicolons afterwards * print semicolon after checking error * after all error checking * Delete code for generating legacy bundes * remove extra whitespace around if statements * print space before import identifier * Use `@constCast` * Make `S.Local#decls` use `BabyList(Decl)` * Add `fromSlice` helper to `BabyList` * Remove unnecessary optional chains * minify `undefined, true, false` * Another @constCast * Implement merge adjacent local var * Support --minify in `bun build --transform` * skip comments when counting character frequencies * Don't wrap commonjs with --transform on (unless targeting bun) * Support --minify in the runtime * Fix edgecase with import * as * don't infinite loop * --trnasform shouldn't mess with require * Only track comments when minifying --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-19Fix broken autocompleteGravatar Jarred Sumner 48-3517/+2708
2023-04-18implement `node:events` in javascript (#2604)Gravatar dave caruso 2-1/+473
* initial event emitter reimplementation * implement most of node:events. tests passing * work on emitter * fix importing node:events * work on event emitter tests * event work * event work * event stuff and experimenting with a lazy createHash * cleanup crypto stuff i had on this branch * finish event stuff up * fix error monitor * validate listeners are functions * changes requested
2023-04-17Remove spin loop in `bun build`Gravatar Jarred Sumner 1-12/+10
2023-04-17Fixes #2676Gravatar Jarred Sumner 1-2/+2
2023-04-17Get axios working (#2673)Gravatar Jarred Sumner 1-14/+64
* Revive node:http tests * Fix a couple bugs in node:http * possibly breaking: use `"browser"` exports condition last * Make URL validation error better --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-17cleanupGravatar Jarred Sumner 1-4/+7
2023-04-17Fix access of inactive union fieldGravatar Jarred Sumner 1-3/+4
2023-04-17Fixup options parsingGravatar Jarred Sumner 1-22/+48
2023-04-17Prepare for `Bun.build`Gravatar Jarred Sumner 10-10609/+12146
2023-04-16Unwrap, but we broke code splittingGravatar Jarred Sumner 1-1/+1
2023-04-15toBeFalsy expect counter and test scope check (#2661)Gravatar Will Richards 2 1-1/+7
2023-04-14Update bun.zigGravatar Jarred Sumner 1-1/+1
2023-04-14Support importing `.txt` files as strings (#2660)Gravatar Jarred Sumner 1-1/+1
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-14Upgrade Zig (#2656)Gravatar Jarred Sumner 7-12/+10
* Upgrade Zig * Don't add `d` files in github actions * Revert "Don't add `d` files in github actions" This reverts commit 446e2dd6743da08ec4136233fdc9179dbbf58fca. --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-14Implement `@bun` annotationGravatar Jarred Sumner 2-4/+18
2023-04-13use a lazyily initialized stream for `node:crypto` `createHash` (#2652)Gravatar dave caruso 1-42/+130
* lazy hash * finish up crypto stuff * remove lockfiles * ok * add pipe test * update this lockfile * remove unrelated crypto benchmark from this file
2023-04-13Only set `is_web_browser_navigation` in debug mode serverGravatar Jarred Sumner 1-8/+16
2023-04-13fix(server) fixes UAF of uWS headers (#2648)Gravatar Ciro Spaciari 1-53/+35
* fixes UAF of uWS headers * fix transfer encoding condition
2023-04-13Upgrade WebKit (#2643)Gravatar Jarred Sumner 50-133/+92
* Missing export * Regenerate builtins * Fix crash in require() * Various breaking JSC changes * hopefully speed up C++ compilation a little * Skip failing test fo rnow * Update WebKit * Add a comment * Fix error in postinstall * Update WebKit --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-04-12bundler bug fixes (#2637)Gravatar Dylan Conway 1-1/+1
* append import to outer wrapper prefix * print space * require text loader * import empty esm and cjs * add text to schema
2023-04-12fix(fs): remove readfile (#2630)Gravatar hiroki osame 1-2/+0
2023-04-10always safe deinit socket context (#2611)Gravatar Ciro Spaciari 1-5/+7
2023-04-09Remove usages of `void{}` in favor of `{}`Gravatar Jarred Sumner 6-20/+20
See https://github.com/ziglang/zig/issues/15213