mithril.js README

The project's README from github.com/MithrilJS/mithril.js. As one markdown file: README.md.

Mithril.js

npm Version   License   npm Downloads   Build Status   Donate at OpenCollective   Zulip, join chat

What is Mithril.js?

A modern client-side JavaScript framework for building Single Page Applications. It's small (8.93 KB gzipped), fast and provides routing and XHR utilities out of the box.

Mithril.js is used by companies like Vimeo and Nike, and open source platforms like Lichess 👍.

Mithril.js supports Firefox ESR, and the last two versions of Firefox, Edge, Safari, and Chrome. No polyfills required. 👌

Installation

CDN

<!-- Development: whichever you prefer -->
<script src="https://unpkg.com/mithril/mithril.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mithril/mithril.js"></script>

<!-- Production: whichever you prefer -->
<script src="https://unpkg.com/mithril/mithril.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mithril/mithril.min.js"></script>

npm

npm install mithril --save

The "Getting started" guide is a good place to start learning how to use Mithril.js.

TypeScript type definitions are available from DefinitelyTyped. They can be installed with:

$ npm install @types/mithril --save-dev

Documentation

Documentation lives on mithril.js.org.

You may be interested in the API Docs, a Simple Application, or perhaps some Examples.

Getting Help

Mithril.js has an active & welcoming community on Zulip, or feel free to ask questions on Stack Overflow using the mithril.js tag.

Contributing

There's a Contributing FAQ on the Mithril.js site that hopefully helps, but if not definitely hop into the Zulip stream and ask away!


Thanks for reading!

🎁

mithril.js (MithrilJS/mithril.js)

Searching Database…

这是什么?Mithril.js 是一个现代的客户端 JavaScript 框架,用于构建单页应用(SPA)。它体积小(压缩后仅 8.93 KB)、速度快,并且自带路由和 XHR 工具,开箱即用。
它是直接在用户的浏览器里运行,还是我需要另外部署一台服务器?它完全在浏览器端运行——不需要部署任何服务器组件。你的 JavaScript 组件通过页面上的虚拟 DOM 进行渲染。
我怎么把它加到项目里?可以用 npm 安装(npm install mithril),或者从 CDN 引入预构建的打包文件,然后按照入门指南搭建你的第一个应用。
使用它需要 Node 工具链或其他库吗?不需要构建步骤——用一个普通的 script 标签就能直接引入打包文件,而且这个包没有任何运行时依赖。TypeScript 用户只需加上 DefinitelyTyped 的类型定义即可。
它支持哪些浏览器?支持 Firefox ESR,以及 Firefox、Edge、Safari 和 Chrome 的最近两个版本——无需任何 polyfill。更老的浏览器不在支持范围内。
真的有人在生产环境里用它吗?有——Vimeo、Nike 这样的公司,以及 Lichess 这样的开源平台都在用它,所以在真实的单页应用中已经过验证。
路由和 AJAX 需要单独的库吗?不需要。路由和 XHR 工具都是内置的,不用添加任何额外依赖,就能获得客户端路由和 HTTP 请求功能。
Mithril.js 有多成熟?它从 2014 年 3 月就开始存在了,在 GitHub 上约有 14.5k star,并被 Vimeo、Nike 和 Lichess 用于生产环境——是一个稳定、经过充分检验的选择。
它支持 TypeScript 吗?支持——DefinitelyTyped 提供了官方类型定义,可以作为单独的包与框架一起安装。
Creator
MithrilJS
Size
10.4 MB
Stars
14.5K
Age
12y
Commits · 90 Days