Deno 2.4
10 months ago
- #Deno
- #JavaScript
- #TypeScript
- Deno 2.4 reintroduces the `deno bundle` command for creating single-file JavaScript bundles, supporting server-side and browser platforms with npm and JSR dependencies.
- New feature: Import text and bytes directly into JavaScript modules using `--unstable-raw-imports` flag, simplifying asset management.
- Built-in OpenTelemetry support is now stable, enabling auto-instrumentation for logs, metrics, and traces without the `--unstable-otel` flag.
- Introduces `--preload` flag to execute code before the main script, useful for modifying globals or loading data.
- New `deno update` subcommand simplifies dependency management by updating npm and JSR dependencies to the latest versions.
- Enhanced coverage collection with `deno run --coverage` for better test suite coverage reports, including subprocesses.
- New `DENO_COMPAT=1` environment variable improves ergonomics for `package.json`-first projects by enabling several compatibility flags.
- Permission changes include subdomain wildcards and CIDR ranges for `--allow-net`, and new `--deny-import` flag to block specific hosts.
- Support for conditional exports in npm packages, enabling different exports based on user-provided conditions like `react-server`.
- `deno run` now supports bare specifiers as entry points, simplifying script execution with imports defined in `deno.json`.
- `deno fmt` now formats XML, SVG, and `.mustache` files, with better support for `tsconfig.json` options.
- Simplified Node globals availability, making `Buffer`, `global`, `setImmediate`, and `clearImmediate` accessible everywhere.
- Improved Node.js API support, including `fs.glob`, `process.loadEnvFile`, and over 95% compatibility for several Node modules.
- LSP improvements include better handling of `deno.config`, Jupyter cells, and auto-import resolutions.
- Other enhancements: `fetch` over Unix and Vsock sockets, better Jupyter kernel management, and Markdown-compatible tables for `deno bench` and `deno coverage`.