v2.0.0
2.0.0 / 2024.10.09
Read announcement blog post at: https://deno.com/blog/v2.0
- BREAKING:
DENO_FUTURE=1
by default, or welcome to Deno 2.0 (#25213) - BREAKING: disallow
new Deno.FsFile()
(#25478) - BREAKING: drop support for Deno.run.{clearEnv,gid,uid} (#25371)
- BREAKING: improve types for
Deno.serve
(#25369) - BREAKING: improved error code accuracy (#25383)
- BREAKING: make supported compilerOptions an allow list (#25432)
- BREAKING: move
width
andheight
options toUnsafeWindowSurface
constructor (#24200) - BREAKING: remove --allow-hrtime (#25367)
- BREAKING: remove "emit" and "map" from deno info output (#25468)
- BREAKING: remove
--allow-none
flag (#25337) - BREAKING: remove
--jobs
flag (#25336) - BREAKING: remove
--trace-ops
(#25344) - BREAKING: remove
--ts
flag (#25338) - BREAKING: remove
--unstable
flag (#25522) - BREAKING: remove
deno bundle
(#25339) - BREAKING: remove
deno vendor
(#25343) - BREAKING: remove
Deno.[Tls]Listener.prototype.rid
(#25556) - BREAKING: remove
Deno.{Conn,TlsConn,TcpConn,UnixConn}.prototype.rid
(#25446) - BREAKING: remove
Deno.{Reader,Writer}[Sync]
andDeno.Closer
(#25524) - BREAKING: remove
Deno.Buffer
(#25441) - BREAKING: remove
Deno.close()
(#25347) - BREAKING: remove
Deno.ConnectTlsOptions.{certChain,certFile,privateKey}
and
Deno.ListenTlsOptions.certChain,certFile,keyFile}
(#25525) - BREAKING: remove
Deno.copy()
(#25345) - BREAKING: remove
Deno.customInspect
(#25348) - BREAKING: remove
Deno.fdatasync[Sync]()
(#25520) - BREAKING: remove
Deno.File
(#25447) - BREAKING: remove
Deno.flock[Sync]()
(#25350) - BREAKING: remove
Deno.FsFile.prototype.rid
(#25499) - BREAKING: remove
Deno.fstat[Sync]()
(#25351) - BREAKING: remove
Deno.FsWatcher.prototype.rid
(#25444) - BREAKING: remove
Deno.fsync[Sync]()
(#25448) - BREAKING: remove
Deno.ftruncate[Sync]()
(#25412) - BREAKING: remove
Deno.funlock[Sync]()
(#25442) - BREAKING: remove
Deno.futime[Sync]()
(#25252) - BREAKING: remove
Deno.iter[Sync]()
(#25346) - BREAKING: remove
Deno.read[Sync]()
(#25409) - BREAKING: remove
Deno.readAll[Sync]()
(#25386) - BREAKING: remove
Deno.seek[Sync]()
(#25449) - BREAKING: remove
Deno.Seeker[Sync]
(#25551) - BREAKING: remove
Deno.shutdown()
(#25253) - BREAKING: remove
Deno.write[Sync]()
(#25408) - BREAKING: remove
Deno.writeAll[Sync]()
(#25407) - BREAKING: remove deprecated
UnsafeFnPointer
constructor type with untyped
Deno.PointerObject
parameter (#25577) - BREAKING: remove deprecated files config (#25535)
- BREAKING: Remove obsoleted Temporal APIs part 2 (#25505)
- BREAKING: remove remaining web types for compatibility (#25334)
- BREAKING: remove support for remote import maps in deno.json (#25836)
- BREAKING: rename "deps" remote cache folder to "remote" (#25969)
- BREAKING: soft-remove
Deno.isatty()
(#25410) - BREAKING: soft-remove
Deno.run()
(#25403) - BREAKING: soft-remove
Deno.serveHttp()
(#25451) - BREAKING: undeprecate
Deno.FsWatcher.prototype.return()
(#25623) - feat: add
--allow-import
flag (#25469) - feat: Add a hint on error about 'Relative import path ... not prefixed with
...' (#25430) - feat: Add better error messages for unstable APIs (#25519)
- feat: Add suggestion for packages using Node-API addons (#25975)
- feat: Allow importing .cjs files (#25426)
- feat: default to TS for file extension and support ext flag in more scenarios
(#25472) - feat: deprecate import assertions (#25281)
- feat: Don't warn about --allow-script when using esbuild (#25894)
- feat: hide several --unstable-* flags (#25378)
- feat: improve lockfile v4 to store normalized version constraints and be more
terse (#25247) - feat: improve warnings for deprecations and lifecycle script for npm packages
(#25694) - feat: include version number in all --json based outputs (#25335)
- feat: lockfile v4 by default (#25165)
- feat: make 'globalThis.location' a configurable property (#25812)
- feat: print
Listening on
messages on stderr instead of stdout (#25491) - feat: remove
--lock-write
flag (#25214) - feat: require jsr prefix for
deno install
anddeno add
(#25698) - feat: require(esm) (#25501)
- feat: Show hints when using
window
global (#25805) - feat: stabilize
Deno.createHttpClient()
(#25569) - feat: suggest
deno install --entrypoint
instead ofdeno cache
(#25228) - feat: support DENO_LOG env var instead of RUST_LOG (#25356)
- feat: TypeScript 5.6 and
npm:@types/node@22
(#25614) - feat: Update no-window lint rule (#25486)
- feat: update warning message for --allow-run with no list (#25693)
- feat: warn when using
--allow-run
with no allow list (#25215) - feat(add): Add npm packages to package.json if present (#25477)
- feat(add): strip package subpath when adding a package (#25419)
- feat(add/install): Flag to add dev dependency to package.json (#25495)
- feat(byonm): support
deno run npm:<package>
when package is not in
package.json (#25981) - feat(check): turn on noImplicitOverride (#25695)
- feat(check): turn on useUnknownInCatchVariables (#25465)
- feat(cli): evaluate code snippets in JSDoc and markdown (#25220)
- feat(cli): give access to
process
global everywhere (#25291) - feat(cli): use NotCapable error for permission errors (#25431)
- feat(config): Node modules option for 2.0 (#25299)
- feat(ext/crypto): import and export p521 keys (#25789)
- feat(ext/crypto): X448 support (#26043)
- feat(ext/kv): configurable limit params (#25174)
- feat(ext/node): add abort helpers, process & streams fix (#25262)
- feat(ext/node): add rootCertificates to node:tls (#25707)
- feat(ext/node): buffer.transcode() (#25972)
- feat(ext/node): export 'promises' symbol from 'node:timers' (#25589)
- feat(ext/node): export missing constants from 'zlib' module (#25584)
- feat(ext/node): export missing symbols from domain, puncode, repl, tls
(#25585) - feat(ext/node): export more symbols from streams and timers/promises (#25582)
- feat(ext/node): expose ES modules for _ modules (#25588)
- feat(flags): allow double commas to escape values in path based flags (#25453)
- feat(flags): support user provided args in repl subcommand (#25605)
- feat(fmt): better error on malfored HTML files (#25853)
- feat(fmt): stabilize CSS, HTML and YAML formatters (#25753)
- feat(fmt): support vto and njk extensions (#25831)
- feat(fmt): upgrade markup_fmt (#25768)
- feat(install): deno install with entrypoint (#25411)
- feat(install): warn repeatedly about not-run lifecycle scripts on explicit
installs (#25878) - feat(lint): add
no-process-global
lint rule (#25709) - feat(lsp): add a message when someone runs 'deno lsp' manually (#26051)
- feat(lsp): auto-import types with 'import type' (#25662)
- feat(lsp): html/css/yaml file formatting (#25353)
- feat(lsp): quick fix for @deno-types="npm:@types/*" (#25954)
- feat(lsp): turn on useUnknownInCatchVariables (#25474)
- feat(lsp): unstable setting as list (#25552)
- feat(permissions):
Deno.mainModule
doesn't require permissions (#25667) - feat(permissions): allow importing from cdn.jsdelivr.net by default (#26013)
- feat(serve): Support second parameter in deno serve (#25606)
- feat(tools/doc): display subitems in symbol overviews where applicable
(#25885) - feat(uninstall): alias to 'deno remove' if -g flag missing (#25461)
- feat(upgrade): better error message on failure (#25503)
- feat(upgrade): print info links for Deno 2 RC releases (#25225)
- feat(upgrade): support LTS release channel (#25123)
- fix: add link to env var docs (#25557)
- fix: add suggestion how to fix importing CJS module (#21764)
- fix: add test ensuring als works across dynamic import (#25593)
- fix: better error for Deno.UnsafeWindowSurface, correct HttpClient name,
cleanup unused code (#25833) - fix: cjs resolution cases (#25739)
- fix: consistent with deno_config and treat
"experimentalDecorators"
as
deprecated (#25735) - fix: delete old Deno 1.x headers file when loading cache (#25283)
- fix: do not panic running invalid file specifier (#25530)
- fix: don't include extensionless files in file collection for lint & fmt by
default (#25721) - fix: don't prompt when using
Deno.permissions.request
with--no-prompt
(#25811) - fix: eagerly error for specifier with empty version constraint (#25944)
- fix: enable
Win32_Security
feature inwindows-sys
(#26007) - fix: error on unsupported compiler options (#25714)
- fix: error out if a valid flag is passed before a subcommand (#25830)
- fix: fix jupyter display function type (#25326)
- fix: Float16Array type (#25506)
- fix: handle showing warnings while the progress bar is shown (#25187)
- fix: Hide 'deno cache' from help output (#25960)
- fix: invalid ipv6 hostname on
deno serve
(#25482) - fix: linux canonicalization checks (#24641)
- fix: lock down allow-run permissions more (#25370)
- fix: make some warnings more standard (#25324)
- fix: no cmd prefix in help output go links (#25459)
- fix: only enable byonm if workspace root has pkg json (#25379)
- fix: panic when require(esm) (#25769)
- fix: precompile preserve SVG camelCase attributes (#25945)
- fix: reland async context (#25140)
- fix: remove --allow-run warning when using deno without args or subcommand
(#25684) - fix: remove entrypoint hack for Deno 2.0 (#25332)
- fix: remove recently added deno.json node_modules aliasing (#25542)
- fix: remove the typo in the help message (#25962)
- fix: removed unstable-htttp from deno help (#25216)
- fix: replace
npm install
hint withdeno install
hint (#25244) - fix: trim space around DENO_AUTH_TOKENS (#25147)
- fix: update deno_doc (#25290)
- fix: Update deno_npm to fix
deno install
with crossws (#25837) - fix: update hint for
deno add <package>
(#25455) - fix: update malva in deno to support astro css comments (#25553)
- fix: update nodeModulesDir config JSON schema (#25653)
- fix: update patchver to 0.2 (#25952)
- fix: update sui to 0.4 (#25942)
- fix: upgrade deno_ast 0.42 (#25313)
- fix: upgrade deno_core to 0.307.0 (#25287)
- fix(add/install): default to "latest" tag for npm packages in
deno add npm:pkg
(#25858) - fix(bench): Fix table column alignments and NO_COLOR=1 (#25190)
- fix(BREAKING): make dns record types have consistent naming (#25357)
- fix(byonm): resolve npm deps of jsr deps (#25399)
- fix(check): ignore noImplicitOverrides in remote modules (#25854)
- fix(check): move is cjs check from resolving to loading (#25597)
- fix(check): properly surface dependency errors in types file of js file
(#25860) - fix(cli):
deno task
exit with status 0 (#25637) - fix(cli): Default to auto with --node-modules-dir flag (#25772)
- fix(cli): handle edge cases around
export
s in doc tests and default export
(#25720) - fix(cli): Map error kind to
PermissionDenied
when symlinking fails due to
permissions (#25398) - fix(cli): Only set allow net flag for deno serve if not already allowed all
(#25743) - fix(cli): Warn on not-run lifecycle scripts with global cache (#25786)
- fix(cli/tools): correct
deno init --serve
template behavior (#25318) - fix(compile): support 'deno compile' in RC and LTS releases (#25875)
- fix(config): validate export names (#25436)
- fix(coverage): ignore urls from doc testing (#25736)
- fix(doc): surface graph errors as warnings (#25888)
- fix(dts): stabilize
fetch
declaration for use withDeno.HttpClient
(#25683) - fix(ext/console): more precision in console.time (#25723)
- fix(ext/console): prevent duplicate error printing when the cause is assigned
(#25327) - fix(ext/crypto): ensure EC public keys are exported uncompressed (#25766)
- fix(ext/crypto): fix identity test for x25519 derive bits (#26011)
- fix(ext/crypto): reject empty usages in SubtleCrypto#importKey (#25759)
- fix(ext/crypto): support md4 digest algorithm (#25656)
- fix(ext/crypto): throw DataError for invalid EC key import (#25181)
- fix(ext/fetch): fix lowercase http_proxy classified as https (#25686)
- fix(ext/fetch): percent decode userinfo when parsing proxies (#25229)
- fix(ext/http): do not set localhost to hostname unnecessarily (#24777)
- fix(ext/http): gracefully handle Response.error responses (#25712)
- fix(ext/node): add
FileHandle#writeFile
(#25555) - fix(ext/node): add
vm.constants
(#25630) - fix(ext/node): Add missing
node:path
exports (#25567) - fix(ext/node): Add missing node:fs and node:constants exports (#25568)
- fix(ext/node): add stubs for
node:trace_events
(#25628) - fix(ext/node): attach console stream properties (#25617)
- fix(ext/node): avoid showing
UNKNOWN
error from TCP handle (#25550) - fix(ext/node): close upgraded socket when the underlying http connection is
closed (#25387) - fix(ext/node): delay accept() call 2 ticks in net.Server#listen (#25481)
- fix(ext/node): don't throw error for unsupported signal binding on windows
(#25699) - fix(ext/node): emit
online
event after worker thread is initialized (#25243) - fix(ext/node): export
process.allowedNodeEnvironmentFlags
(#25629) - fix(ext/node): export JWK public key (#25239)
- fix(ext/node): export request and response clases from
http2
module (#25592) - fix(ext/node): fix
Cipheriv#update(string, undefined)
(#25571) - fix(ext/node): fix Decipheriv when autoPadding disabled (#25598)
- fix(ext/node): fix process.stdin.pause() (#25864)
- fix(ext/node): Fix vm sandbox object panic (#24985)
- fix(ext/node): http2session ready state (#25143)
- fix(ext/node): Implement detached option in
child_process
(#25218) - fix(ext/node): import EC JWK keys (#25266)
- fix(ext/node): import JWK octet key pairs (#25180)
- fix(ext/node): import RSA JWK keys (#25267)
- fix(ext/node): register
node:wasi
built-in (#25134) - fix(ext/node): remove unimplemented promiseHook stubs (#25979)
- fix(ext/node): report freemem() on Linux in bytes (#25511)
- fix(ext/node): Rewrite
node:v8
serialize/deserialize (#25439) - fix(ext/node): session close during stream setup (#25170)
- fix(ext/node): Stream should be instance of EventEmitter (#25527)
- fix(ext/node): stub
inspector/promises
(#25635) - fix(ext/node): stub
process.cpuUsage()
(#25462) - fix(ext/node): stub cpu_info() for OpenBSD (#25807)
- fix(ext/node): support x509 certificates in
createPublicKey
(#25731) - fix(ext/node): throw when loading
cpu-features
module (#25257) - fix(ext/node): update aead-gcm-stream to 0.3 (#25261)
- fix(ext/node): use primordials in
ext/node/polyfills/console.ts
(#25572) - fix(ext/node): use primordials in ext/node/polyfills/wasi.ts (#25608)
- fix(ext/node): validate input lengths in
Cipheriv
andDecipheriv
(#25570) - fix(ext/web): don't ignore capture in EventTarget.removeEventListener (#25788)
- fix(ext/webgpu): allow to build on unsupported platforms (#25202)
- fix(ext/webgpu): sync category comment (#25580)
- fix(ext/webstorage): make
getOwnPropertyDescriptor
with symbol return
undefined
(#13348) - fix(flags): --allow-all should conflict with lower permissions (#25909)
- fix(flags): don't treat empty run command as task subcommand (#25708)
- fix(flags): move some content from docs.deno.com into help output (#25951)
- fix(flags): properly error out for urls (#25770)
- fix(flags): require global flag for permission flags in install subcommand
(#25391) - fix(fmt): --check was broken for CSS, YAML and HTML (#25848)
- fix(fmt): fix incorrect quotes in components (#25249)
- fix(fmt): fix tabs in YAML (#25536)
- fix(fmt/markdown): fix regression with multi-line footnotes and inline math
(#25222) - fix(info): error instead of panic for npm specifiers when using byonm (#25947)
- fix(info): move "version" field to top of json output (#25890)
- fix(inspector): Fix panic when re-entering runtime ops (#25537)
- fix(install): compare versions directly to decide whether to create a child
node_modules dir for a workspace member (#26001) - fix(install): Make sure target node_modules exists when symlinking (#25494)
- fix(install): recommend using
deno install -g
when using a single http url
(#25388) - fix(install): store tags associated with package in node_modules dir (#26000)
- fix(install): surface package.json dependency errors (#26023)
- fix(install): Use relative symlinks in deno install (#25164)
- fix(installl): make bin entries executable even if not put in
node_modules/.bin
(#25873) - fix(jupyter): allow unstable flags (#25483)
- fix(lint): correctly handle old jsx in linter (#25902)
- fix(lint): support linting jsr pkg without version field (#25230)
- fix(lockfile): use loose deserialization for version constraints (#25660)
- fix(lsp): encode url parts before parsing as uri (#25509)
- fix(lsp): exclude missing import quick fixes with bad resolutions (#26025)
- fix(lsp): panic on url_to_uri() (#25238)
- fix(lsp): properly resolve jsxImportSource for caching (#25688)
- fix(lsp): update diagnostics on npm install (#25352)
- fix(napi): Don't run microtasks in napi_resolve_deferred (#25246)
- fix(napi): Fix worker threads importing already-loaded NAPI addon (#25245)
- fix(no-slow-types): better
override
handling (#25989) - fix(node): Don't error out if we fail to statically analyze CJS re-export
(#25748) - fix(node): fix worker_threads issues blocking Angular support (#26024)
- fix(node): implement libuv APIs needed to support
npm:sqlite3
(#25893) - fix(node): Include "node" condition during CJS re-export analysis (#25785)
- fix(node): Pass NPM_PROCESS_STATE to subprocesses via temp file instead of env
var (#25896) - fix(node/byonm): do not accidentally resolve bare node built-ins (#25543)
- fix(node/cluster): improve stubs to make log4js work (#25146)
- fix(npm): better error handling for remote npm deps (#25670)
- fix(npm): root package has peer dependency on itself (#26022)
- fix(permissions): disallow any
LD_
orDYLD_
prefixed env var without full
--allow-run permissions (#25271) - fix(permissions): disallow launching subprocess with LD_PRELOAD env var
without full run permissions (#25221) - fix(publish): ensure provenance is spec compliant (#25200)
- fix(regression): do not expose resolved path in Deno.Command permission denied
error (#25434) - fix(runtime): don't error
child.output()
on consumed stream (#25657) - fix(runtime): use more null proto objects again (#25040)
- fix(runtime/web_worker): populate
SnapshotOptions
forWebWorker
when
instantiated without snapshot (#25280) - fix(task): correct name for scoped npm package binaries (#25390)
- fix(task): support tasks with colons in name in
deno run
(#25233) - fix(task): use current executable for deno even when not named deno (#26019)
- fix(types): simplify mtls related types (#25658)
- fix(upgrade): more informative information on invalid version (#25319)
- fix(windows): Deno.Command - align binary resolution with linux and mac
(#25429) - fix(workspace): handle when config has members when specified via --config
(#25988) - perf: fast path for cached dyn imports (#25636)
- perf: Use -O3 for sui in release builds (#26010)
- perf(cache): single cache file for remote modules (#24983)
- perf(cache): single cache file for typescript emit (#24994)
- perf(ext/fetch): improve decompression throughput by upgrading
tower_http
(#25806) - perf(ext/node): reduce some allocations in require (#25197)
- perf(ext/web): optimize performance.measure() (#25774)