GithubHelp home page GithubHelp logo

btakita / van Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vanjs-org/van

0.0 0.0 0.0 1.94 MB

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

Home Page: https://vanjs.org

License: MIT License

Shell 0.46% JavaScript 84.48% TypeScript 14.19% HTML 0.88%

van's Introduction

🍦 VanJS: The Smallest Reactive UI Framework in the World

πŸ“£ VanJS 1.0.0 is here β†’
πŸ“£ Introducing VanX β†’

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 0.9kB in the gzipped minified bundle. It's 50~100 times smaller than most popular alternatives. Guess what you can get from this 0.9kB framework? All essential features of reactive UI programming - 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. 5 major functions (van.tags, van.add, van.state, van.derive, van.hydrate) + 4 auxiliary functions (van.tagsNS, van._, van.val, van.oldVal). The 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 for 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, 0.9kB JSX-free Grab 'n Go Library, Scripting Language for GUI, ChatGPT-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 / [email protected] / 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:

  • van_dml.js: adds a a new flavour of composition to VanJS. Author: Eckehard.
  • van-jsx: a JSX wrapper for VanJS, for people who like the JSX syntax more. Author: cqh963852.

Contributors (29)

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

🎨 πŸ’» πŸ“– πŸ’‘
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

πŸ’» πŸ”Œ

van's People

Contributors

allcontributors[bot] avatar caputdraconis050630 avatar cqh963852 avatar duffscs avatar ebraminio avatar eford36 avatar efpage avatar hunter-gu avatar onsclom avatar tamo avatar tao-vanjs avatar tolluset avatar yahia-berashish avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.