Deno 1.21 improves REPL, error handling
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.
[ Also on InfoWorld: The rise of WebAssembly ]
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.
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:
- Deno’s error-handling behavior is now aligned for uncaught exceptions in asynchronous event loop tasks like
setInterval, or event handlers to the browser. A global “error” event will be dispatched for uncaught exceptions in the above-mentioned APIs.
- The unstable
Deno.upgradeHttpAPI, which can be used to perform HTTP protocol switches, now supports protocol switches on HTTP servers running on top of Unix connections.
DENO_NO_PROMPTenvironment variable has been added. When set, Deno will disable all interactive prompts, even when the output is an interactive terminal. This has an identical effect to specifying
–-no-prompton all invocations to the denocode binary.
- Built-in testing facilities have been improved. In one improvement,
deno testwill filter out stack frames coming from Deno’s internal code and show the line of code where the error originates.
- Akamai jumps into DBaaS market with Linode Managed Database
- Google Cloud launches Media CDN based on YouTube’s network
- Red Hat ships Application Foundations for Kubernetes
- AWS Amplify adds visual development tool
- Devs For Ukraine to raise money for charities, NGOs operating in warzone
- JDK 19: The features targeted for Java 19