typescript中文手册_Deno 完成了内部代码从 TypeScript 到 JavaScript 的迁移

重构完之后,Deno 的各种语言比例大概是: d09d9b0dbc8f60bf430d25748da55b03.png 可以看到,使用最多的语言依然是 TypeScript,占比有一半以上。其次是 Rust,占到了差不多三分之一,其次才是 JavaScript。 此次更新带来的收益为:
  • 增量编译:从 2 分钟降低到了 30 秒。
  • 编译后的二进制大小:减小了 1Mb。
  • 代码大小:代码行数减少了 2700 行。
相关阅读:
  • Deno 为什么把核心模块从 ts 改回了 js

  • Deno 中文手册诞生记:18 位志愿者,5 天时间翻译完成了所有 Deno 核心 API

  • 使用 VS Code 开发 Deno


原始 PR 信息 (Port internal TS code to JS #6793) :

This PR converts our internal runtime code to use pure JS instead of TS. It enables future refactors:

  • reducing the size of the compiler snapshot.

  • removing deno_typescript crate completely

  • op crates

This work has been planned extensively beforehand: See the design doc.

Incremental compile: from 2 min down to 30 seconds

touch cli/js/web/fetch.ts; cargo build

master 2m 06s
master 1m 55s

#6756 54s
#6756 51s

this branch 33s
this branch 31s

Release binary size: 1mb smaller

Due to removing source maps for internal code. (Measured on mac.)

master         48122324
this branch 47326308

Code size: ~2700 fewer lines of code

In particular, removes our compile-time TypeScript compiler. This reduces the number of custom TypeScript compilers from 2 to 1.

 214 files changed, 16804 insertions(+), 19549 deletions(-)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值