Commit Graph

38 Commits

Author SHA1 Message Date
Alex Lam S.L
28346e4a39 improve Buffer compatibility with Node.js (#2341)
* improve `Buffer` compatibility with Node.js

* use `memmove()`
allow `encoding` to be `undefined`
2023-03-07 22:29:29 -08:00
Dylan Conway
3f04f8d0a6 Upgrade Zig (#2151)
* fixup

* Upgrade Zig

* Remove bad assertion

* strings

* bump

* mode -> optimize

* optimize

* Linux build

* Update bindgen.zig
2023-02-23 23:57:19 -08:00
Jarred SUmner
168bb1427f move more things 2023-01-13 11:38:16 -08:00
Jarred Sumner
c99059db9f Remove usages of std.x 2023-01-03 18:53:40 -08:00
Jarred Sumner
c0dd284136 Upgrade to latest Zig (#1610)
* @min and @max

* builtins and some trivial ones

* Most of them

* more

* more!

* More Progress

* wip

* Update tagged_pointer.zig

* Update http_client_async.zig

* Most of the iterable dir changes

* alright

* Remove usages of deprecated formatters

* 📷

* fmt

* Update shimmer.zig

* wip

* wip

* wip

* progress

* more

* Latest

* stuck on error

* latest

* workaround stage2

* wip

* Update string_immutable.zig

* wip

* Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings

* Fix build errors

* Fixup most of the test failures

* Fix `make headers`

* Fix "outside package path" error

* Fixup aligned alloc

* Add missing file

* linux

* More linux fixes

* use latest peechy

* Fix transpiler test failure

* Forgot about these

* Fixup test failure

* Update node-timers.test.ts

* [node:htt] Fix `undefined is not an object` error

Fixes https://github.com/oven-sh/bun/issues/1618

* Update http.exports.js

* Make this test less flaky

* fix hashes

* Fix hex formatting and zls issues

* Download zig version

* Update Dockerfile

* Update Dockerfile

* Update uws

* Update Dockerfile

* Set llvm version

* Update README.md

* Update uws

* Update Dockerfile

* Update io_linux.zig

* Update bun.zig

* Log output

* workaround strange @cInclude error

* Make ffi tests better

* Don't use cImport

* Update c.zig

* Update c-bindings.cpp

* call setOutputDir

* Update Dockerfile

* Use a longer name

* latest

* Update serve.test.ts

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-12-28 00:51:22 -08:00
Jarred Sumner
b631ea7d72 import everything from "bun" where possible 2022-11-29 02:42:56 -08:00
Jarred Sumner
e41d7a0bd5 [fetch] Add optimization for chunked encoding 2022-11-20 01:43:40 -08:00
Jarred Sumner
79b6d4734a [internal] Add a function for appending without growing extra data 2022-11-19 22:23:20 -08:00
Jarred Sumner
e03204dccf Avoid undefined memory 2022-09-17 17:41:13 -07:00
Jarred Sumner
8a3a5c3b74 Update string_mutable.zig 2022-05-20 00:59:50 -07:00
Jarred Sumner
d4767ca763 [wip] Solid.js support for Bun! 2022-05-19 05:37:18 -07:00
Jarred Sumner
7c5c6cd519 source maps work for app code in bun dev! 2022-03-06 07:35:16 -08:00
Jarred Sumner
51fbbea1d3 upgrade zig 2022-03-04 00:20:22 -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
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
94e469c803 [bun install] WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
e10fe8aaad [JS transpiler] Ensure reserved words don't end up in nonUniqueIdentifier() 2021-12-15 17:08:04 -08:00
Jarred Sumner
309298fa42 Fix bug with MutableString.ensureValidIdentifier 2021-10-23 22:54:39 -07:00
Jarred Sumner
afb6684782 Fix resolve bug with mixed-case node_modules
Former-commit-id: 5bdae0ee491e28b49ceed6136f04e0c1feddc808
2021-08-23 02:30:30 -07:00
Jarred Sumner
ece2a3ccfd alright now it crashes
Former-commit-id: 26745bb5f3
2021-06-29 01:34:38 -07:00
Jarred Sumner
adbeb24979 starting to work
Former-commit-id: ae113559c6
2021-06-27 23:36:35 -07:00
Jarred Sumner
7eb887edd5 HMR crashily works, started working on CSS Scanner
Former-commit-id: d0f91082fc
2021-06-14 19:45:51 -07:00
Jarred Sumner
122ef023dd extremely close!!!!!
Former-commit-id: 44fce3c5e8
2021-06-14 01:49:53 -07:00
Jarred Sumner
faa3c867e2 Fix extra space in printer
Former-commit-id: c17c200cfd
2021-06-04 18:26:55 -07:00
Jarred Sumner
756c41719c Fix extra underscore in ensureValidIdentifier
Former-commit-id: 1cc15b6c20
2021-06-04 17:33:11 -07:00
Jarred Sumner
fa2f60cdd5 fix the leaks
Former-commit-id: 58d77ab827
2021-06-04 02:47:07 -07:00
Jarred Sumner
f8131f42bc okay
Former-commit-id: 2c20d88e8d
2021-05-12 01:46:58 -07:00
Jarred Sumner
324784cd6e update
Former-commit-id: a5f1670e92
2021-05-11 18:39:00 -07:00
Jarred Sumner
fc75a0dea6 asdasdasdasd
Former-commit-id: 2b3c0584c6
2021-05-10 20:05:53 -07:00
Jarred Sumner
166c353ddb 1day
Former-commit-id: b7d8fe2f35
2021-05-09 18:57:48 -07:00
Jarred Sumner
e70ac2ce82 wip
Former-commit-id: 79223472f7
2021-05-07 23:34:16 -07:00
Jarred Sumner
fad34bb4ab cool
Former-commit-id: 96ff169e46
2021-05-07 01:26:26 -07:00
Jarred Sumner
6be0a4653f damn tho
Former-commit-id: e1df98878d
2021-05-05 03:09:59 -07:00
Jarred Sumner
d19f939e7d keeper
Former-commit-id: 83ff3453dc
2021-05-04 15:54:17 -07:00
Jarred Sumner
568db047a3 wap 2021-04-26 00:34:45 -07:00
Jarred Sumner
99918c35ec it prints true and false 2021-04-25 18:47:09 -07:00
Jarred Sumner
da509f3d5a a 2021-04-22 14:24:28 -07:00
Jarred Sumner
5ae24b75ae lots 2021-04-19 20:53:54 -07:00