Skip to content

Releases: MoeForge/moejs

Release list

v0.1.0-alpha.10

Choose a tag to compare

@Calcium-Ion Calcium-Ion released this 24 Oct 16:11
90d20fb
  • Intl: Locale, Segmenter, NumberFormat, DateTimeFormat, PluralRules and supportedValuesOf, with CLDR 48 data for 11 languages. The toLocaleString methods format through them. (#4)
  • The webapi package puts fetch, Headers, Request, Response, the Streams, AbortController, URL and performance on a runtime with an event loop. The host's http.Client and an allow hook decide where fetch goes. (#5)
  • MemoryLimit counts what a program keeps: past the limit, moejs measures the live heap before it stops the program. An event loop's budget covers the whole run, and eventloop.Options.ResetMemoryPerTask gives each task its own.
  • A context can stop a compile, and CompileFunction and CompileFunctionTS compile a function from its parameters and body.
  • Faster property lookups cut a new-api plugin hook call by about 9 %.

Every API change is an addition. A stripped binary grows by about 1.3 MB, most of it Intl's data. A program that includes moejs ships sections 1 to 4 of the new THIRD_PARTY_NOTICES. The full list is in #6.


  • 新增 Intl:Locale、Segmenter、NumberFormat、DateTimeFormat、PluralRules 和 supportedValuesOf,数据来自 CLDR 48,覆盖 11 种语言。各类型的 toLocaleString 也用它们格式化。(#4)
  • webapi 包在带事件循环的运行时上提供 fetch、Headers、Request、Response、Streams、AbortController、URL 和 performance。fetch 能访问哪里,由宿主的 http.Client 和放行钩子决定。(#5)
  • 内存上限按程序留住的内存计算:超过上限时,moejs 先测量存活的内存,再决定是否停止程序。事件循环的额度覆盖整次运行,设置 eventloop.Options.ResetMemoryPerTask 后每个任务单独计算。
  • context 可以停止编译,CompileFunction 和 CompileFunctionTS 用参数和函数体的源码编译出函数。
  • 属性查找更快,new-api 插件钩子调用的耗时因此减少约 9%。

所有 API 变化都是新增。去掉符号的二进制约增加 1.3 MB,主要是 Intl 的数据。嵌入 moejs 的程序需要附带新增的 THIRD_PARTY_NOTICES 第 1 到 4 节。完整改动见 #6。

moejs Intl against Node.js

moejs Web APIs against Node.js