MyGit

vanjs-org/van

Fork: 92 Star: 3896 (ๆ›ดๆ–ฐไบŽ 2024-11-21 17:24:09)

license: MIT

Language: JavaScript .

๐Ÿฆ VanJS: World's smallest reactive UI framework. Incredibly Powerful, Insanely Small - Everyone can build a useful UI app in an hour.

ๆœ€ๅŽๅ‘ๅธƒ็‰ˆๆœฌ๏ผš 1.5.2 ( 2024-08-20 05:09:27)

ๅฎ˜ๆ–น็ฝ‘ๅ€ GitHub็ฝ‘ๅ€

๐Ÿฆ VanJS: The Smallest Reactive UI Framework in the World

๐Ÿ“ฃ Introducing VanX โ†’
๐Ÿ“ฃ Introducing VanJS App Builder โ†’

๐Ÿ–Š๏ธ Get Started ๐Ÿ“– Tutorial ๐Ÿ“š Examples ๐Ÿ“ HTML/MD to VanJS Converter โš”๏ธ VanX ๐Ÿ’ฌ Discuss

Enable everyone to build useful UI apps with a few lines of code, anywhere, any time, on any device.

VanJS is an ultra-lightweight, zero-dependency and unopinionated Reactive UI framework based on pure vanilla JavaScript and DOM. Programming with VanJS feels like building React apps in a scripting language, without JSX. Check-out the Hello World code below:

// Reusable components can be just pure vanilla JavaScript functions.
// Here we capitalize the first letter to follow React conventions.
const Hello = () => div(
  p("๐Ÿ‘‹Hello"),
  ul(
    li("๐Ÿ—บ๏ธWorld"),
    li(a({href: "https://vanjs.org/"}, "๐ŸฆVanJS")),
  ),
)

van.add(document.body, Hello())
// Alternatively, you can write:
// document.body.appendChild(Hello())

Try on jsfiddle

You can convert any HTML or MD snippet into VanJS code with our online converter.

VanJS helps you manage states and UI bindings as well, with a more natural API:

const Counter = () => {
  const counter = van.state(0)
  return div(
    "โค๏ธ ", counter, " ",
    button({onclick: () => ++counter.val}, "๐Ÿ‘"),
    button({onclick: () => --counter.val}, "๐Ÿ‘Ž"),
  )
}

van.add(document.body, Counter())

Try on jsfiddle

Why VanJS?

Reactive Programming without React/JSX

Declarative DOM tree composition, reusable components, reactive state binding - VanJS offers every good aspect that React does, but without the need of React, JSX, transpiling, virtual DOM, or any hidden logic. Everything is built with simple JavaScript functions and DOM.

Grab 'n Go

No installation, no configuration, no dependencies, no transpiling, no IDE setups. Adding a line to your script or HTML file is all you need to start coding. And any code with VanJS can be pasted and executed directly in your browser's developer console. VanJS allows you to focus on the business logic of your application, rather than getting bogged down in frameworks and tools.

Ultra-Lightweight

VanJS is the smallest reactive UI framework in the world, with just 1.0kB in the gzipped minified bundle. It's 50~100 times smaller than most popular alternatives. Guess what you can get from this 1.0kB framework? All essential features of modern web frameworks - DOM templating, state, state binding, state derivation, effect, SPA, client-side routing and even hydration!

Size comparison

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.

-- Antoine de Saint-Exupรฉry, Airman's Odyssey

Easy to Learn

Simplicity at its core. Only 5 functions (van.tags, van.add, van.state, van.derive, van.hydrate). The entire tutorial plus the API reference is just one single web page, and can be learned within 1 hour for most developers.

Performance

VanJS is among the fastest web frameworks, according to the results by krausest/js-framework-benchmark. For SSR, Mini-Van is 1.75X to 2.25X more efficient compared to React.

TypeScript Support

VanJS provides first-class support for TypeScript. With the .d.ts file in place, you'll be able to take advantage of type-checking, IntelliSense, large-scale refactoring provided by your preferred development environment. Refer to the Download Table to find the right .d.ts file to work with.

Want to Learn More?

IDE Plug-ins

