• Stars
    star
    948
  • Rank 46,561 (Top 1.0 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐ŸŒ€Tiny (in size) front-end framework with no extra browser re-flows

Radi

Radi is a tiny 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.

npm version npm downloads gzip bundle size discord

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 at least ES5.

Ecosystem

Project Status Description
radi-router radi-router-status Single-page application routing
radi-fetch radi-fetch-status HTTP client for Radi.js

Documentation

Getting started guide

Here are 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 Radi.r **/

class Hello extends Radi.component {
  state() {
    return { sample: 'World' };
  }
  view() {
    return (
      <h1>Hello { this.state.sample } !</h1>
    )
  }
}

Radi.mount(<Hello />, document.body);

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

Counter example (With Single File Component syntax)

This will be different as we'll need to update state and use actions. Only actions can change state and trigger changes in DOM. Also we'll be using our SFC syntax for *.radi files

Counter.radi

class {
  state = {
    count: 0
  }

  @action up() {
    return {
      count: this.state.count +1
    }
  }

  @action down() {
    return {
      count: this.state.count -1
    }
  }
}

<div>
  <h1>{ this.state.count }</h1>

  <button onclick={ () => this.down() } disabled={ this.state.count <= 0 }>-</button>

  <button onclick={ () => this.up() }>+</button>
</div>

Architecture

Radi fully renders page only once initially. After that listeners take control. They can listen for state changes in any Radi component. When change in state is caught, listener then re-renders only that part.

Other frameworks silently re-renders whole page over and over again, then apply changes. But radi only re-renders parts that link to changed state values.

To check out live repl and docs, visit radi.js.org.

Stay In Touch

License

MIT

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

More Repositories

1

exome

๐Ÿ”… State manager for deeply nested states
TypeScript
140
star
2

messagepipe

Formats message strings with number, date, plural, and select placeholders to create localized messages
TypeScript
40
star
3

radi-router

The official router for Radi.js.
JavaScript
22
star
4

letype

๐Ÿ” Type checker for any data structures
JavaScript
16
star
5

chipolette

๐ŸŽจ Basic CSS starter kit that uses CSS variables by default
Less
8
star
6

synks

๐Ÿ‰ Synks is a tiny javascript view renderer for generators as components and hooks
TypeScript
7
star
7

esjson

๐Ÿ›ก Fast JSON Schema validator (cli)
JavaScript
5
star
8

marklint

๐Ÿ”ฐ HTML/Markup (Vue and Angular template) linter
JavaScript
5
star
9

boldom

๐Ÿ”– JS framework based on Template Literals, Global scope and plain HTML
JavaScript
4
star
10

dependency-check-action

Checks if JavaScript dependencies are being used and reports missing ones
JavaScript
4
star
11

datacsv

๐Ÿ’พ Very simple file based database for node
JavaScript
3
star
12

radi-fetch

Official HTTP client for Radi.js
JavaScript
3
star
13

radi-loader

๐Ÿ“ฆ Webpack loader for Radi.js components
JavaScript
2
star
14

marcisbee.github.io

My personal portfolio
HTML
2
star
15

parcel-plugin-radi

๐Ÿ“ฆ Parcel plugin for Radi.js components
JavaScript
2
star
16

radi-pure

JavaScript
2
star
17

valide

๐Ÿ’ Simple, chainable, multi lingual data validator
JavaScript
1
star
18

Marcisbee

HTML
1
star
19

nomnoml-es

1
star
20

nanolex

๐Ÿช Parser grammar builder
TypeScript
1
star
21

jsonlogic-formula

JsonLogic parser to and from spreadsheet formula syntax
TypeScript
1
star
22

react-test-renderer-snapshot

TypeScript
1
star
23

release-bot

TEST for release bot
JavaScript
1
star
24

painto

State based canvas game engine
JavaScript
1
star
25

xml-parse

1
star
26

lit-element-jest-serializer

Jest template serializer for lit-element
JavaScript
1
star