The frontend space is indeed crowded, but we honestly feel the solution is still “out there”. We believe Riot.js offers the right balance for solving the great puzzle.
So — here’s why we need one:
1. Custom elements
Riot.js brings custom elements to all modern browsers without the use of any polyfill!
A custom element glues relevant HTML and JavaScript together forming a reusable component. It is designed to offer you everything you wished native the web components API looked like.
Human-readable
Custom tags let you build complex views with HTML. Your application might look something like this:
HTML syntax is the de facto language of the web and it’s designed for building user interfaces. The syntax is explicit, nesting is inherent to the language, and attributes offer a clean way to provide options for custom tags.
Riot.js tags are compiled to pure JavaScript before browsers can execute them.
Performant and predictable
Absolutely the smallest possible amount of DOM updates and reflows.
Fast expressions bindings instead of virtual DOM memory performance issues and drawbacks.
One way data flow: updates and unmounts are propagated downwards from parent to children
Expressions are pre-compiled and cached for high performance
Lifecycle events for more control
Server-side rendering of custom tags for universal (isomorphic) applications
Close to standards
Future-proof thanks to the JavaScript module syntax.
The rendered DOM can be freely manipulated with other tools
Web Components like API
No need for external polyfills or additional libraries
No proprietary event system
No extra HTML root elements, data-attributes or fancy custom attributes.
Tooling friendly
Create components with TypeScript, Rust, JavaScript Next or any pre-processor you want.
export default statement to define the tag’s public interfaces
No side effects due to asynchronous rendering or Proxy objects
Functional API over OOP class-based syntax
Automatic CSS styling via <style> tag without shadow DOM hassle
2. Small learning curve
Riot.js has between 10 and 100 times fewer API methods than other UI libraries.
Less to learn. Fewer books and tutorials to view
Only 3 template directives to learn if, each and is
Less proprietary stuff
No new syntax to learn
No “magic” or “smart” reactive properties or hooks
Explicit behaviors over implicit assumptions
3. Tiny size
Only 6.1kb!
Fewer bugs
Faster to parse and cheaper to download
Embeddable. The library ought to be smaller than the application
Less to maintain. We don’t need a big team to maintain Riot
4. Small, but complete
Riot.js has all the essential building blocks for modern client-side applications:
Modular views for building user interfaces
High performance with many DOM nodes
Highly extensible and not opinionated
Riot.js is an “open stack”. It’s meant for developers who want to avoid framework-specific idioms. The generic tools let you mix and match design patterns you prefer most.
Powerful and modular ecosystem
The Riot.js ecosystem is completely modular. It’s designed to let you pick only the stuff you really need:
@riotjs/cli - CLI to compile locally your tags to JavaScript
Riot.js is Web Components for everyone. Its API contains just the bare minimum to build a modern frontend project. It’s intuitive to use and it weighs almost nothing. It works today. No reinventing the wheel, but rather taking the good parts of what’s there and making the simplest tool possible.
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea – let’s do more of those!
You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.