惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
F
Fortinet All Blogs
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
小众软件
小众软件
有赞技术团队
有赞技术团队
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
AWS News Blog
AWS News Blog
C
Cisco Blogs
美团技术团队
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
人人都是产品经理
人人都是产品经理
宝玉的分享
宝玉的分享
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
W
WeLiveSecurity
D
DataBreaches.Net
博客园 - 司徒正美
Blog — PlanetScale
Blog — PlanetScale
IT之家
IT之家
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Simon Willison's Weblog
Simon Willison's Weblog
Google DeepMind News
Google DeepMind News
T
The Blog of Author Tim Ferriss
Know Your Adversary
Know Your Adversary
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Cloudflare Blog
Vercel News
Vercel News
月光博客
月光博客
T
Tailwind CSS Blog
H
Help Net Security
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Cisco Talos Blog
Cisco Talos Blog
Microsoft Security Blog
Microsoft Security Blog
V
V2EX
WordPress大学
WordPress大学
Cyberwarzone
Cyberwarzone
Recent Announcements
Recent Announcements

Deno

Deno 2.8 | Deno Claw Patrol: an open-source security firewall for agents | Deno Fresh 2.3: Zero JS by default, View Transitions, and Temporal support | Deno Deno 2.7: Temporal API, Windows ARM, and npm overrides | Deno Build a dinosaur runner game with Deno, pt. 6 | Deno Build a dinosaur runner game with Deno, pt. 5 | Deno Deno Deploy is Generally Available | Deno Introducing Deno Sandbox | Deno Build a dinosaur runner game with Deno, pt. 4 | Deno Build a dinosaur runner game with Deno, pt. 3 | Deno Build a dinosaur runner game with Deno, pt. 2 | Deno React / Next.js Denial-of-Service Vulnerability: Deno Deploy users protected | Deno Deno 2.6: dx is the new npx | Deno Build a dinosaur runner game with Deno, pt. 1 | Deno React Server Functions / Next.js Vulnerability: Deno Deploy users protected | Deno My highlights from the new Deno Deploy | Deno Deno's Other Open Source Projects | Deno How Deno protects against npm exploits | Deno Help Us Raise $200k to Free JavaScript from Oracle | Deno Deno 2.5: Permissions in the config file | Deno Fresh 2.0 Graduates to Beta, Adds Vite Support | Deno Deno 2.4: deno bundle is back | Deno JavaScript™ Trademark Update | Deno What's coming to JavaScript | Deno A brief history of JavaScript | Deno Reports of Deno's Demise Have Been Greatly Exaggerated | Deno An Update on Fresh | Deno How Plaid migrated 100 services to a new database platform 5x faster with Deno | Deno Deno 2.3: Improved deno compile, local npm packages, and more | Deno Add JSR packages with pnpm and Yarn | Deno Zero-config Debugging with Deno and OpenTelemetry | Deno Exploring Art with TypeScript, Jupyter, Polars, and Observable Plot | Deno Deno v Oracle Update 3: Fighting the JavaScript Trademark | Deno Build a custom RAG AI agent in TypeScript and Jupyter | Deno How to get deep traces in your Node.js backend with OTel and Deno | Deno toranoana.deno #20 登録受付中(2025年3月14日) | Deno Node just added TypeScript support. What does that mean for Deno? | Deno The Dino 🦕, the Llama 🦙, and the Whale 🐋 | Deno Publish a lint rule, get a prize | Deno Deno 2.2: OpenTelemetry, Lint Plugins, node:sqlite | Deno If you're not using npm specifiers, you're doing it wrong | Deno How Deno's documentation is evolving | Deno Oracle justified its JavaScript trademark with Node.js—now it wants that ignored | Deno Introducing the JSR open governance board | Deno Intro to Wasm in Deno | Deno Announcing OpenAI on JSR | Deno Deno in 2024 | Deno Goodbye WinterCG, welcome WinterTC | Deno Build a SolidJS app with Deno | Deno Run your Next.js SSR app on Deno Deploy | Deno Solve Advent of Code 2024 with Deno and Win Prizes! | Deno Deno v. Oracle: Canceling the JavaScript Trademark | Deno Deno 2.1: Wasm Imports and other enhancements | Deno Build a Typesafe API with tRPC and Deno | Deno Self-contained Executable Programs with Deno Compile | Deno Build a Database App with Drizzle ORM and Deno | Deno Introducing your new JavaScript package manager: Deno | Deno Announcing Growthbook on JSR | Deno Build an Astro site with Deno | Deno How to convert CommonJS to ESM | Deno Announcing Deno 2 | Deno The Final Touches: What’s New In v2.0.0-rc.10 | Deno Announcing Stable V8 Bindings for Rust | Deno Deno 2.0 Release Candidate | Deno Secure, efficient private npm registries with Cloudsmith and Deno | Deno Painting the Plane as We Fly It: Designing JSR | Deno Introducing Web Cache API support on Deno Deploy | Deno Deno 1.46: The Last 1.x Release | Deno Protect your cloud spend with new Deno Deploy spend limits | Deno What we got wrong about HTTP imports | Deno Benchmarking AWS Lambda Cold Starts Across JavaScript Runtimes | Deno Announcing Supabase on JSR | Deno Deno 1.45: Workspace and Monorepo Support | Deno Introducing KV Backup for Deno Subhosting | Deno A Gentle Intro to TypeScript | Deno Announcing Hono on JSR | Deno How We Made the Deno Language Server Ten Times Faster | Deno How the Guardian uses Deno to audit accessibility and performance across their 2.7 million articles | Deno Introducing More Flexible Domain Association for Deno Subhosting | Deno The stabilization process of the Standard Library has begun | Deno How we built a secure, performant, multi-tenant cloud platform to run untrusted code | Deno The Deno Standard Library is now available on JSR | Deno How to document your JavaScript package | Deno Your Low Code Solution Needs an Escape Hatch | Deno Deno 1.43: Improved Language Server performance | Deno How Slack used Deno to save months of engineering effort in launching their new platform | Deno JSR Is Not Another Package Manager | Deno Announcing the Hookdeck SDK on JSR | Deno Announcing the Neon Serverless Driver on JSR | Deno An intro to TSConfig for JavaScript Developers | Deno How we built JSR | Deno How Netlify used Deno Subhosting to build a successful edge functions product | Deno Introducing Simpler Project Creation in Deno Deploy | Deno Deno 1.42: Better dependency management with JSR | Deno Introducing deployctl, the command line interface for Deno Deploy | Deno Introducing JSR - the JavaScript Registry | Deno How to add Monaco to a Next.js app and securely run untrusted user code | Deno Survey Results and Roadmap | Deno Deno 1.41: smaller deno compile binaries | Deno Webhooks suck, but here are alternatives | Deno
Deno 1.44: Private npm registries, improved Node.js compat, and performance boosts | Deno
2024-05-30 · via Deno

