Deno 1.21 has been released. This latest upgrade to the JavaScript/TypeScript runtime features improvements to the REPL (read-evaluate-print loop) and a move away from default type-checking.

The Deno REPL is a tool for prototyping and trying out new things. With Deno 1.21, an -–eval-file flag can be used with the deno repl subcommand. This flag allows for passing of a list of paths or URLs to files that will be executed before the REPL starts and is useful for building custom, specialized REPLs. Also, type checking has been disabled for imported modules in the REPL, leading to faster imports. And the REPL now has a global clear() function that acts as an alias for console.clear. This aligns with what is found in REPLs in many browsers, Deno’s developers said.

Deno 1.21 begins a path toward disabling type checking by default in deno run. Type checking will need to be performed explicitly using a new deno check subcommand. This change will be phased in gradually, with the new release adding a deno check subcommand and a DENO_FUTURE_CHECK=1 environment variable that can be set to switch Deno into the new “no type check by default” mode that will become the default in the future.

Note that this change does not mean TypeScript support is being removed from Deno. In explaining the reasoning behind the change, Deno’s developers said recent years have shown the usefulness of annotating JavaScript code with type information. But type checking can be slow and impact application startup performance. Most developers already use an IDE that surfaces the results of type checking at development time. Additionally, JavaScript is on a path toward getting native type annotations.

Announced April 21, Deno 1.21 can be downloaded by current users via the deno upgrade command. Instructions for new users can be found in release notes.

Other new features and improvements in Deno 1.21 include the following:

Copyright © 2022 IDG Communications, Inc.


Leave a Reply

Your email address will not be published. Required fields are marked *