Commit Graph

55 Commits

Author SHA1 Message Date
Jarred Sumner
fa1d4c2d7f [bun.js] Fix release-mode test failures in Headers 2022-03-16 05:02:08 -07:00
Jarred Sumner
f1f3501628 Fix test failure 2022-03-15 05:47:53 -07:00
Jarred Sumner
6f095a6394 zero copy 2022-03-15 04:59:53 -07:00
Jarred Sumner
57e42cc538 Fix crash when Headers.delete 2022-03-15 00:38:28 -07:00
Jarred Sumner
5a6010deda FetchEvent's request will be disconnected from the real request after the request is sent 2022-03-14 23:43:59 -07:00
Jarred Sumner
4ab4ae77ac Reference-counting for Blob and Headers 2022-03-14 01:31:56 -07:00
Jarred Sumner
13cd18e614 make headers a ptr 2022-03-13 16:16:27 -07:00
Jarred Sumner
f4504292cf [bun.js] Implement Blob 2022-03-13 06:08:10 -07:00
Jarred Sumner
e97934a225 Expose Response.prototype.headers and Response.prototype.clone 2022-03-12 05:55:23 -08:00
Jarred Sumner
e65c82a032 Headers.clone 2022-03-12 05:54:56 -08:00
Jarred Sumner
6f39b8f576 Response.clone() 2022-03-12 05:54:34 -08:00
Jarred Sumner
eeff004ec2 Fix quoting console.log 2022-03-08 23:37:54 -08:00
Jarred Sumner
1bf898828b print size of headers 2022-03-08 19:33:45 -08:00
Jarred Sumner
701d6ec45d rename _global -> bun 2022-03-08 18:54:54 -08:00
Jarred Sumner
787769ac39 [bun.js] Support logging Headers, Response, and Request 2022-03-08 18:15:21 -08:00
Jarred Sumner
931670b7cb Wrap some usages of assert in a conditional
See https://github.com/ziglang/zig/issues/10942
2022-02-21 16:27:44 -08:00
Jarred SUmner
dabcac2e96 Several reliability improvements to HTTP 2022-02-04 20:50:21 -08:00
Jarred Sumner
213960a04a Limit the number of pooled objects 2022-02-01 20:47:35 -08:00
Jarred Sumner
97f0cef391 [Bun.js] Fix TypedArray/ArrayBuffer <> Zig interop 2022-01-20 16:19:07 -08:00
Jarred Sumner
d3a93d5273 fs.*Sync(), bun wiptest, and More ™ (#106)
* very very wip

* almost ready to fix the errors

* Update identity_context.zig

* Update base.zig

* [bun test] It runs successfully

* Remove unnecessary call

* [Bun.js] Improve JS <> Zig unicode string interop

This fixes longstanding unicode bugs with `console.log` & `fetch`.

I believe @evanwashere reported this first awhile ago

* [Bun.js] Implement `Object.is()` binding and a way to set a timeout for script execution

* Update PLCrashReport.zig

* [Bun.js] Make `console.log` more closely match Node.js and Deno

* [Bun.js] Implement formatting specifier for console.*

* Implement `console.clear()`

* bug fix

* Support console.clear()

* Buffer stderr

* [bun test] Begin implementing Node.js `fs`

* Update darwin_c.zig

* Implement more of `fs`

* `mkdir`, `mkdir` recursive, `mkdtemp`

* `open`, `read` (and pread)

* Move some things into more files

* Implement readdir

* `readFile`, `readLink`, and `realpath`

* `writeFile`, `symlink`, `chown`, `rename`, `stat`, `unlink`, `truncate`

* `lutimes`

* Implement `SystemError` and begin wiring up the `fs` module

* `"fs"` - Most of the arguments / validation

* `fs` - Rest of the arguments / validations

* Begin wiring up the `fs` module

* Fix all the build errors

* support printing typed arrays in console.log

* It...works?

* Support `require("fs")`, `import fs from 'fs';`, `import * as fs from 'fs'`

* Fix a couple bugs

* get rid of the crash reporter for now

* Update fs.exports.js

* [bun.js] slight improvement to startup time

* [bun.js] Improve error message printing

* [Bun.js] Add `Bun.gc()` to run the garbage collector manually and report heap size

* [Bun.js] Add Bun.generateHeapSnapshot to return what JS types are using memory

* [Bun.js] Add `Bun.shrink()` to tell JSC to shrink the VM size

* Improve encoding reader

* [bun.js] Improve callback & microtask performance

* Update node_fs.zig

* Implement `console.assert`

* simple test

* [Bun.js] Prepare for multiple globals/realms to support testing

* Create callbacks-overhead.mjs

* Update http.zig

* [Bun.js] Implement `queueMicrotask`

* Add test for queueMicrotask

* 😪

* [Bun.js] Implement `process.versions`, `process.pid`, `process.ppid`, `process.nextTick`, `process.versions`,

* Implement `process.env.toJSON()`

* [Bun.js] Improve performance of `fs.existsSync`

* 💅

* [Bun.js] Implement `process.chdir(str)` and `process.cwd()`, support up to 4 args in `process.nextTick`

* Make creating Zig::Process lazy

* Split processi nto separte file

* [Bun.js] Node.js Streams - Part 1/?

* [Bun.js] Node.js streams 2/?

* WIP streams

* fix crash

* Reduce allocations in many places

* swap

* Make `bun` start 2ms faster

* Always use an apiLock()

* libBacktrace doesn't really work yet

* Fix crash in the upgrade checker

* Clean up code for importing the runtime when not bundling

* 📷

* Update linker.zig

* 68!

* backtrace

* no, really backtrace

* Fix

* Linux fixes

* Fixes on Linux

* Update mimalloc

* [bun test] Automatically scan for {.test,_test,.spec,_spec}.{jsx,tsx,js,cts,mts,ts,cjs}
2022-01-19 02:29:07 -08:00
Jarred Sumner
5930ac09b7 noramlize some errors 2022-01-04 22:19:31 -08:00
Jarred Sumner
8837c3c10b [Bun.js][bun dev] Support macros inside of Bun.js
Closes #36
2022-01-04 22:12:37 -08:00
Jarred Sumner
6a28cfd2ba [bun dev] Automatically set origin - improve support for proxying Bun
Previously, when running Bun behind a reverse proxy, you had to pass an explicit `--origin` arg and it could only run behind one proxy at a time.

Now, Bun automatically determines the origin from the request if possible. It reads `Forwarded`, `X-Forwarded-Proto`, `X-Forwarded-Host`, `Origin`, and lastly `Host`. If none are available, it falls back to the `--origin` CLI arg.

This change is important for usecases like Replit which shows multiple iframes in different origins.
2022-01-01 18:12:57 -08:00
Jarred Sumner
b1c3fce49b [internal] Move network_thread into http package 2021-12-30 21:27:27 -08:00
Jarred Sumner
e75c711c68 Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig

* zig fmt

* AllocGate

* Update data_url.zig

* wip

* few files

* just headers now?

* I think everything works?

* Update mimalloc

* Update hash_map.zig

* Perf improvements to compensate for Allocgate

* Bump

* 📷

* Update bun.lockb

* Less branching

* [js parser] Slightly reduce memory usage

* Update js_parser.zig

* WIP remove unused

* [JS parser] WIP support for `with` keyword

* Remove more dead code

* Fix all the build errors!

* cleanup

* Move `network_thread` up

* Bump peechy

* Update README.md
2021-12-30 21:12:32 -08:00
Jarred Sumner
336a4b6ac2 Prepare to run unit tests & remove some dead code (#92)
* Remove some dead code

* 💀 code

* Fix the zig tests

* [JS Printer] Print integers faster & less scientific notation on decimals

* 💀 dead code

* skip

* Run all the unit tests
2021-12-27 18:06:31 -08:00
Jarred Sumner
a34792ce16 [Bun.js] Fix SSR when using fetch 2021-12-22 21:39:05 -08:00
Jarred Sumner
ab496e9e34 Remove duplicate code 2021-12-19 17:31:10 -08:00
Jarred Sumner
42c7d887d3 👶event loop 2021-12-17 02:44:35 -08:00
Jarred Sumner
bcd68b937d wip 2021-12-16 19:18:51 -08:00
Jarred Sumner
a6cf6c4069 [Bun.js] Fix silly oversight with fetch implementation 2021-10-29 23:35:06 -07:00
Jarred Sumner
2ed6605cc3 [Bun.js] When Body is UTF-16 encoded, convert it to UTF-8. 2021-10-25 04:46:01 -07:00
Jarred Sumner
88a5e2d34d Add TLS 1.3 support, improve fetch() HTTPS performance 2021-10-13 00:27:35 -07:00
Jarred Sumner
2f8be4f13f () 2021-09-27 21:05:20 -07:00
Jarred Sumner
37ffe4501c Ignore leading invalid unicode characters in response bodies in Response.text() 2021-09-27 21:03:00 -07:00
Jarred Sumner
97ad21dc68 Fix typo in error 2021-09-27 16:08:34 -07:00
Jarred Sumner
b0598f64ea Fix crashes when accessing request metadata 2021-09-13 22:29:44 -07:00
Jarred Sumner
125d88bd65 bun:error.js into separate module, ensure we don't include fast refresh in Bun.js, log build errors to browser console, don't warn for node_modules, 2021-09-11 01:48:23 -07:00
Jarred Sumner
b66ef23167 yay 2021-09-10 03:32:21 -07:00
Jarred Sumner
fc907e2f81 current 2021-09-09 23:33:34 -07:00
Jarred Sumner
8a02ad48a5 fetc h!!! 2021-09-09 05:40:07 -07:00
Jarred Sumner
292668ed43 up 2021-09-07 22:09:47 -07:00
Jarred Sumner
e2b9f23231 Add display name field to frameworks, improve logging, add counters, add
Former-commit-id: b2cf011b6c6405a786fe22367e1cd4e6c2c4c90f
2021-08-31 23:07:03 -07:00
Jarred Sumner
6a5f34a6bc Fallback, fragments, printer compat, better errors
Former-commit-id: 486e8c9d460eeebea024e96dbabcb7f2bfaffafb
2021-08-31 15:03:40 -07:00
Jarred Sumner
6997367242 log error on respondWith rejection,
Former-commit-id: 8f6312a17dc9811d54e4dc31d9ada68e98bae891
2021-08-17 04:10:21 -07:00
Jarred Sumner
c0273a09f1 alright server-side reloading code works
Former-commit-id: a49ef52eec1037014e3c9cda1a09f387a01116b8
2021-08-05 19:48:36 -07:00
Jarred Sumner
3b684308c3 ok
Former-commit-id: e7d0ff27193defd870ae29bd9b4d4c2044488eac
2021-08-03 16:01:15 -07:00
Jarred Sumner
dbda84ff87 fix errors
Former-commit-id: ac66d6af52f6a2340c57a957bed078f94a8cf8ed
2021-08-02 21:22:58 -07:00
Jarred Sumner
85b6d448ce hm
Former-commit-id: 0dc1c1a74b845d037326f4f2facd786924ca722e
2021-08-01 19:04:38 -07:00
Jarred Sumner
49ba78767c wip
Former-commit-id: 3f2a2e25ce
2021-07-14 13:11:03 -07:00