See Also

A Guide to Reading VanJS Codebase

Support & Feedback

๐Ÿ™ VanJS aims to build a better world by reducing the entry barrier of UI programming, with no intention or plan on commercialization whatsoever. If you find VanJS interesting, or could be useful for you some day, please consider starring the project. It takes just a few seconds but your support means the world to us and helps spread VanJS to a wider audience.

In the name of Vanilla of the House JavaScript, the First of its name, Smallest Reactive UI Framework, 1.0kB JSX-free Grab 'n Go Library, Scripting Language for GUI, GPT-Empowered Toolkit, by the word of Tao of the House Xin, Founder and Maintainer of VanJS, I do hereby grant you the permission of VanJS under MIT License.

Contact us: @taoxin / tao@vanjs.org / Tao Xin

Community Add-ons

VanJS can be extended via add-ons. Add-ons add more features to VanJS and/or provide an alternative styled API. Below is a curated list of add-ons built by VanJS community:

Add-on Description Author
Van Cone An SPA framework add-on for VanJS b-rad-c
van_element Web Components with VanJS Atmos4
VanJS Feather Feather Icons for VanJS thednp
van_dml.js A new flavour of composition for VanJS Eckehard
van-jsx A JSX wrapper for VanJS, for people who like the JSX syntax more cqh963852
vanjs-router A router solution for VanJS (README.md in simplified Chinese) ๆฌง้˜ณ้น
VanJS Routing Yet another routing solution for VanJS Kwame Opare Asiedu
VanJS Form Fully typed form state management library (with validation) for VanJS Kwame Opare Asiedu
vanjs-bootstrap VanJS Bootstrap Components Willi Commer
vanrx An ultra-lightweight Redux addon for VanJS Meddah Abdallah
VanFS 1:1 bindings from F# to VanJS Ken Okabe

Contributors (60)

If I miss anyone's contribution here, apologies for my oversight ๐Ÿ™, please comment on #87 to let me know.

Emoji key

Tao Xin
Tao Xin

๐ŸŽจ ๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก
Wei Sun
Wei Sun

๐Ÿ›
Ryan Olson
Ryan Olson

๐Ÿ–‹
Tamotsu Takahashi
Tamotsu Takahashi

๐Ÿ’ป
icecream17
icecream17

๐Ÿ’ป
enpitsulin
enpitsulin

๐Ÿ’ก ๐Ÿ’ป
Elliot Ford
Elliot Ford

๐Ÿ’ป
andrewgryan
andrewgryan

๐ŸŽจ ๐Ÿ’ป ๐Ÿ›
FredericH
FredericH

๐Ÿ’ก ๐Ÿ’ป
ebraminio
ebraminio

๐Ÿ’ป โš ๏ธ
Eckehard
Eckehard

๐Ÿ’ป ๐Ÿ”Œ
Austin Merrick
Austin Merrick

๐Ÿ’ป ๐Ÿค” ๐ŸŽจ
Lee Byonghun
Lee Byonghun

๐Ÿ’ป
caputdraconis
caputdraconis

๐Ÿ’ป
Achille Lacoin
Achille Lacoin

๐Ÿ’ป
cqh
cqh

๐Ÿ’ป ๐Ÿ”Œ
awesome
awesome

๐Ÿ“น
artydev
artydev

๐Ÿ’ก ๐Ÿ’ฌ
Neven DREAN
Neven DREAN

๐Ÿ’ก ๐Ÿ›
Stephen Handley
Stephen Handley

๐Ÿ’ก
Ionut Stoica
Ionut Stoica

๐Ÿค”
Rasmus Schultz
Rasmus Schultz

๐Ÿค”
cloudspeech
cloudspeech

๐Ÿค”
Daniel Upshaw
Daniel Upshaw

๐Ÿ”Œ
barrymun
barrymun

๐Ÿ’ก
Giulio Malventi
Giulio Malventi

๐Ÿ–‹ ๐Ÿ›
Yahia Berashish
Yahia Berashish

๐Ÿ› ๐Ÿ’ป ๐Ÿ”Œ ๐Ÿค” ๐Ÿ’ก
Phil Schumann
Phil Schumann

๐Ÿ›
Raphaรซl Gauthier
Raphaรซl Gauthier

๐Ÿ’ป ๐Ÿ”Œ
Nail
Nail

๐Ÿ’ป ๐Ÿ”Œ
Brian Takita
Brian Takita

๐Ÿ› ๐Ÿค”
Jonny Fillmore
Jonny Fillmore

๐Ÿ›
Lima Neto
Lima Neto

๐Ÿ–‹
b rad c
b rad c

๐Ÿ’ป ๐Ÿ”Œ
ๆฌง้˜ณ้น
ๆฌง้˜ณ้น

๐Ÿ”Œ ๐Ÿ“น
Daniel Mazurkiewicz
Daniel Mazurkiewicz

๐Ÿ’ป
Atmos4
Atmos4

๐Ÿ’ป ๐Ÿ”Œ
Kwame Opare Asiedu
Kwame Opare Asiedu

๐Ÿ”Œ ๐Ÿ’ก
ali-alnasser570
ali-alnasser570

๐Ÿค”
Auryn Engel
Auryn Engel

๐Ÿ“น
Samuel Wyndham
Samuel Wyndham

๐Ÿ“น
sekoyo
sekoyo

๐Ÿ›
Owen Furnell
Owen Furnell

๐Ÿ›
MrVoltz
MrVoltz

๐Ÿ›
Kane
Kane

๐Ÿ’ก
Vlad Sirenko
Vlad Sirenko

๐Ÿ’ก ๐Ÿ’ป
่‘ฃๅ‡ฏ
่‘ฃๅ‡ฏ

๐Ÿ’ก
Meddah Abdallah
Meddah Abdallah

๐Ÿ”Œ
Miroslaw
Miroslaw

๐Ÿ›
Jon Nyman
Jon Nyman

๐Ÿค”
ericraider33
ericraider33

๐Ÿ›
Ken Okabe
Ken Okabe

๐Ÿ”Œ
Nick
Nick

๐Ÿ’ก
thednp
thednp

๐Ÿ”Œ
Bairui Su
Bairui Su

๐Ÿ’ป
jroush-ipg
jroush-ipg

๐Ÿ›
kangaroolab
kangaroolab

๐Ÿ’ก
Graham Stratford
Graham Stratford

๐Ÿ›
Kursat Aktas
Kursat Aktas

๐Ÿ’ป ๐Ÿ”Œ
bleistivt
bleistivt

๐Ÿ›

ๆœ€่ฟ‘็‰ˆๆœฌๆ›ดๆ–ฐ:(ๆ•ฐๆฎๆ›ดๆ–ฐไบŽ 2024-10-06 21:14:24)

2024-08-20 05:09:27 1.5.2

2024-07-19 03:30:30 1.5.1

2024-03-15 00:50:54 1.5.0

2024-03-09 07:20:34 1.4.1

2024-03-09 00:58:00 1.4.0

2024-02-27 01:31:01 1.3.0

2024-01-24 07:14:59 1.2.8

2023-12-14 14:01:11 1.2.7

2023-11-02 00:14:29 1.2.6

2023-10-27 12:14:39 1.2.5

ไธป้ข˜(topics):

data-binding, dom, dom-manipulation, grab-n-go, lightweight, lightweight-framework, lightweight-javascript-library, minimalist, no-dependencies, no-setup, reactive, reactive-ui, ui-framework, ultra-light, ultra-thin, vanilla-dom-manipulation, vanilla-javascript, vanilla-js, vannilajs

vanjs-org/vanๅŒ่ฏญ่จ€ JavaScriptๆœ€่ฟ‘ๆ›ดๆ–ฐไป“ๅบ“

2024-11-21 23:03:24 bia-pain-bache/BPB-Worker-Panel

2024-11-21 22:46:48 MHSanaei/3x-ui

2024-11-21 07:00:59 nodejs/node

2024-11-21 00:49:46 FortAwesome/Font-Awesome

2024-11-18 14:26:02 projectdiscovery/nuclei-templates

2024-11-17 14:42:23 koodo-reader/koodo-reader