aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-05-08Add a couple helpersGravatar Jarred Sumner 1-1/+12
2023-05-08Fix memory issues with `loader` and `define` in JSBundlerGravatar Jarred Sumner 1-42/+42
2023-05-08Make the enum serializer more flexibleGravatar Jarred Sumner 1-4/+4
2023-05-08implement build api `define` and `loaders` (#2805)Gravatar dave caruso 4-16/+106
* parse error logs * clean up types * remove --jsx-production. use NODE_ENV instead * add define to js api * add loaders to js api * fixups * sourcemap * typo fix * remove label, comment dir just for now * test tweaks * test work * make optional enums actually optional. allows `sourcemap: undefined` * overload host ram test * string tests * tests * test for 2815 * requested changes * sort this list * remove this test file now that it passes * oops * add --format * finish ts tests * doc typos related to define and loader
2023-05-08added some improvements on server (#2803)Gravatar Ciro Spaciari 3-137/+239
* added some improvements on server * undo unintended change * clean data handler before end calls * refactor * make ctx.resp nullable --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2023-05-07Add tracy (#2817)Gravatar Jarred Sumner 1-0/+9
* Add tracy * RTLD * Linux needs LD_PRELOAD * More tracing * Inline this --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-06[Bun.build] Add error when an `onResolve` plugin returns a `namespace` which ↵Gravatar Jarred Sumner 2-7/+21
has no loader
2023-05-06fix crash when there are lots of build errorsGravatar Jarred Sumner 1-3/+4
2023-05-06Fix `make headers`Gravatar Jarred Sumner 1-0/+5
2023-05-06Fix `make headers`Gravatar Jarred Sumner 1-0/+3
2023-05-06Fix a memory leakGravatar Jarred Sumner 1-0/+1
2023-05-06Use `isFile()` helperGravatar Jarred Sumner 1-1/+1
2023-05-05[napi] Fix crash in `napi_create_external_buffer`Gravatar Jarred Sumner 1-1/+1
This impacted LightningCSS when garbage collection ran. cc @devongovett
2023-05-04Add `UNLIKELY`Gravatar Jarred Sumner 1-2/+2
2023-05-04Revert "Add `setNoDelay`"Gravatar Jarred Sumner 1-4/+2
This reverts commit 8b6dd0c7e1c78a37da693dc216b18f32caa61927.
2023-05-04Throw error on non-file urlGravatar Jarred Sumner 1-1/+11
2023-05-04Add `setNoDelay`Gravatar Jarred Sumner 1-2/+4
2023-05-04Add no-op for ClientRequest.{setNoDelay,setTimeout}Gravatar Ashcon Partovi 1-0/+9
2023-05-02Add `__ulock_wait2` polyfillGravatar Jarred Sumner 1-0/+24
cc @kzc
2023-04-30Bun Test matchers even/odd. Also, .toContains fix and truthy (#2754)Gravatar Will Richards 2 7-3/+203
* bun test matcher tests for even/odd, few more truthy tests, and fix for contains empty string * implementation of even/odd matchers * didn't add the codegen bindings * linted
2023-04-30Implement source maps (#2770)Gravatar Dylan Conway 1-1/+1
* wip * Begin computing source map tables * source map progress * external source maps * fix merge * remove `@as` coercion * inline source maps and output source map shifts * fix `codeWithSourceMapShifts()` after merge * remove second call to `findReachableFiles()` * use `worker.allocator`, remove comment * don't reuse memory for source and sourceContents * don't reuse `quote_buf` * fix writing to stdout * Add comment * Don't include a sourcemap if the text was empty * Make the parser faster * +16% faster sourcemap generation @dylan-conway I'll need you to look this over to make sure I didn't mess anything up Though it currently doesn't generate the offsets in the right order... * 30% performance improvement to Bun.build() * Print `debugId` in source maps cc @mitsuhiko @notzeeg --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-05-01[install] handle `devDependencies` of local folders (#2781)Gravatar Alex Lam S.L 1-1/+1
fixes #2653
2023-04-29Fix plugin namespaces always being set to `"flie"`Gravatar Jarred Sumner 2-3/+4
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>