|Bun Adds Hot Reloading|
|Written by Kay Ewbank|
|Thursday, 20 October 2022|
The first improvement to the new version is hot reloads on the server, which lets you see code changes immediately, without restarting your server. The developers say that unlike popular file watchers like nodemon, bun --hot preserves some of the state of your app, meaning in-flight HTTP requests don't get interrupted.
The next change of note is the ability to spawn processes in Bun. Bun.spawn is flexible. stdin can be a Response, Blob, Request, ArrayBuffer, ArrayBufferView, Bun.file, "pipe" or number.
Other improvements include the ability to read Request & Response objects bodies as a ReadableStream, and support for async iterators in ReadableStream.
The improvements to Bun so soon after the initial release are interesting, but an equally interesting indication of how seriously it may be being taken by supporters of 'rival' products such as Deno came with a post on Hacker News. The post suggested that the Deno benchmarks created by Bun.js developers comparing runtimes between the two products were chosen to misrepresent how well Deno actually runs. The suggestion was made that this was malicious rather than accidental. However, some commenters pointed out that the post was written by a Deno employee, and the post was later removed.
Bun 0.2.0 is available now.
or email your comment to: firstname.lastname@example.org
|Last Updated ( Thursday, 20 October 2022 )|