Commit Graph

155 Commits

Author SHA1 Message Date
Jarred Sumner
659d4497d0 Fix bug with browser disabled modules 2022-06-22 06:56:47 -07:00
Jarred Sumner
224cfa91fb [TSConfig] Propagate runtime from tsconfig.json 2022-05-19 21:10:11 -07:00
Jarred Sumner
d4767ca763 [wip] Solid.js support for Bun! 2022-05-19 05:37:18 -07:00
Jarred Sumner
d629cfafd6 E.String gets a Rope 2022-05-05 21:32:19 -07:00
Jarred Sumner
5e739acfbb [misc] Fix broken build on macOS 2022-04-20 23:46:11 -07:00
wangao
0aacddb971 [timer] Remove timer.zig and use system_timer.zig (#149) 2022-04-18 21:25:53 -07:00
Jarred Sumner
6728551dc4 Fix wasm build 2022-04-18 17:41:58 -07:00
Jarred Sumner
add1c91425 Warn about moduleSuffixes 2022-04-13 21:46:02 -07:00
Jarred Sumner
521ccba387 recommend bun install 2022-03-19 00:45:40 -07:00
Jarred Sumner
5d39d3a3b2 [resolver] Fix edgecase where remapping a tsx -> js import path produced an invalid file path 2022-03-18 04:38:49 -07:00
Jarred Sumner
7a978f9381 move some code around 2022-03-17 01:28:56 -07:00
Jarred Sumner
f4504292cf [bun.js] Implement Blob 2022-03-13 06:08:10 -07:00
Jarred Sumner
701d6ec45d rename _global -> bun 2022-03-08 18:54:54 -08:00
Jarred Sumner
51fbbea1d3 upgrade zig 2022-03-04 00:20:22 -08:00
Jarred Sumner
17d625a735 remove a threadlocal 2022-03-02 15:34:26 -08:00
Jarred Sumner
4bb3f207ed Remove unused bool 2022-03-01 22:16:17 -08:00
Jarred Sumner
50560e169c WASM 2022-02-27 23:20:10 -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
59109a309f add version to Framework struct 2022-02-20 16:24:36 -08:00
Jarred Sumner
83659b898d Path.join 2022-02-14 05:43:11 -08:00
Jarred Sumner
3d057950b9 std.os.exit -> Global.exit so stderr is always flushed 2022-02-11 14:56:28 -08:00
Jarred Sumner
3063df9b78 Update resolve_path.zig 2022-02-05 21:26:14 -08:00
Jarred Sumner
51abe58a1a () 2022-02-05 18:56:15 -08:00
Jarred Sumner
7f1415c7ae One less memcpy 2022-02-05 18:54:46 -08:00
Jarred Sumner
62541f1ac8 path.normalize() tests pass 2022-02-04 00:31:20 -08:00
Jarred Sumner
faf137b9be Fix test failures in path.join 2022-02-03 21:03:39 -08:00
Jarred Sumner
a52a948a70 path.relative passes Node's tests (which also fixed bugs) 2022-02-02 23:33:37 -08:00
Jarred Sumner
68cb6130d3 "path" module from Node.js implementation 2022-02-02 18:02:06 -08:00
Jarred Sumner
30f5e0d37c [path] Fix bug that occasionally caused relative paths to be missing the leading character 2022-02-01 14:42:42 -08:00
Jarred Sumner
857e9bee00 Embed React Fast Refresh in Bun
Fixes https://github.com/Jarred-Sumner/bun/issues/62

If the project has it's own copy of react fast refresh and is bundling, it will use that instead.
2022-01-29 23:48:39 -08:00
Jarred Sumner
97d17904d3 Update AST layout to store capacity for items
We want to be able to push to the list
2022-01-28 19:26:03 -08:00
Jarred Sumner
ff2335a910 Stop reading "bun" from package.json
cc @hanford
2022-01-27 01:25:39 -08:00
Jarred Sumner
32733210dc [bunfig] Implement config file format 2022-01-27 01:25:09 -08:00
Jarred Sumner
1576d183c9 Instead of 4 loops, we can do one switch statement 2022-01-22 18:31:45 -08:00
Jarred Sumner
ec61dc0665 [Resolver] Improve how we detect ESM 2022-01-22 16:21:08 -08:00
Jarred Sumner
a09b995651 Bun.Transpiler – API for scanning imports/exports of JSX/TSX/TS/JS files 2022-01-19 23:07:03 -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
ed9637de50 Fix bug preventing multiple framework overrides 2022-01-05 17:27:46 -08:00
Jarred Sumner
c013ede227 Update resolver.zig 2022-01-05 13:12:11 -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
67b09911c1 Fix crash when TSConfigJSON has an error and multiple TSConfigJSON files were parsed \nThis was caused by reusing the filename buffer inappropriately. For unclear reasons, this only impacted Linux. 2021-12-21 19:43:43 -08:00
Jarred Sumner
06c79cffae 💅 2021-12-18 20:25:02 -08:00
Jarred Sumner
49dbf79e81 WIP 2021-12-16 19:18:51 -08:00
Jarred Sumner
6da14ae310 wip 2021-12-16 19:18:51 -08:00
Jarred Sumner
aed6f89772 [bun bun] Fix a race condition introduced in #55ff681976f7bae5a428c409061991c07fa492e7 2021-12-16 02:41:47 -08:00
Jarred Sumner
873cacc15a [bundler] Fix edgecase where certain modules would load unbundled versions
Some packages have many `package.json` files with no `name` in them, often to indicate `sideEffects` or change `exports`.

When bundling node_modules, we need a name to map a package back to the list of bundled packages.
2021-12-16 00:43:39 -08:00
Jarred Sumner
55ff681976 [resolver] Change extension order based on import kind 2021-12-16 00:41:23 -08:00
Jarred Sumner
3cb7dbe921 [resolver] Fix race condition that can cause the elapsed counter to integer overflow 2021-11-07 14:44:55 -08:00
Jarred Sumner
d7d9df726b [internal] Use a better timer for measuring parsing & resolving timings 2021-11-06 18:42:42 -07:00