npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

jinge

v4.0.0-alpha.11

Published

A small and smart web interface framework

Downloads

26

Readme

jinge

一个小巧的前端界面框架

English Version Readme

特性

  • 轻量
    • 框架打包的库产物非压缩和压缩版分别只有 ~55Kb~31Kb
    • 极致地 Tree-Shaking 考量,Hello, World 项目构建产物仅 ~3Kb(gzip 后 ~1.4Kb)。
    • 超简洁地 HMR 支撑,HMR 运行时代码仅约 100 行。
  • 创新
    • 使用标准 tsx 语法描述模板,从而可以直接使用到 typescript 的生态以及 IDE 的支持。
    • 内核使用 ES Proxy ,没有虚拟 DOM,从而可以做到极简内核。
    • 巧妙地将标准 tsx 和基于 Proxy 的模板进行编译转换。
  • 够用
    • 组件定义采用标准的函数组件,搭配功能灵活的插槽传递,足够支撑中大型前端项目。
    • 内置国际化多语言支持。
    • 简洁但完善地 HMR 支持。
    • 完善的范型组件支持。
    • 轻量但够用的路由能力(通过 jinge-router 支持)。
  • 友好
    • 完美的类型约束和智能提示,包括组件的参数属性以及插槽传递。
    • 编译器使用 rust 编写,顺畅的研发体验。

示例

Hello, World

// main.tsx
import {
  vm, // vm 函数和 vue 的 reactive 类似,用于定义双向绑定数据。
  bootstrap,
} from 'jinge';
function App() {
  const state = vm({
    n: 10,
  });
  return (
    <>
      <p>Count {state.n}</p>
      <button onClick={() => state.n++}>CLICK</button>
    </>
  );
}
bootstrap(App, document.body);

更多示例

使用

当前版本的 jinge 框架暂时仅支持在 vite 项目中使用。你可以从 jinge 的初始项目模板着手:

  1. github 上克隆初始模板项目:
    git clone https://github.com/jingeweb/jinge-starter
    # mv jinge-starter [YOUR PROJECT NAME] # 修改为你的项目名
  2. 安装依赖并开始研发:
    cd jinge-starter
    pnpm i
    pnpm dev

或者手动配置 vite

  1. 安装依赖:

    pnpm add jinge
    pnpm add -D jinge-compiler
  2. 修改 vite.config.ts

    import { defineConfig } from 'vite';
    import { jingeVitePlugin } from 'jinge-compiler';
    
    export default defineConfig({
      plugins: [jingeVitePlugin()],
    });

因为 jinge-compiler 是使用 rust 编写的,未来将逐步支持 webpack 等打包器的项目。

对比

以下内容为 jinge 框架和主流 MVVM 框架的简单对比:

产物大小

渲染性能