Deno 1.42 Introduces Faster Startups, Enhanced Node Compatibility, and New TypeScript Package Registry
Deno 1.42, the latest release of the modern runtime for JavaScript, TypeScript, and WebAssembly, delivers several significant enhancements, including the introduction of JSR, a new package registry specifically designed for JavaScript and TypeScript. This release also includes substantial improvements to Node and NPM compatibility, alongside faster startup times, enhancing the overall developer experience.
Officially announced on March 28, Deno 1.42 can be easily upgraded through the terminal using the deno upgrade
command. This release represents a continued effort by the Deno team to simplify dependency management while ensuring compatibility with existing ecosystems like Node.js.
With Deno 1.42, users can now seamlessly consume and publish modules to the JSR package registry using the deno add
and deno publish
subcommands. JSR aims to provide a modern, TypeScript-first, and cross-platform-compatible package registry, tightly integrated with Deno. Despite the introduction of JSR, Deno will continue to support NPM, ensuring that developers can leverage both ecosystems as needed.
On the Node.js compatibility front, Deno 1.42 includes several notable updates. The async_hooks
module now supports additional APIs, such as EventEmitterAsyncResource
and AsyncLocalStorage.enterWith
. The crypto
module introduces new APIs like getRandomValues()
, subtle
, getCipherInfo()
, and createPublicKey()
, along with expanded curve support in multiple APIs. Additionally, the worker_threads
module has undergone a significant overhaul to enhance its functionality.
A key change in Deno 1.42 addresses an issue related to type-checking during runtime execution with the deno run --check
flag. In earlier versions, type-checking could unexpectedly occur midway through execution due to dynamic imports or the spawning of a worker, which could lead to application failures. This behavior posed challenges, particularly with the integration of JSR. To mitigate this, Deno has removed runtime type-checking after the initial check, encouraging developers to use the deno check
subcommand to ensure comprehensive type-checking before execution.
Performance improvements are also a highlight of Deno 1.42. Linux users will notice up to a 10% reduction in startup times, thanks to optimizations like warming up bootstrap initialization during snapshot time and reducing memory allocations. Additionally, the new environment variable DENO_FUTURE=1
has been introduced, allowing developers to opt into changes that will be part of Deno 2.0, offering an early glimpse of future improvements.
Deno 1.42 continues to push the boundaries of modern web development by making dependency management more efficient, improving compatibility with existing tools, and enhancing performance—all while keeping a strong focus on the needs of TypeScript-first development.