Deno 1.21 improves REPL error handling

Deno 1.21 has been released. This latest upgrade to the JavaScript/TypeScript runtime features advancements to the REPL (read-evaluate-print loop) and a move away from lapse 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 precedently the REPL starts and is advantageous for edifice manner 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() office that acts as an alias for relieve.clear. This aligns with what is establish in REPLs in many browsers Denos developers said.

[ Also on InfoWorld: The rise of WebAssembly ]

Deno 1.21 begins a path toward disabling type checking by lapse in deno run. Type checking will need to be accomplished 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 changeable that can be set to switch Deno into the new ’no type check by lapse’ mode that will befit the lapse in the forthcoming.

Note that this change does not mean TypeScript support is being removed from Deno. In explaining the reasoning behind the change Denos developers said late years have shown the advantageousness of annotating JavaScript code with type information. But type checking can be slow and contact application startup accomplishment. Most developers already use an IDE that surfaces the results of type checking at outgrowth time. Additionally JavaScript is on a path toward getting indigenous type annotations.

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

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

  • Denos fault-handling conduct is now aligned for uncaught exceptions in asynchronous occurrence loop tasks like setTimeout setInterval or occurrence handlers to the browser. A global ’fault’ occurrence will be dispatched for uncaught exceptions in the above-mentioned APIs.
  • The unstable Deno.upgradeHttp API which can be used to accomplish HTTP protocol switches now supports protocol switches on HTTP servers running on top of Unix connections.
  • A DENO_NO_PROMPT environment changeable has been added. When set Deno will disable all interactive prompts even when the output is an interactive final. This has an same effect to specifying –-no-prompt on all invocations to the denocode binary.
  • Built-in testing facilities have been improved. In one advancement deno test will strain out stack frames coming from Denos inner code and show the line of code where the fault originates.