GithubHelp home page GithubHelp logo

chadhietala / chad-js Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 5 KB

A do-it-yourself component micro-library for your demo-ware applications

JavaScript 65.01% HTML 34.99%
performance component micro-library golfing

chad-js's Introduction

Chad.JS

Chad.js is a no-frils component library that leaves solving the hard problems to you. It is architected in a way that allows you navigate the waters of configuration hell and to integrate in any web framework stacks.

Performance

Chad.js is the fastest rendering engine out there, with a file size of less that 200 bytes and "Hello World" app that comes in at 300B with an initial render time of 700 microseconds! Here is how this stacks up.

Getting Started

Chad.js is very stripped down component library and because of that it only knows how to create elements and text nodes. If you want a different DOM abstraction you're on the hook to add them by modifying the prototype of the Component base class before you mount your app. You probably don't care about that because you're considering my micro-library so you must be a masochist or one of those folks that want to build modern javascript applications but have a death grip on "no build tools" and "JavaScript should always be the wild west". Anyways the simplest application looks like the following.

class App extends Component {
  render() {
    return this.h('h1', () => (
      this.t('Hello World')
    ));
  }
}

mount(App, document.body);

You can even do that fancy compostion thing that all "In the know" developers are talking about.

class MyOtherComponent extends Component {
  render() {
    return this.t('Welcome to Chad.js')
  }
}

class App extends Component {
  render() {
    return this.h('h1', () => (
      new MyOtherComponent(this.doc).render()
    ));
  }
}

However, if the Component abstraction is too magical for you, you can simply just drop down one level by using the maximumly flexible primatives:

let h1 = document.createElement('h1');
h1.appendChild(document.createTextNode('Hello World'));
document.body.appendChild(h1);

Actually, why the hell would you ever use an abstraction like mine, clearly using these fine APIs that browser vendors have blessed us with is enough to build any application. Now that I think about it, you should probably check out this amazing library called Vanilla JS.

Integrates With

  • Webpack
  • React Native
  • Ruby on Rails
  • React VR
  • 430 react boilerplates
  • Angular 4 (Probably Angular 5 and 6... but this is MIT so no gurantees)
  • SSR
  • PHP
  • Java
  • OCaml
  • ADA
  • Ember.JS
  • Vue.JS
  • Glimmer.js
  • Redux
  • Immutable.JS
  • Flow.JS
  • TypeScript
  • Literally thoughsands of more choices.

What's Next

Nothing it has been poured in concrete never to be iterated on again.

chad-js's People

Contributors

chadhietala avatar nlfurniss avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

nlfurniss

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.