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

推荐订阅源

Project Zero
Project Zero
WordPress大学
WordPress大学
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
Visual Studio Blog
爱范儿
爱范儿
P
Proofpoint News Feed
F
Fortinet All Blogs
雷峰网
雷峰网
小众软件
小众软件
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
TaoSecurity Blog
TaoSecurity Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Secure Thoughts
Recent Commits to openclaw:main
Recent Commits to openclaw:main
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
S
Security @ Cisco Blogs
Help Net Security
Help Net Security
GbyAI
GbyAI
Webroot Blog
Webroot Blog
T
Troy Hunt's Blog
B
Blog
MongoDB | Blog
MongoDB | Blog
月光博客
月光博客
H
Heimdal Security Blog
Google Online Security Blog
Google Online Security Blog
S
Security Affairs
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Help Net Security
O
OpenAI News
H
Hacker News: Front Page
博客园 - 叶小钗
Last Week in AI
Last Week in AI
S
Schneier on Security
The Last Watchdog
The Last Watchdog
C
Cyber Attacks, Cyber Crime and Cyber Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
MyScale Blog
MyScale Blog
Recorded Future
Recorded Future
博客园 - 【当耐特】
V
Vulnerabilities – Threatpost
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
The Hacker News
The Hacker News
A
Arctic Wolf

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 Deno 1.44: Private npm registries, improved Node.js compat, and performance boosts | 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
Deno 1.8 Release Notes | Deno
2021-03-02 · via Deno

Today we are releasing Deno 1.8.0. This release contains a massive amount of new features and stabilizations:

  • Experimental support for WebGPU API: paving a path towards out-of-the-box GPU accelerated machine learning in Deno
  • Built-in internationalization APIs enabled: all JS Intl APIs are available out of the box
  • Revamped coverage tooling: coverage now supports outputting lcov reports
  • Import maps now stabilized: web compatible dependency rewriting now shipped
  • Support for fetching private modules: fetch your remote modules from a private server using auth tokens

If you already have Deno installed you can upgrade to 1.8 by running deno upgrade. If you are installing Deno for the first time, you can use one of the methods listed below:


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


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


brew install deno


scoop install deno


choco install deno

New features and changes

Experimental support for the WebGPU API

The WebGPU API gives developers a low level, high performance, cross architecture way to program GPU hardware from JavaScript. It is the effective successor to WebGL on the Web. The spec has not yet been finalized, but support is currently being added to Firefox, Chromium, and Safari; and now also in Deno.

This API gives you access to GPU rendering and general purpose GPU compute right from within Deno. Once finished, stabilized, and unflagged, this will provide a portable way to access GPU resources from web, server, and developer machine.

GPUs allow programmers to make some numerical algorithms highly parallel. This is useful beyond rendering graphics and games. Effective use of GPUs in Machine Learning has enabled more complex neural networks - what is called Deep Learning. The rapid progress in computer vision, translation, image generation, re-enforcement learning, and more all stem from making effective use of GPU hardware.

These days, most neural networks are defined in Python with the computation offloaded to GPUs. We believe JavaScript, instead of Python, could act as an ideal language for expressing mathematical ideas if the proper infrastructure existed. Providing WebGPU support out-of-the-box in Deno is a step in this direction. Our goal is to run Tensorflow.js on Deno, with GPU acceleration. We expect this to be achieved in the coming weeks or months.

Here is a basic example that demonstrates accessing an attached GPU device, and reading out the name and supported features:




const adapter = await navigator.gpu.requestAdapter();
if (adapter) {
  
  console.log(`Found adapter: ${adapter.name}`);
  const features = [...adapter.features.values()];
  console.log(`Supported features: ${features.join(", ")}`);
} else {
  console.error("No adapter found");
}

Here is a little example that demonstrates the GPU rendering a simple red triangle on a green background using a render shader:

$ deno run --unstable --allow-write=output.png https://raw.githubusercontent.com/crowlKats/webgpu-examples/f3b979f57fd471b11a28c5b0c91d0447221ba77b/hello-triangle/mod.ts

A simple red triangle on a green background

Note the use of WebAssembly to write the PNG. For more examples visit this repository: https://github.com/crowlKats/webgpu-examples.

The final PR weighed in at a whopping 15.5k lines of code, and took a whole 5 months to merge after opening. Many thanks to crowlKats who led the integration of WebGPU into Deno. We would also like to thank to all contributors to the wgpu and gfx-rs projects that underpin the WebGPU implementation in Deno. Special thanks also to kvark, editor on the WebGPU spec, and the lead developer of wgpu and gfx-rs, for the great guidance while implementing the WebGPU API.

ICU support

ICU support has been the second most requested feature in Deno repository. We’re happy to announce that Deno v1.8 ships with full ICU support.

All JavaScript APIs depending on ICU should now match browser APIs.

Try it in the REPL:

