Aller au contenu
verdict:

Deno 2.0.0

featured

note: la synthèse et les notes de version sont en anglais

warning: action requise

6 breaking changes5 points clés

Deno 2.0 removes many long-deprecated APIs and flags, so check your code and config before upgrading.

synthèse · uniquement d’après les notes de version · claude-haiku-5-5 · prompt v7

breaking changestous cités, chacun avec un correctif

breaking[1]: The --unstable flag is removed.

BREAKING: remove --unstable flag (#25522)

help: The notes give no migration, so check scripts, CI and config for uses of --unstable.

breaking[2]: The deno bundle command is removed.

BREAKING: remove deno bundle (#25339)

help: The notes give no migration, so check build scripts for uses of deno bundle.

breaking[3]: The deno vendor command is removed.

BREAKING: remove deno vendor (#25343)

help: The notes give no migration, so check scripts for uses of deno vendor.

breaking[4]: Deno.close() is removed.

BREAKING: remove Deno.close() (#25347)

help: The notes give no migration, so check code for calls to Deno.close().

breaking[5]: Support for remote import maps in deno.json is removed.

BREAKING: remove support for remote import maps in deno.json (#25836)

help: The notes give no migration, so check deno.json for remote import maps.

breaking[6]: The --allow-hrtime flag is removed.

BREAKING: remove --allow-hrtime (#25367)

help: The notes give no migration, so check scripts for uses of --allow-hrtime.

points clés

release-notesgithub.com/denoland/deno · 342 lignes
  1. ### 2.0.0 / 2024.10.09
  2. Read announcement blog post at: https://deno.com/blog/v2.0
  3. - BREAKING: `DENO_FUTURE=1` by default, or welcome to Deno 2.0 (#25213)
  4. - BREAKING: disallow `new Deno.FsFile()` (#25478)
  5. - BREAKING: drop support for Deno.run.{clearEnv,gid,uid} (#25371)
  6. - BREAKING: improve types for `Deno.serve` (#25369)
  7. - BREAKING: improved error code accuracy (#25383)
  8. - BREAKING: make supported compilerOptions an allow list (#25432)
  9. - BREAKING: move `width` and `height` options to `UnsafeWindowSurface`
  10. constructor (#24200)
  11. - BREAKING: remove --allow-hrtime (#25367)
  12. - BREAKING: remove "emit" and "map" from deno info output (#25468)
  13. - BREAKING: remove `--allow-none` flag (#25337)
  14. - BREAKING: remove `--jobs` flag (#25336)
  15. - BREAKING: remove `--trace-ops` (#25344)
  16. - BREAKING: remove `--ts` flag (#25338)
  17. - BREAKING: remove `--unstable` flag (#25522)
  18. - BREAKING: remove `deno bundle` (#25339)
  19. - BREAKING: remove `deno vendor` (#25343)
  20. - BREAKING: remove `Deno.[Tls]Listener.prototype.rid` (#25556)
  21. - BREAKING: remove `Deno.{Conn,TlsConn,TcpConn,UnixConn}.prototype.rid` (#25446)
  22. - BREAKING: remove `Deno.{Reader,Writer}[Sync]` and `Deno.Closer` (#25524)
  23. - BREAKING: remove `Deno.Buffer` (#25441)
  24. - BREAKING: remove `Deno.close()` (#25347)
  25. - BREAKING: remove `Deno.ConnectTlsOptions.{certChain,certFile,privateKey}` and
  26. `Deno.ListenTlsOptions.certChain,certFile,keyFile}` (#25525)
  27. - BREAKING: remove `Deno.copy()` (#25345)
  28. - BREAKING: remove `Deno.customInspect` (#25348)
  29. - BREAKING: remove `Deno.fdatasync[Sync]()` (#25520)
  30. - BREAKING: remove `Deno.File` (#25447)
  31. - BREAKING: remove `Deno.flock[Sync]()` (#25350)
  32. - BREAKING: remove `Deno.FsFile.prototype.rid` (#25499)
  33. - BREAKING: remove `Deno.fstat[Sync]()` (#25351)
  34. - BREAKING: remove `Deno.FsWatcher.prototype.rid` (#25444)
  35. - BREAKING: remove `Deno.fsync[Sync]()` (#25448)
  36. - BREAKING: remove `Deno.ftruncate[Sync]()` (#25412)
  37. - BREAKING: remove `Deno.funlock[Sync]()` (#25442)
  38. - BREAKING: remove `Deno.futime[Sync]()` (#25252)
  39. - BREAKING: remove `Deno.iter[Sync]()` (#25346)
  40. - BREAKING: remove `Deno.read[Sync]()` (#25409)
  41. - BREAKING: remove `Deno.readAll[Sync]()` (#25386)
  42. - BREAKING: remove `Deno.seek[Sync]()` (#25449)
  43. - BREAKING: remove `Deno.Seeker[Sync]` (#25551)
  44. - BREAKING: remove `Deno.shutdown()` (#25253)
  45. - BREAKING: remove `Deno.write[Sync]()` (#25408)
  46. - BREAKING: remove `Deno.writeAll[Sync]()` (#25407)
  47. - BREAKING: remove deprecated `UnsafeFnPointer` constructor type with untyped
  48. `Deno.PointerObject` parameter (#25577)
  49. - BREAKING: remove deprecated files config (#25535)
  50. - BREAKING: Remove obsoleted Temporal APIs part 2 (#25505)
  51. - BREAKING: remove remaining web types for compatibility (#25334)
  52. - BREAKING: remove support for remote import maps in deno.json (#25836)
  53. - BREAKING: rename "deps" remote cache folder to "remote" (#25969)
  54. - BREAKING: soft-remove `Deno.isatty()` (#25410)
  55. - BREAKING: soft-remove `Deno.run()` (#25403)
  56. - BREAKING: soft-remove `Deno.serveHttp()` (#25451)
  57. - BREAKING: undeprecate `Deno.FsWatcher.prototype.return()` (#25623)
  58. - feat: add `--allow-import` flag (#25469)
  59. - feat: Add a hint on error about 'Relative import path ... not prefixed with
  60. ...' (#25430)
  61. - feat: Add better error messages for unstable APIs (#25519)
  62. - feat: Add suggestion for packages using Node-API addons (#25975)
  63. - feat: Allow importing .cjs files (#25426)
  64. - feat: default to TS for file extension and support ext flag in more scenarios
  65. (#25472)
  66. - feat: deprecate import assertions (#25281)
  67. - feat: Don't warn about --allow-script when using esbuild (#25894)
  68. - feat: hide several --unstable-* flags (#25378)
  69. - feat: improve lockfile v4 to store normalized version constraints and be more
  70. terse (#25247)
  71. - feat: improve warnings for deprecations and lifecycle script for npm packages
  72. (#25694)
  73. - feat: include version number in all --json based outputs (#25335)
  74. - feat: lockfile v4 by default (#25165)
  75. - feat: make 'globalThis.location' a configurable property (#25812)
  76. - feat: print `Listening on` messages on stderr instead of stdout (#25491)
  77. - feat: remove `--lock-write` flag (#25214)
  78. - feat: require jsr prefix for `deno install` and `deno add` (#25698)
  79. - feat: require(esm) (#25501)
  80. - feat: Show hints when using `window` global (#25805)
  81. - feat: stabilize `Deno.createHttpClient()` (#25569)
  82. - feat: suggest `deno install --entrypoint` instead of `deno cache` (#25228)
  83. - feat: support DENO_LOG env var instead of RUST_LOG (#25356)
  84. - feat: TypeScript 5.6 and `npm:@types/node@22` (#25614)
  85. - feat: Update no-window lint rule (#25486)
  86. - feat: update warning message for --allow-run with no list (#25693)
  87. - feat: warn when using `--allow-run` with no allow list (#25215)
  88. - feat(add): Add npm packages to package.json if present (#25477)
  89. - feat(add): strip package subpath when adding a package (#25419)
  90. - feat(add/install): Flag to add dev dependency to package.json (#25495)
  91. - feat(byonm): support `deno run npm:<package>` when package is not in
  92. package.json (#25981)
  93. - feat(check): turn on noImplicitOverride (#25695)
  94. - feat(check): turn on useUnknownInCatchVariables (#25465)
  95. - feat(cli): evaluate code snippets in JSDoc and markdown (#25220)
  96. - feat(cli): give access to `process` global everywhere (#25291)
  97. - feat(cli): use NotCapable error for permission errors (#25431)
  98. - feat(config): Node modules option for 2.0 (#25299)
  99. - feat(ext/crypto): import and export p521 keys (#25789)
  100. - feat(ext/crypto): X448 support (#26043)
  101. - feat(ext/kv): configurable limit params (#25174)
  102. - feat(ext/node): add abort helpers, process & streams fix (#25262)
  103. - feat(ext/node): add rootCertificates to node:tls (#25707)
  104. - feat(ext/node): buffer.transcode() (#25972)
  105. - feat(ext/node): export 'promises' symbol from 'node:timers' (#25589)
  106. - feat(ext/node): export missing constants from 'zlib' module (#25584)
  107. - feat(ext/node): export missing symbols from domain, puncode, repl, tls
  108. (#25585)
  109. - feat(ext/node): export more symbols from streams and timers/promises (#25582)
  110. - feat(ext/node): expose ES modules for _ modules (#25588)
  111. - feat(flags): allow double commas to escape values in path based flags (#25453)
  112. - feat(flags): support user provided args in repl subcommand (#25605)
  113. - feat(fmt): better error on malfored HTML files (#25853)
  114. - feat(fmt): stabilize CSS, HTML and YAML formatters (#25753)
  115. - feat(fmt): support vto and njk extensions (#25831)
  116. - feat(fmt): upgrade markup_fmt (#25768)
  117. - feat(install): deno install with entrypoint (#25411)
  118. - feat(install): warn repeatedly about not-run lifecycle scripts on explicit
  119. installs (#25878)
  120. - feat(lint): add `no-process-global` lint rule (#25709)
  121. - feat(lsp): add a message when someone runs 'deno lsp' manually (#26051)
  122. - feat(lsp): auto-import types with 'import type' (#25662)
  123. - feat(lsp): html/css/yaml file formatting (#25353)
  124. - feat(lsp): quick fix for @deno-types="npm:@types/*" (#25954)
  125. - feat(lsp): turn on useUnknownInCatchVariables (#25474)
  126. - feat(lsp): unstable setting as list (#25552)
  127. - feat(permissions): `Deno.mainModule` doesn't require permissions (#25667)
  128. - feat(permissions): allow importing from cdn.jsdelivr.net by default (#26013)
  129. - feat(serve): Support second parameter in deno serve (#25606)
  130. - feat(tools/doc): display subitems in symbol overviews where applicable
  131. (#25885)
  132. - feat(uninstall): alias to 'deno remove' if -g flag missing (#25461)
  133. - feat(upgrade): better error message on failure (#25503)
  134. - feat(upgrade): print info links for Deno 2 RC releases (#25225)
  135. - feat(upgrade): support LTS release channel (#25123)
  136. - fix: add link to env var docs (#25557)
  137. - fix: add suggestion how to fix importing CJS module (#21764)
  138. - fix: add test ensuring als works across dynamic import (#25593)
  139. - fix: better error for Deno.UnsafeWindowSurface, correct HttpClient name,
  140. cleanup unused code (#25833)
  141. - fix: cjs resolution cases (#25739)
  142. - fix: consistent with deno_config and treat `"experimentalDecorators"` as
  143. deprecated (#25735)
  144. - fix: delete old Deno 1.x headers file when loading cache (#25283)
  145. - fix: do not panic running invalid file specifier (#25530)
  146. - fix: don't include extensionless files in file collection for lint & fmt by
  147. default (#25721)
  148. - fix: don't prompt when using `Deno.permissions.request` with `--no-prompt`
  149. (#25811)
  150. - fix: eagerly error for specifier with empty version constraint (#25944)
  151. - fix: enable `Win32_Security` feature in `windows-sys` (#26007)
  152. - fix: error on unsupported compiler options (#25714)
  153. - fix: error out if a valid flag is passed before a subcommand (#25830)
  154. - fix: fix jupyter display function type (#25326)
  155. - fix: Float16Array type (#25506)
  156. - fix: handle showing warnings while the progress bar is shown (#25187)
  157. - fix: Hide 'deno cache' from help output (#25960)
  158. - fix: invalid ipv6 hostname on `deno serve` (#25482)
  159. - fix: linux canonicalization checks (#24641)
  160. - fix: lock down allow-run permissions more (#25370)
  161. - fix: make some warnings more standard (#25324)
  162. - fix: no cmd prefix in help output go links (#25459)
  163. - fix: only enable byonm if workspace root has pkg json (#25379)
  164. - fix: panic when require(esm) (#25769)
  165. - fix: precompile preserve SVG camelCase attributes (#25945)
  166. - fix: reland async context (#25140)
  167. - fix: remove --allow-run warning when using deno without args or subcommand
  168. (#25684)
  169. - fix: remove entrypoint hack for Deno 2.0 (#25332)
  170. - fix: remove recently added deno.json node_modules aliasing (#25542)
  171. - fix: remove the typo in the help message (#25962)
  172. - fix: removed unstable-htttp from deno help (#25216)
  173. - fix: replace `npm install` hint with `deno install` hint (#25244)
  174. - fix: trim space around DENO_AUTH_TOKENS (#25147)
  175. - fix: update deno_doc (#25290)
  176. - fix: Update deno_npm to fix `deno install` with crossws (#25837)
  177. - fix: update hint for `deno add <package>` (#25455)
  178. - fix: update malva in deno to support astro css comments (#25553)
  179. - fix: update nodeModulesDir config JSON schema (#25653)
  180. - fix: update patchver to 0.2 (#25952)
  181. - fix: update sui to 0.4 (#25942)
  182. - fix: upgrade deno_ast 0.42 (#25313)
  183. - fix: upgrade deno_core to 0.307.0 (#25287)
  184. - fix(add/install): default to "latest" tag for npm packages in
  185. `deno add npm:pkg` (#25858)
  186. - fix(bench): Fix table column alignments and NO_COLOR=1 (#25190)
  187. - fix(BREAKING): make dns record types have consistent naming (#25357)
  188. - fix(byonm): resolve npm deps of jsr deps (#25399)
  189. - fix(check): ignore noImplicitOverrides in remote modules (#25854)
  190. - fix(check): move is cjs check from resolving to loading (#25597)
  191. - fix(check): properly surface dependency errors in types file of js file
  192. (#25860)
  193. - fix(cli): `deno task` exit with status 0 (#25637)
  194. - fix(cli): Default to auto with --node-modules-dir flag (#25772)
  195. - fix(cli): handle edge cases around `export`s in doc tests and default export
  196. (#25720)
  197. - fix(cli): Map error kind to `PermissionDenied` when symlinking fails due to
  198. permissions (#25398)
  199. - fix(cli): Only set allow net flag for deno serve if not already allowed all
  200. (#25743)
  201. - fix(cli): Warn on not-run lifecycle scripts with global cache (#25786)
  202. - fix(cli/tools): correct `deno init --serve` template behavior (#25318)
  203. - fix(compile): support 'deno compile' in RC and LTS releases (#25875)
  204. - fix(config): validate export names (#25436)
  205. - fix(coverage): ignore urls from doc testing (#25736)
  206. - fix(doc): surface graph errors as warnings (#25888)
  207. - fix(dts): stabilize `fetch` declaration for use with `Deno.HttpClient`
  208. (#25683)
  209. - fix(ext/console): more precision in console.time (#25723)
  210. - fix(ext/console): prevent duplicate error printing when the cause is assigned
  211. (#25327)
  212. - fix(ext/crypto): ensure EC public keys are exported uncompressed (#25766)
  213. - fix(ext/crypto): fix identity test for x25519 derive bits (#26011)
  214. - fix(ext/crypto): reject empty usages in SubtleCrypto#importKey (#25759)
  215. - fix(ext/crypto): support md4 digest algorithm (#25656)
  216. - fix(ext/crypto): throw DataError for invalid EC key import (#25181)
  217. - fix(ext/fetch): fix lowercase http_proxy classified as https (#25686)
  218. - fix(ext/fetch): percent decode userinfo when parsing proxies (#25229)
  219. - fix(ext/http): do not set localhost to hostname unnecessarily (#24777)
  220. - fix(ext/http): gracefully handle Response.error responses (#25712)
  221. - fix(ext/node): add `FileHandle#writeFile` (#25555)
  222. - fix(ext/node): add `vm.constants` (#25630)
  223. - fix(ext/node): Add missing `node:path` exports (#25567)
  224. - fix(ext/node): Add missing node:fs and node:constants exports (#25568)
  225. - fix(ext/node): add stubs for `node:trace_events` (#25628)
  226. - fix(ext/node): attach console stream properties (#25617)
  227. - fix(ext/node): avoid showing `UNKNOWN` error from TCP handle (#25550)
  228. - fix(ext/node): close upgraded socket when the underlying http connection is
  229. closed (#25387)
  230. - fix(ext/node): delay accept() call 2 ticks in net.Server#listen (#25481)
  231. - fix(ext/node): don't throw error for unsupported signal binding on windows
  232. (#25699)
  233. - fix(ext/node): emit `online` event after worker thread is initialized (#25243)
  234. - fix(ext/node): export `process.allowedNodeEnvironmentFlags` (#25629)
  235. - fix(ext/node): export JWK public key (#25239)
  236. - fix(ext/node): export request and response clases from `http2` module (#25592)
  237. - fix(ext/node): fix `Cipheriv#update(string, undefined)` (#25571)
  238. - fix(ext/node): fix Decipheriv when autoPadding disabled (#25598)
  239. - fix(ext/node): fix process.stdin.pause() (#25864)
  240. - fix(ext/node): Fix vm sandbox object panic (#24985)
  241. - fix(ext/node): http2session ready state (#25143)
  242. - fix(ext/node): Implement detached option in `child_process` (#25218)
  243. - fix(ext/node): import EC JWK keys (#25266)
  244. - fix(ext/node): import JWK octet key pairs (#25180)
  245. - fix(ext/node): import RSA JWK keys (#25267)
  246. - fix(ext/node): register `node:wasi` built-in (#25134)
  247. - fix(ext/node): remove unimplemented promiseHook stubs (#25979)
  248. - fix(ext/node): report freemem() on Linux in bytes (#25511)
  249. - fix(ext/node): Rewrite `node:v8` serialize/deserialize (#25439)
  250. - fix(ext/node): session close during stream setup (#25170)
  251. - fix(ext/node): Stream should be instance of EventEmitter (#25527)
  252. - fix(ext/node): stub `inspector/promises` (#25635)
  253. - fix(ext/node): stub `process.cpuUsage()` (#25462)
  254. - fix(ext/node): stub cpu_info() for OpenBSD (#25807)
  255. - fix(ext/node): support x509 certificates in `createPublicKey` (#25731)
  256. - fix(ext/node): throw when loading `cpu-features` module (#25257)
  257. - fix(ext/node): update aead-gcm-stream to 0.3 (#25261)
  258. - fix(ext/node): use primordials in `ext/node/polyfills/console.ts` (#25572)
  259. - fix(ext/node): use primordials in ext/node/polyfills/wasi.ts (#25608)
  260. - fix(ext/node): validate input lengths in `Cipheriv` and `Decipheriv` (#25570)
  261. - fix(ext/web): don't ignore capture in EventTarget.removeEventListener (#25788)
  262. - fix(ext/webgpu): allow to build on unsupported platforms (#25202)
  263. - fix(ext/webgpu): sync category comment (#25580)
  264. - fix(ext/webstorage): make `getOwnPropertyDescriptor` with symbol return
  265. `undefined` (#13348)
  266. - fix(flags): --allow-all should conflict with lower permissions (#25909)
  267. - fix(flags): don't treat empty run command as task subcommand (#25708)
  268. - fix(flags): move some content from docs.deno.com into help output (#25951)
  269. - fix(flags): properly error out for urls (#25770)
  270. - fix(flags): require global flag for permission flags in install subcommand
  271. (#25391)
  272. - fix(fmt): --check was broken for CSS, YAML and HTML (#25848)
  273. - fix(fmt): fix incorrect quotes in components (#25249)
  274. - fix(fmt): fix tabs in YAML (#25536)
  275. - fix(fmt/markdown): fix regression with multi-line footnotes and inline math
  276. (#25222)
  277. - fix(info): error instead of panic for npm specifiers when using byonm (#25947)
  278. - fix(info): move "version" field to top of json output (#25890)
  279. - fix(inspector): Fix panic when re-entering runtime ops (#25537)
  280. - fix(install): compare versions directly to decide whether to create a child
  281. node_modules dir for a workspace member (#26001)
  282. - fix(install): Make sure target node_modules exists when symlinking (#25494)
  283. - fix(install): recommend using `deno install -g` when using a single http url
  284. (#25388)
  285. - fix(install): store tags associated with package in node_modules dir (#26000)
  286. - fix(install): surface package.json dependency errors (#26023)
  287. - fix(install): Use relative symlinks in deno install (#25164)
  288. - fix(installl): make bin entries executable even if not put in
  289. `node_modules/.bin` (#25873)
  290. - fix(jupyter): allow unstable flags (#25483)
  291. - fix(lint): correctly handle old jsx in linter (#25902)
  292. - fix(lint): support linting jsr pkg without version field (#25230)
  293. - fix(lockfile): use loose deserialization for version constraints (#25660)
  294. - fix(lsp): encode url parts before parsing as uri (#25509)
  295. - fix(lsp): exclude missing import quick fixes with bad resolutions (#26025)
  296. - fix(lsp): panic on url_to_uri() (#25238)
  297. - fix(lsp): properly resolve jsxImportSource for caching (#25688)
  298. - fix(lsp): update diagnostics on npm install (#25352)
  299. - fix(napi): Don't run microtasks in napi_resolve_deferred (#25246)
  300. - fix(napi): Fix worker threads importing already-loaded NAPI addon (#25245)
  301. - fix(no-slow-types): better `override` handling (#25989)
  302. - fix(node): Don't error out if we fail to statically analyze CJS re-export
  303. (#25748)
  304. - fix(node): fix worker_threads issues blocking Angular support (#26024)
  305. - fix(node): implement libuv APIs needed to support `npm:sqlite3` (#25893)
  306. - fix(node): Include "node" condition during CJS re-export analysis (#25785)
  307. - fix(node): Pass NPM_PROCESS_STATE to subprocesses via temp file instead of env
  308. var (#25896)
  309. - fix(node/byonm): do not accidentally resolve bare node built-ins (#25543)
  310. - fix(node/cluster): improve stubs to make log4js work (#25146)
  311. - fix(npm): better error handling for remote npm deps (#25670)
  312. - fix(npm): root package has peer dependency on itself (#26022)
  313. - fix(permissions): disallow any `LD_` or `DYLD_` prefixed env var without full
  314. --allow-run permissions (#25271)
  315. - fix(permissions): disallow launching subprocess with LD_PRELOAD env var
  316. without full run permissions (#25221)
  317. - fix(publish): ensure provenance is spec compliant (#25200)
  318. - fix(regression): do not expose resolved path in Deno.Command permission denied
  319. error (#25434)
  320. - fix(runtime): don't error `child.output()` on consumed stream (#25657)
  321. - fix(runtime): use more null proto objects again (#25040)
  322. - fix(runtime/web_worker): populate `SnapshotOptions` for `WebWorker` when
  323. instantiated without snapshot (#25280)
  324. - fix(task): correct name for scoped npm package binaries (#25390)
  325. - fix(task): support tasks with colons in name in `deno run` (#25233)
  326. - fix(task): use current executable for deno even when not named deno (#26019)
  327. - fix(types): simplify mtls related types (#25658)
  328. - fix(upgrade): more informative information on invalid version (#25319)
  329. - fix(windows): Deno.Command - align binary resolution with linux and mac
  330. (#25429)
  331. - fix(workspace): handle when config has members when specified via --config
  332. (#25988)
  333. - perf: fast path for cached dyn imports (#25636)
  334. - perf: Use -O3 for sui in release builds (#26010)
  335. - perf(cache): single cache file for remote modules (#24983)
  336. - perf(cache): single cache file for typescript emit (#24994)
  337. - perf(ext/fetch): improve decompression throughput by upgrading `tower_http`
  338. (#25806)
  339. - perf(ext/node): reduce some allocations in require (#25197)
  340. - perf(ext/web): optimize performance.measure() (#25774)

voir sur githubimported 2026-09-28 via github-releases