Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chadhietala/chad-js
A do-it-yourself component micro-library for your demo-ware applications
https://github.com/chadhietala/chad-js
component golfing micro-library performance
Last synced: about 2 months ago
JSON representation
A do-it-yourself component micro-library for your demo-ware applications
- Host: GitHub
- URL: https://github.com/chadhietala/chad-js
- Owner: chadhietala
- Created: 2017-04-04T00:47:18.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-04-05T06:40:31.000Z (over 7 years ago)
- Last Synced: 2024-10-27T10:36:16.324Z (about 2 months ago)
- Topics: component, golfing, micro-library, performance
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
![](http://i.imgur.com/pbzJyXG.png)
![](http://i.imgur.com/HaKEl0p.png)
# 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](http://vanilla-js.com/).
# 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.