Deno 1.44 introduces support for private npm registries, enabling users to use internal packages with Deno by configuring an .npmrc file. Additionally, Deno 1.44 now supports gRPC connections, enabling robust high performance communication to services like Google Cloud Platform. This release also improves Node.js compatibility, and re-enables V8 pointer compression for significant performance gains. As usual, a bunch of other features and improvements are included in this release to make your development experience even smoother.

To upgrade to Deno 1.44, run the following in your terminal:

If Deno is not yet installed, run one of the following commands to install or learn how to install it here.


brew install deno


curl -fsSL https://deno.land/install.sh | sh


iwr https://deno.land/install.ps1 -useb | iex

What’s New in Deno 1.44

  • Support for private npm registries
  • gRPC connections now supported
  • Node.js compatibility improvements
  • Performance improvements
  • The Standard Library is moving closer to stabilization
  • Deno.exitCode API
  • Request.bytes() and Response.bytes()
  • Lint rules updates
  • Clean coverage directory on test runs
  • Print feedback for slow running tests
  • Deno.FsFile stabilizations
  • Changes in FFI API
  • Pick a random port in deno serve
  • WebSocket timeout
  • Language server improvements
  • Try out Deno 2 features with DENO_FUTURE=1
  • Acknowledgments

Support for private npm registries

