跳到正文
Vercel Blog(vercel.com)· Ali Smesseim·· 1 天前精選AI 評分69

Vercel 釋出 Node.js 26 LTS,正式支援 HTTP/2 與 Temporal API

Node.js 26 LTS is now Generally Available on Vercel

AI 導讀

Node.js 26 LTS 現已在 Vercel 上正式可用,開發者可即時享受 HTTP/2、Temporal API 以及 V8 14.6 的新功能。

  • HTTP/2 預設:內建 fetch (Undici 8) 讓多個請求共用連線,減少延遲。
推薦理由

Node.js 26 LTS 推出後,開發者可即時享受 HTTP/2、Temporal API 及 V8 新功能,透過自動升級或手動設定快速切換,提升效能與開發效率。

正文 · 原文

Node.js 26 LTS is now Generally Available for builds and Vercel Functions.

This release includes:

  • HTTP/2 by default for built-in fetch (Undici 8) lets multiple requests share a connection with servers that support it. This can reduce latency when your functions call APIs or databases over HTTP.

  • Temporal API offers an alternative to Date with immutable values and built-in time zone and calendar support.

  • V8 version 14.6, the updated JavaScript engine, adds features such as Map.prototype.getOrInsert() to retrieve an existing value or insert a default when a key is missing.

Using Node.js 26

Node.js 26 is the default for all new projects.

  • Automatic upgrades: If engines.node in your existing project’s package.json allows 26, such as >=20, your Node.js builds on Vercel will use 26 on the next deployment.

  • Manual upgrades: Set engines.node to 26.x in your project's package.json and redeploy.

  • Prebuilt deployments: Use Vercel CLI version 65.8.0 or later to deploy Node.js 26 Functions.

  • HTTP/1.1 in Functions: To keep HTTP/1.1, set the VERCEL_FETCH_DISABLE_H2 environment variable to 1 and redeploy.

Minor and patch updates to Node.js 26 roll out automatically for builds and Vercel Functions.

Read the Node.js version documentation to learn more.

Read more

來源: Vercel Blog (vercel.com)
開啟原文