Deno 1.21 has arrived with significant updates aimed at improving the developer experience, particularly in areas like the REPL (Read-Evaluate-Print Loop) and error handling. As a runtime for JavaScript and TypeScript, Deno is known for its simplicity and modern features, and this latest release further refines its functionality. One of the major changes is the introduction of the --eval-file
flag, which allows developers to specify paths or URLs to files that will be executed before starting the REPL. This feature is useful for building customized REPL environments tailored to specific workflows or experimentation.
In addition to the new flag, Deno 1.21 has made improvements to module imports in the REPL. Type checking for imported modules has been disabled by default, leading to faster import times and a more fluid development experience. The REPL also now includes a clear()
function, which acts as an alias for the standard console.clear()
. This update brings Deno’s REPL more in line with similar environments found in many modern browsers, streamlining the process of clearing the console in between iterations of code execution.
Perhaps the most notable change in Deno 1.21 is the shift toward disabling type checking by default in the deno run
command. While this marks a departure from the previous behavior, it is not a move away from TypeScript support. Instead, Deno is introducing a more explicit model for type checking. Developers will now need to use a separate deno check
subcommand to perform type checking, with the added benefit of faster execution times in production code due to reduced overhead. This change is part of a gradual transition, and developers can toggle the new behavior with the DENO_FUTURE_CHECK=1
environment variable, signaling the eventual deprecation of type checking by default.
The motivation behind this shift lies in performance concerns and the increasing use of type annotations in JavaScript. While type checking can slow down the startup of an application, modern IDEs already provide real-time type analysis, making runtime checks less critical. Additionally, JavaScript itself is moving toward native support for type annotations, which further reduces the reliance on runtime type checking in Deno. By making these changes, Deno continues to evolve as a fast, efficient, and developer-friendly runtime for JavaScript and TypeScript applications.