Many large organizations host their own private npm registries to manage internal packages. Deno 1.44 now supports using an .npmrc file to configure Deno to fetch packages from this private registry. This feature is available when using private packages in a package.json or when importing packages directly using npm: specifiers.

// .npmrc
@mycompany:registry=http://mycompany.com:8111/
//mycompany.com:8111/:_auth=secretToken

{
  "imports": {
    "@mycompany/package": "npm:@mycompany/package@1.0.0"
  }
}

import { hello } from "@mycompany/package";

console.log(hello());
$ deno run main.ts
Hello world!

You can also use private npm packages in your package.json file:

// package.json
{
  "dependencies": {
    "@mycompany/package": "1.0.0"
  }
}

import { hello } from "@mycompany/package";

console.log(hello());
$ deno run main.ts
Hello world!

gRPC connections now supported

Deno can now connect to gRPC services using the @grpc/grpc-js client library from npm. This enables you to connect to gRPC services, such as Google Cloud Platform from Deno. Here is an example using the Google Cloud Vision API via the Google Cloud SDK to classify an image:

import { ImageAnnotatorClient } from "npm:@google-cloud/vision";

const client = new ImageAnnotatorClient();
const [result] = await client.labelDetection("./cat_dog.webp");
const labels = result.labelAnnotations;
console.log("Labels:");
for (const label of labels) {
  console.log(" - ", label.description);
}

gRPC is a high-performance, open-source, universal RPC framework that enables efficient communication between services. With gRPC support, you can build real-time, interactive applications that leverage the low-latency communication capabilities of gRPC.

Node.js compatibility improvements

This release marks a significant step forward in Deno’s compatibility with Node.js and npm packages.

As a major milestone, we have been able to run Next.js applications with Deno with this release. While there are some rough edges, such as the need to use DENO_FUTURE=1, we’re confident that we can work through these issues quickly. We’ll publish a blog post soon with more details on how to run Next.js applications with Deno.

For now, here is an example of running a Next.js application with Deno using the new Next.js server actions to stream a file:


Other Node.js compatibility improvements include:

  • Add Buffer.isUtf8() and Buffer.isAscii() which ts-node relies upon.
  • Fix error when npm dependencies are bundled and passed process.uptime around. This error occured because our implementation relied on this being correct. We’ve rewritten process.uptime to not rely on any this references anymore.
  • Fix SIG* listeners not being tracked in process.listeners. This fixes a bug where the signal-exit package would not exit correctly. This package is used in many popular CLI tools like vitest.
  • Fix tinypool unable to terminate worker_threads. This was caused by us returning a different return code in Worker.terminate(). The tinypool package is used very heavily in vitest.
  • Stub AsyncResource.emitDestroy() for tinypool to allow it to cleanly shut down workers.
  • Fix missing methods when passing MessagePort to Node worker_threads. This addresses several errors related to worker communication in vitest.
  • Allow the Process class to be instantiated without the new keyword. This addresses an issue with jest, the popular test runner.
  • Stub perf_hooks.PerformaceObserver to get Next.js’ build command working.
  • Check if resource exists before attempting to close it. This makes GRPC’s deadline example work.
  • Set up node_modules/.bin entries for packages with bin entry points. This was a long requested feature in relation to npm support.
  • Make parsing of incorrext package.json files more robust. Some npm packages ship with a package.json file that doesn’t adhere to the expected data types.
  • Fix wrong exception thrown when calling fs.rmSync on a directory instead of a file.
  • Stub findSourceMap for ava
  • Fix default status code property not initialized with 200 on ServerResponse. This makes the 11ty dev server work.
  • Fix geteuid missing in node:process.
  • Fix stream not being marked as cancelled in gRPC. This makes the streaming example work.
  • Fix wrong flag emitted upon emitting the response event. This fixes error propagation in gRPC.
  • Allow process.env values to be deleted via the delete keyword. This pattern is sometimes used in integrationt testing.
  • Use a separate module cache per worker_thread. With that resolved SvelteKit is working.
  • Fix a rare re-export bug with CommonJS that was discovered with the @solana/spl-governance npm package.
  • Fix napi_get_element and napi_set_element which makes npm DuckDB adapter work with Deno.
  • Make HOME directory detection more reliable for running server functions in OpenNext.

