JavaScript in places you didn’t expect
Discover the surprising platforms and applications leveraging JavaScript beyond traditional web browsers.
Explore the key updates and features of Deno 2.0 and how it impacts developers.
Theo - t3․ggOctober 1, 2024This article was AI-generated based on this episode
Deno 2.0 introduces several significant updates, enhancing both functionality and usability. Here are the major updates:
Introduction of Node's Process Global
process
global is now available, easing transitions from Node.js.Changes to Global Variables
window
global to avoid conflicts.globalThis
or self
instead.Dependency Management Improvements
deno add
sub command handles specifiers with subpaths.package.json
and deno.json
files.Overhaul of the Permission System
These updates collectively streamline development processes and improve compatibility with existing JavaScript and TypeScript projects.
Deno 2.0 introduces significant improvements in dependency management, making the process smoother and less error-prone.
deno add
Sub Command
deno add
sub command now handles specifiers with subpaths.Requirement for JSR or NPM Prefixes
JSR
or NPM
prefixes when adding dependencies.Handling of package.json
and deno.json
Files
package.json
, Deno will prefer adding npm dependencies to it rather than the deno.json
.package.json
using the --dev
flag in the deno add
command.deno remove
sub command has been added for removing unnecessary dependencies.These features collectively enhance the developer experience, making dependency management more intuitive and less cumbersome.
Deno 2.0 brings notable updates to global variables, enhancing compatibility and reducing conflicts.
process
global
process
variable.window
global
window
global was intended to make Deno more browser-like.window
to determine if they were running in a browser.globalThis
or self
to avoid these conflicts.These changes aim to improve the developer experience by aligning better with existing expectations and reducing unexpected bugs.
Deno 2.0 brings significant improvements in compatibility with Node.js and NPM, making it easier for developers to transition.
Enhanced CommonJS Support
deno run index.cjs
.Bring-Your-Own-Node-Modules Feature
node_modules
directory for projects with a package.json
, simplifying project setup.node_modules
directory can be configured to either automatic, manual, or none, based on project needs.node_modules
.Enhanced Node API Compatibility
crypto
and async local storage
.These updates collectively offer a smoother and more intuitive migration path from Node.js to Deno, while retaining the advantages of Deno’s modern architecture and enhanced security features.
Rusty V8 is a library that offers high-quality, zero-overhead Rust bindings to V8's C++ API. It is designed to integrate V8's JavaScript engine seamlessly with Rust applications.
Rusty V8’s compatibility and ease of integration make it a groundbreaking tool for developers looking to harness the power of V8 within Rust. This development also plays a crucial role in the modern zero-config JavaScript runtime, like Deno.
Discover the surprising platforms and applications leveraging JavaScript beyond traditional web browsers.
Explore how Replit's AI-powered platform is transforming coding, making it accessible for everyone, and reshaping the future of product development.
Explore why modern server-side JavaScript isn't just PHP all over again, but a leap forward in web development.