Bun

Bun v0.1.8


Jarred Sumner · 2022年8月11日

升級方式

bun upgrade

安裝方式

curl https://bun.dev.org.tw/install | bash

如果您在升級時遇到任何問題

新功能

非常感謝 @zhuzilin 在此版本中提供的所有幫助。@zhuzilin 修復了 4 個崩潰問題!

bun link 讓您可以將資料夾符號連結到 node_modules。它的運作方式類似 npm link。

fs.copyFileSync 速度提升 2 到 10 倍

require.resolve 現在在執行時而非僅在建置時運作

image

WebSocket 現在更可靠了。先前,當 socket 仍開啟時,垃圾回收器會嘗試釋放它 🙉

bun:ffitoBuffertoArrayBuffer 函數現在支援指向解構函式 (destructor) 的函數指標,以便原生程式碼可以執行清理,而無需通過 FinalizationRegistry

console.log

TypedArray 記錄類型的值(而不是以位元組為單位 🙈)

image

console.log(MessageEvent) 現在更有用了

image

更多

  • setInterval 不再導致程序保持運行 😢,現在感謝 @zhuzilin 已修復
  • 記錄 @zhuzilin 在 https://github.com/oven-sh/bun/pull/1010 中未處理的 rejected promises 錯誤
  • 記錄事件迴圈中未捕獲的例外
  • bun install 獲得一個 symlink 後端,在大多數情況下您可能不想使用它。如果您將 file:./ 作為依賴項,它會在內部使用,某些套件會這樣做
  • process.revision 返回用於建置 bun 的 git sha

錯誤修復

  • 建置問題導致「Illegal instruction」錯誤返回 - 現在已修復
  • [wiptest] 修復 @zhuzilin 在 https://github.com/oven-sh/bun/pull/1000 中在 describe 中呼叫 toBe 的問題
  • 在完成後,由 @zhuzilin 在 https://github.com/oven-sh/bun/pull/1014 中將 setInterval 重新註冊到 VM
  • 修復 @zhuzilin 在 https://github.com/oven-sh/bun/pull/1025 中,query().all() 屬性超過 64 個時的區段錯誤 (segfault)
  • 由 @TiKevin83 在 https://github.com/oven-sh/bun/pull/1033 中將範例 Next 應用程式更新至 12.2
  • 由 @zhuzilin 在 https://github.com/oven-sh/bun/pull/1034 中透過手動設定狀態機修復靜態 require
  • #941 由 @JL102 在 https://github.com/oven-sh/bun/pull/998 中修復

錯字

  • 重構(src/install):由 @ryanrussell 在 https://github.com/oven-sh/bun/pull/1024 中修復 clap 可讀性

其他

  • 由 @zhuzilin 在 https://github.com/oven-sh/bun/pull/1027 中修復 linux 上的編譯錯誤

完整變更日誌:https://github.com/oven-sh/bun/compare/bun-v0.1.7...bun-v0.1.8