Additionally deno task got smarter when working with package.json files. If it’s discovered that a task calls npm run <another_task>, Deno will use deno task instead of running npm binary, see #23036 for more details.

Performance improvements

Deno 1.44 introduces several performance improvements that make Deno faster and more memory efficient. We expect many projects to see memory usage reductions between 5-30%, depending on the workload.

  • Reduced memory usage with V8 pointer compression: Re-enabling V8 pointer compression allows V8 to store pointers more efficiently, greatly reducing memory usage. This enhancement is particularly beneficial for real-world scenarios with significant object allocations, leading to a notable reduction in memory consumption. Benchmark results comparing the memory consumption of http hello world, text encoding, and rendering deno.com. For the synthetic benchmarks, there is a 2-7% memory reduction, but for real-world scenarios like deno.com, it's roughly 30%

  • Faster module loading: Optimized module loading by performing tasks in parallel, including analyzing and emitting CommonJS exports and re-exports, compiling TypeScript to JavaScript during deno cache operations, skipping unnecessary directory lookups during module resolution, and downloading metadata files as soon as possible. These enhancements significantly speed up module processing and caching efficiency, reducing overall startup times. These changes make projects with heavy use of dynamic imports around 2-3x quicker to start (#23856, #23894, #23892, #23851, #23836).

  • Faster startup time in AWS Lambda: Using a Write-Ahead Logging (WAL) journal for SQLite databases in the DENO_DIR improves code caching and startup time for Deno instances, particularly beneficial in serverless environments like AWS Lambda. This change helps reduce the latency for cold starts, making serverless applications more responsive (#23955).

  • Improved language server performance: Caching semantic tokens for open documents in the LSP enhances language server performance, making development smoother and more efficient by reducing the time needed to re-analyze open files (#23799).

The Standard Library is moving closer to stabilization

The Deno Standard Library offers a set of high quality packages that are audited by the core team and guaranteed to work with Deno.

These days, the Standard Library is be published exclusively to JSR under the @std scope. Existing versions of the Standard Library will continue to live at https://deno.land/std. This move, alongside Deno’s new workspaces functionality, is part of the changes coming in Deno 2. For more details, check out the Standard Library’s roadmap for stabilization.

Deno.exitCode API

This release adds a new, stable Deno.exitCode API. You can use this API to get and set the would-be exit code of your program:

console.log("Initial code", Deno.exitCode);

try {
  console.log("Try to retrieve data...");
  await fetch("https://doesnt.exist");
} catch (e) {
  console.log("Failed to retrieve data");
  
  Deno.exitCode = 42;
  
}

console.log("Exit code after the task", Deno.exitCode);
$ deno run --allow-net exit_code.ts
Initial code 0
Try to retrieve data...
Failed to retrieve data!
Exit code after the task 42
$ echo $?
42

You can use this API to assign a particular exit code, but not exit immediately, like when using Deno.exit(code?) API. This API allows to perform additional cleanup before the program finishes.

This API is very similar to process.exitCode API from Node.js, however Deno.exitCode has stronger validation and requires to set a valid decimal exit code. Both APIs work in tandem and reflect values as expected:

import process from "node:process";

console.log("Deno 1 - exit code -", Deno.exitCode);
console.log("Node.js 1 - exit code -", process.exitCode);

Deno.exitCode = 42;

console.log("Deno 2 - exit code -", Deno.exitCode);
console.log("Node.js 2 - exit code -", process.exitCode);

process.exitCode = 70;

console.log("Deno 3 - exit code -", Deno.exitCode);
console.log("Node.js 3 - exit code -", process.exitCode);
$ deno run exit_code.ts
Deno 1 - exit code - 0
Node.js 1 - exit code - 0
Deno 2 - exit code - 42
Node.js 2- exit code - 42
Deno 3 - exit code - 70
Node.js 3 - exit code - 70
$ echo $?
70

Thanks to Luke Edwards for suggestion and initial implementation of this API.

Request#bytes() and Response#bytes()

The Fetch API specification was updated recently with a new .bytes()-method on both the Request and Response classes. This small change improves quality of life significantly when working with bytes. You no longer have to get the underlying ArrayBuffer and convert it to Uint8Array.


const response = await fetch("https://example.com");
const buffer = new Uint8Array(await response.arrayBuffer());


const response = await fetch("https://example.com");
const buffer = await response.bytes();

Lint rules updates

This release brings a big update to an existing rule and a new lint rule.

no-undefined-vars

no-undefined-vars now works in JSX and TSX files:

import React from "react"; 
const Foo = () => {
  return "Hello world!";
};

This improvement will be particularly useful for users of Fresh.

This rule is still enabled by default, like in previous releases.

no-boolean-literal-for-arguments

It is common to define functions that can take booleans as arguments. However, passing boolean literals as parameters can lead to lack of context regarding the role of the argument inside the function in question:

function redraw(allViews: boolean, inline: boolean) {
  
}

redraw(true, true);

This rule enforces that all boolean parameters need to use “self-documenting” constants:

function redraw(allViews: boolean, inline: boolean) {
  
}

const ALL_VIEWS = true;
const INLINE = false;
redraw(ALL_VIEWS, INLINE);

Thanks to Jorge Martin Juarez for implementing this rule.

This rule is disabled by default. You can enable it in your deno.json(c) config file like so:

{
  "lint": {
    "rules": {
      "include": ["no-boolean-literal-for-arguments"]
    }
  }
}

Clean coverage directory on test runs

Deno’s built-in test runner received a new --clean flag which will empty the coverage directory before running the test suite. This seems like a minor change, but it solves the problem where coverage data for long deleted files was still around.

deno test --coverage --clean

Be aware that this flag will cause conflicts when running multiple deno test commands in parallel or in series, and then viewing the aggregated coverage report. If you are running tests in parallel, you should not use the --clean flag. If running in series, only pass the --clean flag to the first deno test invocation.

We noticed that long running tests can cause confusion as to whether the test runner is still working when no output is shown:

$ deno test slow_test.ts
Check file:///tmp/test_slow.ts
running 1 test from test_slow.ts
test ...
'test' has been running for over 1m0s
'test' has been running for over 2m0s
 ok (2m10s)

ok | 1 passed | 0 failed (2m10s)

You can configure the interval of these messages using the DENO_SLOW_TEST_TIMEOUT env var that accepts the number of seconds after which the message is printed. We are considering adding a hard timeout to slow tests that will forcefully abort the test. We’d love to hear your feedback about this feature.

Deno.FsFile stabilizations

You no longer need to use the --unstable-fs flag, which frequently caused issues in various contexts, including with frameworks like Next.js. The following methods have been stabilized:

  • Deno.FsFile.syncData[Sync]() and Deno.FsFile.sync[Sync]() (#23733)
  • Deno.FsFile.unlock[Sync]() and Deno.FsFile.lock[Sync]() (#23754)

These stabilizations remove the need for the unstable flag, making file system operations smoother and more reliable. By incorporating these changes, the API now supports essential file synchronization and locking capabilities directly within the stable Deno runtime. This enhancement is particularly useful for ensuring data integrity and handling concurrent file operations effectively.

Changes in FFI API

Deno’s FFI API allows you to call native libraries from JavaScript code. In Deno 1.44, we’ve made some changes to improve this functionality.

We have updated the handling of u64 and i64 types from native code. Previously, these symbols were represented as number | bigint. Starting with v1.44, they are always of type bigint. This change aligns the API with JavaScript’s handling of large integers and ensures better performance and type consistency. While this is a breaking change, the API remains unstable, and we are using this opportunity to address type quirks as we move towards stabilization of the Deno.dlopen() API. (#23981, #23983)

These updates are part of our ongoing efforts to stabilize the FFI API for Deno 2, ensuring it provides a robust and consistent experience for calling native libraries from Deno.

Pick a random port in deno serve

It’s been a month the deno serve command was added to Deno. It allows you to write servers in a declarative way. We noticed that often during development you want the server to start and don’t really care which port it will spawn on. For that reason we’ve added support for passing --port 0, which returns a random free port selected by your operating system.

$ deno serve --port 0 server.ts
deno serve: Listening on http://localhost:58333/

WebSocket timeout

Deno has a ping/pong mechanism for WebSocket API that keeps connections alive. Unfortunately the default timeout of 120s was too long for many popular reverse-proxy servers like Nginx. Many of these servers have a default timeout of 60s by default. This caused connections to Deno WebSocket servers to close prematurely.

The default “idle” timeout for ping/pong messages was lowered to 30s. Most WebSockets servers should be more reliable with this change, without any manual intervention.

Thanks to Alex Gleason for implementing this change.

Language server improvements

This month we spent a good chunk of time cleaning up the language server which resulted in several performance improvements and bug fixes, namely:

  • added caching for semantic tokens for open documents (#23799)
  • reuse “sloppy imports” resolver (#23764)
  • apply import fix to missing declaration code action (#23924)
  • fix JSDoc display in named examples (#23927)
  • show reference CodeLens for methods (#23804)

Try out Deno 2 features with DENO_FUTURE=1

We continue to ship changes that will take effect in Deno 2, that you can try today by running Deno with DENO_FUTURE=1 environment variable.

This release brings following changes:

  • deno install now handles adding dependencies to deno.json(c) and package.json files, making migration of Node.js projects much easier.
  • All file system APIs are stable (--unstable-fs flag is not needed)
  • WebGPU API is stable (--unstable-webgpu flag is not needed)
  • FFI API is stable (--unstable-ffi flag is not needed)
  • deno install properly sets up node_modules/.bin/ entries for npm packages with binary entrypoints

Acknowledgments

We couldn’t build Deno without the help of our community! Whether by answering questions in our community Discord server or reporting bugs, we are incredibly grateful for your support. In particular, we’d like to thank the following people for their contributions to Deno 1.44: Alex Gleason, Antoine du Hamel, Bedis Nbiba, charlotte ✨, chirsz, Evan, Felipe Baltor, futsuuu, Hajime-san, Hasan-Alrimawi, Kenta Moriuchi, Kyle Kelley, Luke Edwards, Mathias Lafeldt, Mattias Buelens, Mike Mulchrone, Milly, Simon Lecoq, Volker Schlecht.

Would you like to join the ranks of Deno contributors? Check out our contribution docs here, and we’ll see you on the list next time.

Believe it or not, the changes listed above still don’t tell you everything that got better in 1.44. You can view the full list of pull requests merged in Deno 1.44 on GitHub here.

Thank you for catching up with our 1.44 release, and we hope you love building with Deno!

🍋 Fresh 2.0 is right around the corner.

Our next major Fresh release will be simpler with a more composable, routing API. Read more here.