Deno 1.40添加Temporal API強化日期與時間操作
· 2024-01-29

Deno 1.40新增Temporal API改善日期與時間處理,並支援新裝飾器語法,使程式碼更加清晰可讀

Deno最新1.40版本,加入了一個好用的日期和時間操作Temporal API,同時,開發者也將可以使用最新的裝飾器(Decorator)語法,使程式碼的目的和行為更加明確。

Temporal API的出現主要是要解決JavaScript中,與Date物件有關的複雜性,傳統Date物件在處理日期和時間方面存在許多問題,像是時區處理不易,日期計算不一致等。而Temporal API則提供了一個更強大的日期與時間處理功能,官方表示,Temporal API已經不太可能再改變,預計會在Deno 2成為穩定功能。

Deno開始支援TC39第三階段的裝飾器提案,這是一項即將在所有瀏覽器中實作的JavaScript類別擴充功能。新裝飾器目前在.ts、.jsx和.tsx中可用,而純JavaScript的支援,則正待V8引擎的實作。對於仰賴TypeScript舊版實驗性裝飾器的開發者,Deno提供相容性配置選項,不過官方也提到,因為1.40.0中的臭蟲,導致TypeScript的experimentalDecorators功能,在LSP(Language Server Protocol)中依舊會被啟動,官方建議開發者升級至1.40.1版本。

除了新功能加入之外,官方提到他們正在棄用與刪除一些功能,並讓部分新功能進入穩定狀態,為即將到來的Deno 2做準備。

Popular articles
GGC Awards 2026 Shines in Colombo: Honoring Leaders and Innovators in the iGaming Industry
HUIDU Focus
Full House at GAT Expo Cartagena 2026 Academic Agenda
Online Game
Institutional Academy that exceeded expectations marked the opening of GAT CDMX
Online Game
GAT CDMX 2025 Institutional Academy: Leaders and Experts Analyze the Present and Future of the Gaming Industry in Mexico and Lat
Sports Game
Online gambling, crypto pose ongoing money laundering risks in Philippines, analyst says
Southeast Asia
1spin4win grows its Latin American presence by partnering with Fortuna Juegos
Online Game
JILI Partners with Cricket Legend AB de Villiers (ABD) to Launch Exclusive Branded Game Series 100% 11
Sports Game
1spin4win releases unique slot Don Catleone Hold and Win featuring gangster cats
Online Game
Vietnam’s Controlled Gaming Shift Gains Ground, But Domestic Demand Still Lags
Southeast Asia
B2B Tech Infrastructure Gains Momentum in Philippine Gaming Sector
Southeast Asia
Brazil Proposes Raising Gambling Tax Rate to 24%, With Revenue Allocated to Social Security and Healthcare
Regulation
New Jersey July Gambling Revenue Hits $606M, Sweeps Casinos Banned
Regulation
Vietnam's tightening online gaming policy creates new market opportunities
Southeast Asia
Indiana online casino bill stalls in House committee
Regulation
Are you ready to maximize your earnings? Try ProPush.me Constructor!
Marketing
Home
Game
Cooperation
Find
My