bun v0.0.71 #120
Jarred-Sumner
announced in
Announcements
bun v0.0.71
#120
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
To upgrade:
Having trouble?
Please let me know though if it doesn't work and you're on bun v0.0.69. bun v0.0.61 - v0.0.68 had issues with the HTTP client
Highlights:
bun install
: numerous bug fixes to linking, serialization, deserialization, extracting files. It probably works in many projects now. There are still a couple bugs that need to be fixed andgit
/github
dependencies don't work yetbun pm hash
returns a hash of the resolved all package@version in your lockfilebun install --global
lets you globally install npm packages with bun!TextEncoder
,TextDecoder
,process.exit
,crypto.randomUUID
,crypto.randomBytes
are now available in bun.jssetTimeout
,setInterval
,clearTimeout
,clearInterval
are stubbed in to bun.js. They do not actually work yet, but at least code that calls it won't error anymoreLowlights:
bun install
lockfile format change means your nextbun install
will invalidate existing ones. The changes improve the reliability of saving and loading the lockfile"Copy as markdown" button for error messages
Before this release,
bun dev
did not support displaying runtime errors. It only showed errors for build/ssr 🙈Use macros like regular JavaScript
Now you can move code from runtime to build-time by writing ordinary javascript.
Input:
weather.js:
Output:
Normally, this 48 KB of JSON would be fetched client-side
JavaScript Parser reliability
I ported some of esbuild's tests to bun's testing library and that led to uncovering & fixing some parser bugs
New features
type
inside of import clauses is now supported. This is a TypeScript feature.Import assertions are now parsed by bun. Currently, they're removed from the final output
Fixed a number of whitespace/formatting bugs with the printer
bun install reliability
This release brings
bun install
much closer to something you can use daily. It's not there yet, but it is close.Somewhat controversially,
bun install
uses a binary lockfile format. One thing several people asked for: a hash. So I added a hash.This is a SHA512/256 hash of the following string. The string is created by looping through all the resolved packages in the lockfile, sorting alphabetically, then sorting any packages with multiple duplicate versions.
bun pm
is a new subcommand for "miscellaneous package manager things"When using
bun install -y
, the hash is inserted into the saved yarn.lock:You can now configure
bun install
withbunfig.toml
. it will search forbunfig.toml
in$XDG_CONFIG_HOME/bunfig.toml
and$HOME/bunfig.toml
, in addition to./bunfig.toml
bun install bugfixes
bun run
bun bun
bun dev
Open-in-editor is now implemented
Bun.js
ShadowRealm
supportTextEncoder
andTextDecoder
implementationprocess.exit(exitCode)
is now implementedcrypto.randomUUID
andcrypto.randomBytes()
Other
try running
bun wiptest
in a project that uses jestit'll probably throw a not implemented error, but it might work
This discussion was created from the release bun v0.0.71.
Beta Was this translation helpful? Give feedback.
All reactions