$ deno
Deno 1.8.0
exit using ctrl+d or close()
> const d = new Date(Date.UTC(2020, 5, 26, 7, 0, 0));
undefined
> d.toLocaleString("de-DE", {
    weekday: "long",
    year: "numeric",
    month: "long",
    day: "numeric",
});
"Freitag, 26. Juni 2020"

This release expands our coverage infrastructure to add some great new capabilities. The main change in this release is that coverage handling is now split into coverage collection and coverage reporting.

Previously coverage collection and reporting would all happen in a single subcommand, by specifying the --coverage flag when starting deno test. Now the --coverage flag for deno test takes an argument - a path to a directory where to store the collected profiles. This is the coverage collection. In a second step you now call deno coverage with the path to the directory storing the coverage profiles. This subcommand can either return a report as pretty text output right on the console, or it can output an lcov file (--lcov flag) for use with tools like genhtml, coveralls.io, or codecov.io.

We have been dogfooding this feature on deno_std for a few days now. We upload a coverage report to codecov.io for each commit. You can view these here https://codecov.io/gh/denoland/deno_std. Adding this was trivial, with only a 10 line change to our GitHub Actions workflow:

- name: Run tests
-        run: deno test --unstable --allow-all
+        run: deno test --coverage=./cov --unstable --allow-all
+
+      - name: Generate lcov
+        run: deno coverage --unstable --lcov ./cov > cov.lcov
+
+      - name: Upload coverage
+        uses: codecov/codecov-action@v1
+        with:
+          name: ${{ matrix.os }}-${{ matrix.deno }}
+          files: cov.lcov

For an example of integration with coveralls.io, see this repository: https://github.com/lucacasonato/deno_s3

Import maps are now stable

Import maps were stabilized in Chrome 89, and following that our implementation has been updated to match the latest revision of the specification and is now also considered stable. This means that the --unstable flag is no longer required when using --import-map.

$ deno run --import-map=./import_map.json ./mod.ts

Additionally the --import-map flag now accepts not only local paths, but also URLs, allowing you to load import maps from remote servers.

$ deno run --import-map=https://example.com/import_map.json ./mod.ts

Import maps allow a user to use so-called “bare” specifiers for dependencies, instead of relative or absolute file / http URLs:




import * as http from "std/http";
{
  "imports": {
    "std/http": "https://deno.land/std@0.85.0/http/mod.ts"
  }
}

Users should keep in mind that import maps are not composable: this means you can only provide a single import map to deno run / deno test. Because of this library authors should still use regular, non-bare specifiers (relative or absolute file / http URLs); otherwise the users of the library will manually need to add your libraries (and your libraries dependencies) bare specifiers into their import map.

A much more useful feature for import maps is ability to remap regular specifiers to completely different ones. For example if you have some broken dependency that is deeply nested in your module graph you can replace it with fixed version before it’s fixed upstream, or if you use a build process that adds hashes to your modules filenames, you can refer to the file without hashes in your source code and remap the specifiers only at runtime using an import map.

For more examples and a detailed explanation refer to the specification.

Auth token support for fetching modules

Not all code is openly available on the public internet. Previously Deno had no capability to download code from a server that required authentication. In this release we have added the ability for users to specify per domain auth tokens that are used when fetching modules for the first time.

To do this the Deno CLI will look for an environment variable named DENO_AUTH_TOKENS to determine what authentication tokens it should consider using when requesting remote modules. The value of the environment variable is in the format of a n number of tokens delimited by a semi-colon (;) where each token is in the format of {token}@{hostname[:port]}.

For example a single token for would look something like this:

DENO_AUTH_TOKENS=a1b2c3d4e5f6@deno.land

And multiple tokens would look like this:

DENO_AUTH_TOKENS=a1b2c3d4e5f6@deno.land;f1e2d3c4b5a6@example.com:8080

When Deno goes to fetch a remote module, where the hostname matches the hostname of the remote module, Deno will set the Authorization header of the request to the value of Bearer {token}. This allows the remote server to recognize that the request is an authorized request tied to a specific authenticated user, and provide access to the appropriate resources and modules on the server.

For a more detailed usage guide and instructions for configuring your environment to pull from private GitHub repos, see the related manual entry.

Exit sanitizer for Deno.test

The Deno.test API already has two sanitizers that help ensure that your code is not “leaking” ops or resources - ie. that all open file/network handles are closed before test case ends, and that there are no more pending syscalls.

Deno 1.8 adds a new sanitizer that ensures that tested code doesn’t call Deno.exit(). Rogue exit statements can signal false positive test results and are most often misused or were forgotten to be removed.

This sanitizer is enabled by default for all tests, but can be disabled by setting the sanitizeExit boolean to false in the test definition.

Deno.test({
  name: "false success",
  fn() {
    Deno.exit(0);
  },
  sanitizeExit: false,
});


Deno.test({
  name: "failing test",
  fn() {
    throw new Error("this test fails");
  },
});

You can run this script yourself: deno test https://deno.land/blog/v1.8/exit_sanitizer.ts.

Deno.permissions APIs are now stable

Deno’s security model is based on permissions. Currently these permissions can only be granted when the application is started. This works well for most scenarios, but in some cases it is a better user experience to request / revoke permissions at runtime.

