bun-v0.0.66
版本发布时间: 2022-01-04 15:04:08
oven-sh/bun最新发布版本:bun-v1.1.38(2024-11-29 19:55:48)
To upgrade:
bun upgrade
These changes are since bun v0.0.56 (the previous release notes 13 days ago)
TLDR:
- ~25% faster
bun install
when packages aren't downloaded - 5% faster JavaScript parser
- Many bugfixes to
bun install
(but still more work to do!) - Improved filesystem watcher reliability on Linux
- Docker images
bun install:
~25% faster when downloading lots of new packages. devDependencies were incorrectly being prioritized.
Plus:
-
bun add @scoped/package
works now -
>=
ranges for package versions work correctly now - Fixed a bug in the retry logic for the HTTP client that would sometimes cause undefined memory to be returned. There still is more work to be done on the HTTP client to improve reliability.
- On some Linux machines,
bun install
would error witherror: SystemResources
. This is an issue with thememlock
limit that impacts io_uring. Now bun lowers memlock usage when this error returns until it finds a value that works - On Linux, bun had a dependency on glibc 2.32 which is too new for many machines. Now it depends on glibc 2.29
- "no compatible binaries" error message was printing bytes instead of the string
- Fixed a crash when removing the only dependency in package.json. When there are no dependencies in package.json,
bun install
will delete the lockfile - On Linux, when
/tmp
was mounted on a different filesystem, extracting packages failed witherror: RenameAcrossMountPoints
. Now bun tests if it can rename files from the temporary directory to the cache directory and chooses a different temporary directory if it cannot - Better error handling if lockfile is invalid or package.json is not found
-
bun install --production
works better now. Just before installing, it clones the original lockfile in-memory and then removes any devDependencies listed in the root package.json.
bun run
- Passing an absolute path to a JavaScript-like file will run the file with bun.js. Before, absolute paths were ignored
bun dev
Improved filesystem watcher reliability on Linux
bun now handles atomic file updates better in the filesystem watcher. To filesystem watchers, atomic file updates appear as a delete followed by a new file being moved to an existing directory. bun previously only noticed the delete. Most editors do not save atomically, but if vim swapfiles are enabled or if using replit, this may help.
Improved support for reverse-proxying bun
Due to same-origin policy, bun's HMR needs to use absolute URLs that match what the browser expects. Previously, to proxy bun you had to pass --origin
to bun dev
and it would maybe still not work for https
. Now bun reads headers proxies send & what browsers send to determine which protocol, host, and/or origin is expected.
Misc:
- If you use tailwind, it only warns once that
@tailwind
is not supported instead of on every single request to that .css file
bun-framework-next
- A regression broke
fetch()
in SSR. This is fixed - The lack of a
URL
polyfill broke navigation in some cases. Now there is a URL polyfill. Eventually, bun.js will have this as a builtin implemented in native code.
bun.js
- Add
Bun.argv
which returnsstring[]
containing the CLI arguments used to open the currently running process. It is basically process.argv
bun bun
- Improve error mesage when resolving entry point fails https://github.com/Jarred-Sumner/bun/commit/11e3faa8da57748c98592f4eeb32ecdc72620857
DevContainer
If you're interested in contributing to bun, you can now use a VSCode DevContainer to quickly setup the dev environment. Note that it currently requires at least 11 GB of ram in the dockerized OS to compile debug builds of bun.
Docker
bun now has automatic docker releases for Linux AMD64 compiled on every push to main
. The tag name is jarredsumner/bun:${gitSHA}
Zig upgrade
bun is now using the latest version of Zig and LLVM 13, instead of a hacky patched version of Zig. This was a large change affecting basically every file in bun.
JavaScript Parser
5% faster JavaScript parser
Crash reporter
If bun crashes, it reports a little more metadata now and (on macOS) save a crash report to disk.
Sublime Text plugin for bun.lockb
@alexkuz wrote a Sublime Text plugin that opens bun.lockb (the lockfile for bun install
) as a yarn.lock file and adds syntax highlighting. Thank you @alexkuz!
GitHub: https://github.com/alexkuz/sublime-yarn-lock
Thanks
- Thanks @alexkuz and @afonsoduarte for fixing typos in the readme
- Thanks @ylukem for replacing all usages of
Bun
withbun
1、 bun-darwin-aarch64.zip 10.25MB
2、 bun-darwin-x64.zip 12.15MB
3、 bun-linux-x64.zip 23.45MB