内容简介:Deno 1.13 稳定版已发布,主要包含以下新特性和变更: 原生 HTTP server API 到达稳定状态 支持 self.structuredClone() 针对 TLS 使用系统证书存储 (system certificate store) 支持禁用 TLS 验证以进行测试 升级...
Deno 1.13 稳定版已发布,主要包含以下新特性和变更:
- 原生 HTTP server API 到达稳定状态
- 支持
self.structuredClone()
- 针对 TLS 使用系统证书存储 (system certificate store)
- 支持禁用 TLS 验证以进行测试
- 升级 WebCrypto APIs
- 升级 Deno 语言服务器和 VSCode 扩展
- 改进 REPL
- 支持 navigator.hardwareConcurrency API
- 升级 V8 至 9.3
- 在 deno info 中使用类型引用(Type references)
- 在 writeFile 中提供 AbortSignal 支持
- 在 Markdown 文件添加类型检测的代码示例
- 使用干净的环境生成子进程
- Permissions APIs 支持接受 URLs
- 使用 FFI 替换原生插件系统
- 新增实验性的 WebSocketStream API
原生 HTTP server API
原生 HTTP server API 在此版本中已进入稳定阶段,可有效地为 HTTP/1.1 和 HTTP/2 流量提供服务:
for await (const conn of Deno.listen({ port: 4500 })) { (async () => { for await (const { respondWith } of Deno.serveHttp(conn)) { respondWith(new Response("Hello World")); } })(); }
支持self.structuredClone()
self.structuredClone()
以简单、常用且同步的 API 公开了用于在 Web Worker 和 MessagePort 之间传递消息的结构化克隆算法。
import { assert } from "https://deno.land/std@0.104.0/testing/asserts.ts"; // Create an object with a value and a circular reference to itself. const foo = { bar: "baz" }; foo.foo = foo; // Clone it const clone = self.structuredClone(foo); assert(clone !== foo); // assert they are not the same object assert(clone.bar === "baz"); // assert they do have the same value though assert(clone.foo === clone); // assert that the circular reference is preserved console.log("All assertions passed!");
尝试使用:
deno run https://deno.com/v1.13/structured_clone.js
升级 WebCrypto APIs
此版本为WebCrypto
APIs 增加了部分功能:
crypto.subtle.importKey()
和crypto.subtle.exportKey()
支持导入和导出原始 HMAC 密钥crypto.subtle.verify()
支持验证从 HMAC 密钥创建的签名
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:- Thunderbird 78 稳定版发布
- systemd 246 稳定版发布
- Chrome 86 稳定版发布
- systemd 247 稳定版发布
- Fedora 31 稳定版发布
- PyCharm 2020.1 稳定版发布
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
HotSpot实战
陈涛 / 人民邮电出版社 / 2014-3 / 69
《HotSpot实战》深入浅出地讲解了HotSpot虚拟机的工作原理,将隐藏在它内部的本质内容逐一呈现在读者面前,包括OpenJDK与HotSpot项目、编译和调试HotSpot的方法、HotSpot内核结构、Launcher、OOP-Klass对象表示系统、链接、运行时数据区、方法区、常量池和常量池Cache、Perf Data、Crash分析方法、转储分析方法、垃圾收集器的设计演进、CMS和G......一起来看看 《HotSpot实战》 这本书的介绍吧!