In Deno 1.8 there is now a stable API to query, request, and revoke permissions. These APIs are contained in the Deno.permissions object. Here is an example of how this works:

function homedir() {
  try {
    console.log(`Your home dir is: ${Deno.env.get("HOME")}`);
  } catch (err) {
    console.log(`Failed to get the home directory: ${err}`);
  }
}


homedir();

const { granted } = await Deno.permissions.request({ name: "env" });
if (granted) {
  console.log(`You have granted the "env" permission.`);
} else {
  console.log(`You have not granted the "env" permission.`);
}



homedir();

await Deno.permissions.revoke({ name: "env" });



homedir();

You can run this script yourself: deno run https://deno.land/blog/v1.8/permission_api.ts.

This release brings stabilization four APIs related to symlinks:

  • Deno.link
  • Deno.linkSync
  • Deno.symlink
  • Deno.symlinkSync

Before stabilization these APIs went through a security review and proper permissions are required to use them.

Deno.link and Deno.linkSync require both read and write permissions for both source and target paths.

Deno.symlink and Deno.symlinkSync require write permissions for target path.

More granular Deno.metrics

As Deno becomes more stable it is becoming more important have easy ways for developers to instrument their applications. This starts at the lowest level, at the runtime itself. In Deno all privileged operations in JS (the ones that go to Rust), are done via a single central interface between JS and Rust. We call the requests going over that interface “ops”. For example, calling Deno.open would invoke the op_open_async op to the privileged side, which would return the resource id of the opened file (or an error).

More than two years ago, on Oct 11, 2018 we added a way for you to view metrics for all of the ops between Rust and JS: Deno.metrics. This API currently exposes the count of started, and completed synchronous and asynchronous ops, and the amount of data that has been sent over the ops interface. So far this has been limited to combined data for all of the different ops. There was no way to figure out which ops were invoked how many times, only all ops in general.

When running with --unstable, this release adds a new field to Deno.metrics called ops. This field contains per op information about how often the API was invoked and how much data has been transmitted over it. This allows for far more granular instrumentation of the runtime.

Here is an example of this working:

$ deno --unstable
Deno 1.8.0
exit using ctrl+d or close()
> Deno.metrics().ops["op_open_async"]
undefined
> await Deno.open("./README.md")
File {}
> Deno.metrics().ops["op_open_async"]
{
  opsDispatched: 1,
  opsDispatchedSync: 0,
  opsDispatchedAsync: 1,
  opsDispatchedAsyncUnref: 0,
  opsCompleted: 1,
  opsCompletedSync: 0,
  opsCompletedAsync: 1,
  opsCompletedAsyncUnref: 0,
  bytesSentControl: 54,
  bytesSentData: 0,
  bytesReceived: 22
}

In an upcoming release this new information will be used by the async op sanitizer in Deno.test to give more actionable errors when an async op is not completed before test completion. We have already seen this feature being used to instrument applications and pipe the data into monitoring software:

screenshot of a website with a table displaying the output of Deno.metrics

JSON support for deno fmt

deno fmt can now format .json and .jsonc files. Just like with JS/TS, the formatter will also format json and jsonc codeblocks inside of markdown files.

IIFE bundle support for Deno.emit

The built-in bundler can now emit bundles in Immediately Invoked Function Expression (IIFE) format.

By default output format will still be esm, but users can change this by setting the EmitOptions.bundle option to iife:

const { files } = await Deno.emit("/a.ts", {
  bundle: "iife",
  sources: {
    "/a.ts": `import { b } from "./b.ts";
        console.log(b);`,
    "/b.ts": `export const b = "b";`,
  },
});

console.log(files["deno:///bundle.js"]);

Results in:

(function() {
    const b = "b";
    console.log(b);
    return {
    };
})();

You can run this script yourself: deno run --unstable https://deno.land/blog/v1.8/emit_iife.ts.

This is particularly useful for creating bundles for older browsers that do not support ESM.

deno lsp is now stable

We have been working on a replacement for our old editor integration for VS Code, the Deno extension for the last few months. The old extension only worked for VS Code, and the resolved types did not always match the ones in the Deno CLI.

In Deno 1.6 we released deno lsp in canary - a builtin language server for Deno. LSP allows us to provide editor integration to all LSP capable editors from just a single codebase. The built in language server is built on the same architecture as the rest of the Deno CLI - it thus provides TypeScript diagnostics the same way as the rest of the CLI.

Two weeks ago, in Deno 1.7.5 we stabilized deno lsp and switched our official VS Code extension to use it. So far we have gotten some great feedback, and will be working to address all reported issues. If you are running into issues with the extension, please report it on our issue tracker. We can not fix issues that we do not know about.

In addition to the official VS Code integration, more community integrations have been created that are built on deno lsp:

TypeScript 4.2

Deno 1.8 ships with the latest stable version of TypeScript.

For more information on new features in Typescript 4.2 see Announcing TypeScript 4.2