Commit Graph

50 Commits

Author SHA1 Message Date
dave caruso
f9e78c419f feat: Implement using keyword (explicit resource management) (#8151)
* port 'initial support for using declarations'

1:1 port of this commit:

56a3e01244

* port 'initial support for await using declarations'

1:1 port of this commit:
1634a0b5ad

* fix cmake config for local jsc

* add global defines for symbols

* begin porting lowering implementation

based off of
https://github.com/evanw/esbuild/pull/3192

* [autofix.ci] apply automated fixes

* add some fun webkit scripts

* fix the minification bug

* refactor runtime_js, etc

* rename test file

* finished yapping

* silly silyl

* Update src/bundler.zig

* ok

* a

* Fix crash

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2024-01-15 23:14:41 -08:00
dave caruso
6a163cf933 bundler tests and improve Bun.build return type (#2833)
* importstar_ts

* tests

* run acorn test suite

* bench tweaks

* test

* bun.build tests very incomplete

* remove dataurl and base64 loaders from tests since they dont work yet

* tests

* stuff

* stuff

* add errors and array of blobs

* work so far

* docs

* requested changes

* fix overwrite docs

* remove this file
2023-05-11 14:42:54 -07:00
Jarred Sumner
9388b3f825 Add a zig fmt action (#2277)
* Add a zig fmt action

* add failing file

* Setup prettier better

* Update prettier-fmt.yml

* Fail on error

* Update prettier-fmt.yml

* boop

* boop2

* tar.gz

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* Update zig-fmt.yml

* boop

* Update prettier-fmt.yml

* tag

* newlines

* multiline

* fixup

* Update zig-fmt.yml

* update it

* fixup

* both

* w

* Update prettier-fmt.yml

* prettier all the things

* Update package.json

* zig fmt

*  

* bump

* .

* quotes

* fix prettier ignore

* once more

* Update prettier-fmt.yml

* Update fallback.ts

* consistentcy

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-03-02 19:02:10 -08:00
Colin McDonnell
f7f1b60444 Add bun-types, add typechecking, add child_process types (#1475)
* Add bun-types to packages

* Improve typing

* Fix types in tests

* Fix dts tests

* Run formatter

* Fix all type errors

* Add strict mode, fix type errors

* Add ffi changes

* Move workflows to root

* Add workflows

* Remove labeler

* Add child_process types

* Fix synthetic defaults issue

* Remove docs

* Move scripts

* Run prettier

* Include examples in typechecking

* captureStackTrace types

* moved captureStackTrace types to globals

* Address reviews

Co-authored-by: Colin McDonnell <colinmcd@alum.mit.edu>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2022-11-09 15:40:40 -08:00
Jarred Sumner
729d445b68 change the directory structure 2022-06-22 23:21:48 -07:00
Jarred Sumner
1788503892 [bun dev] Fix CSS HMR bug 2022-04-13 21:46:02 -07:00
Jarred Sumner
20cdb197e2 Fix Next.js stylesheet bug 2022-04-08 23:16:13 -07:00
Jarred Sumner
862155fa5e I think fix hmr regression? 2022-04-08 06:32:12 -07:00
Jarred Sumner
5ac6920591 7 hrs 2022-04-06 23:38:37 -07:00
Jarred Sumner
70b1beb18b Update hmr.ts 2022-04-06 23:38:32 -07:00
Jarred Sumner
996c1468fa Allow a little leeway when HMR 2022-03-31 05:08:40 -07:00
Jarred Sumner
e3fb88b06a [bun.js] configuration and error handling for HTTP server 2022-03-25 07:12:02 -07:00
Jarred Sumner
ce742f665a generate separate interop code for bun 2022-03-19 00:46:24 -07:00
Jarred Sumner
44b0c8153a Source Maps for client-side errors & columns 2022-03-11 00:03:09 -08:00
Jarred Sumner
7c5c6cd519 source maps work for app code in bun dev! 2022-03-06 07:35:16 -08:00
Jarred Sumner
986895f8c1 [bun dev] Don't log errors twice 2022-02-24 20:34:23 -08:00
Jarred Sumner
efb4baacdf [bun dev] Implement copy as markdown 2022-02-20 23:12:15 -08:00
Jarred Sumner
4a24240d9f Possibly fix #98 2022-02-08 01:24:05 -08:00
Jarred Sumner
8c470194ce "" 2022-01-30 16:11:48 -08:00
Jarred Sumner
410a6bd32d [bun dev] Add error favicon 2022-01-30 15:12:34 -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
915dadd9d7 prettier 2022-01-02 00:07:26 -08:00
Jarred SUmner
a17088363f [bun dev] Improve filesystem watcher & HMR reliability (Linux + a little macOS)
Text editors like Replit save through atomic file updates. In an inotify filesystem watcher (Linux), that appears to be a delete followed by moving the file to the directory. Now when known files are moved into a directory, the watcher sends the file change notification to the browser(s). From there, the browser looks at it's files to determine whether or not

Additionally, if an existing HMR connection does not know about a file ID passed to it, it asks the browser to reply with the file path and then starts watching that file. This improves HMR reliabiality if Bun had been restarted but the page hadn't been restarted.
2022-01-01 01:53:50 -08:00
Jarred Sumner
469a36e3b6 [HMR] Large perf improvement for JS hot reloads at runtime
From benchmarking, I noticed that a lot of time was spent running
`HMRModule.update()`.

We don't need to call that function if updates for the same module ID have not changed any exports
2021-11-21 03:52:14 -08:00
Jarred Sumner
10696680ff Polish 2021-10-15 19:44:53 -07:00
Jarred Sumner
7b24042d5f Embed regeneratorRuntime so that things which expect it to be a global still work 2021-09-23 17:36:04 -07:00
Jarred Sumner
872428de89 Fix bugs with ESM -> CJS when not bundled 2021-09-17 03:14:05 -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
fc907e2f81 current 2021-09-09 23:33:34 -07:00
Jarred Sumner
1d1a70c21f WIP error css
Former-commit-id: 36f03bf491cf274f68361e334a706538464ee271
2021-09-07 03:21:58 -07:00
Jarred Sumner
0108695438 Always store the list of stylesheets
Former-commit-id: 867ebf04348439c48037e4944fef6d48a33555bd
2021-09-06 03:37:17 -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
3ae0accbe3 Fix file loader, automatically support CSS imports when a framework isn't set
Former-commit-id: 94750e5987ea8f6e4c946bfc06715e09a48c0eec
2021-08-26 19:56:25 -07:00
Jarred Sumner
3b6259edf3 fix jsx
Former-commit-id: a9bfcbce261798cdd0c3f8cb09076dc246920b48
2021-08-17 15:25:36 -07:00
Jarred Sumner
afcbcd231c Fix CSS bug, dont' run HMR code on server
Former-commit-id: 541084b7238d54d77cb13402274718311f2030b4
2021-08-17 12:26:06 -07:00
Jarred Sumner
574be79253 alright thats the rename
Former-commit-id: 0faf61249e76382dfb1aa8721249474eae920753
2021-08-17 01:44:30 -07:00
Jarred Sumner
2600c4f4c4 A little less crashy
Former-commit-id: f90ce9e4563de98ad2b6524653821411dd262243
2021-08-15 22:35:47 -07:00
Jarred Sumner
2335780618 rename to bun
Former-commit-id: f982fc85fac3f0120e1851ad4027dd8413216439
2021-08-15 22:17:20 -07:00
Jarred Sumner
db4caf0d42 Fix reconnect logic
Former-commit-id: 67fc1488169e9779794b23600401f70a1e812cad
2021-08-15 21:43:53 -07:00
Jarred Sumner
f74771144e Split up + generate client & server bundles, support framework +router in GenerateNodeModulesBundle , read framework from package.json + rename "publicURL" to "origin" + add import.meta.filepath
Former-commit-id: 1e76ebb5375247231181ec19a6396c6acf4684fb
2021-08-09 02:21:31 -07:00
Jarred Sumner
6e4da63abe router almost works
Former-commit-id: a8b9d27bd0946f9c48bd8e4b5b5c2031aa434f28
2021-08-05 23:47:36 -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
85b6d448ce hm
Former-commit-id: 0dc1c1a74b845d037326f4f2facd786924ca722e
2021-08-01 19:04:38 -07:00
Jarred Sumner
d09194f05a Support live-reload and fallback
Former-commit-id: c3f9d77391
2021-06-20 18:15:13 -07:00
Jarred Sumner
0b68ccd742 Use CSSOM for HMR when available.
Former-commit-id: 72f1c676b9
2021-06-19 18:26:43 -07:00
Jarred Sumner
7ed1b19d94 CSS HMR!
Former-commit-id: 3f10c87906
2021-06-18 20:48:07 -07:00
Jarred Sumner
6dce0c1e03 100x!!
Former-commit-id: e0fa2e78da
2021-06-18 00:51:11 -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
c51c65325f I think thats the JS part of HMR
Former-commit-id: 43380a4d68
2021-06-12 19:10:08 -07:00