0.4.2 • Published 5 years ago

radi v0.4.2

Weekly downloads
17
License
MIT
Repository
github
Last release
5 years ago

Radi is a tiny (3kB minified & gzipped) javascript framework.

It's built quite differently from any other framework. It doesn't use any kind of diffing algorithm nor virtual dom which makes it really fast.

With Radi you can create any kind of single-page applications or more complex applications with no dependencies required! Oh did I mention that Radi.js is faster than any popular framework? And yes it is.

npm version npm downloads gzip bundle size radi workspace on slack

Installation

To install the stable version:

npm install --save radi

This assumes you are using npm as your package manager.

If you're not, you can access these files on unpkg, download them, or point your package manager to them.

Browser Compatibility

Radi.js currently is compatible with browsers that support ES6. In stable release v1 it will support ES5 compatible browsers and even some below that, yes - looking at IE8 too.

Ecosystem

ProjectStatusDescription
radi-routerradi-router-statusSingle-page application routing

Documentation

Documentation is currently being written. For now just a few examples to work our appetite.

Hello World example

Lets create component using JSX, tho it's not mandatory we can just use hyperscript r('h1', 'Hello', this.sample, '!'). I'm using JSX for html familiarity and to showcase compatibility.

/** @jsx r **/
const { r, mount, component } = radi;

const main = component({
  view: function() {
    return (
      <h1>Hello { this.sample } !</h1>
    )
  },
  state: {
    sample: 'World'
  }
});

mount(new main(), document.body);

This example will mount h1 to body like so <body><h1>Hello World</h1></body>

View this example on codepen

Counter example

This will be different as we'll need to update state and use actions. We'll need to use binder function l(..). It binds any value to real DOM. When something in this function updates, DOM will change too.

/** @jsx r **/
const { r, l, mount, component } = radi;

const counter = component({
  view: function() {
    return (
      <div id="app">
        <div class="counter">
          { l(this.counter) }
        </div>
        <div class="buttons">
          <button onclick={ this.down }
            disabled={ l(this.counter <= 0) }>-</button>
          <button onclick={ this.up }>+</button>
        </div>
      </div>
    )
  },
  state: {
    counter: 0
  },
  actions: {
    up() {
      this.counter += 1;
    },
    down() {
      this.counter -= 1;
    }
  }
});

mount(new counter(), document.body);

View this example on codepen. In codepen I use hyperscript instead jsx for more diverse example purpose.

Architecture

I'm in process of creating some cool examples and diagrams of how exactly Radi works.

Stay In Touch

License

MIT

Copyright (c) 2017-present, Marcis (Marcisbee) Bergmanis

0.5.0-beta.29

5 years ago

0.5.0-beta.28

5 years ago

0.5.0-beta.27

5 years ago

0.5.0-beta.26

5 years ago

0.5.0-beta.25

5 years ago

0.5.0-beta.24

5 years ago

0.5.0-beta.23

5 years ago

0.5.0-beta.22

5 years ago

0.5.0-beta.21

5 years ago

0.5.0-beta.20

5 years ago

0.5.0-beta.19

5 years ago

0.5.0-beta.18

5 years ago

0.5.0-beta.17

5 years ago

0.5.0-beta.16

5 years ago

0.5.0-beta.15

5 years ago

0.5.0-beta.14

5 years ago

0.5.0-beta.13

5 years ago

0.5.0-beta.12

6 years ago

0.5.0-beta.11

6 years ago

0.5.0-beta.10

6 years ago

0.5.0-beta.9

6 years ago

0.5.0-beta.8

6 years ago

0.5.0-beta.7

6 years ago

0.5.0-beta.6

6 years ago

0.5.0-beta.5

6 years ago

0.5.0-beta.4

6 years ago

0.5.0-beta.3

6 years ago

0.5.0-beta.2

6 years ago

0.5.0-beta.1

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.30

6 years ago

0.3.29

6 years ago

0.3.28

6 years ago

0.3.27

6 years ago

0.3.26

6 years ago

0.3.25

6 years ago

0.3.24

6 years ago

0.3.23

6 years ago

0.3.22

6 years ago

0.3.21

6 years ago

0.3.20

6 years ago

0.3.19

6 years ago

0.3.17

6 years ago

0.3.16

6 years ago

0.3.15

6 years ago

0.3.14

6 years ago

0.3.13

6 years ago

0.3.12

6 years ago

0.3.11

6 years ago

0.3.10

6 years ago

0.3.9

6 years ago

0.3.8

6 years ago

0.3.7

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.11

6 years ago

0.2.10

6 years ago

0.2.9

6 years ago

0.2.8

6 years ago

0.2.7

6 years ago

0.2.6

6 years ago

0.2.5

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago