Simple and elegant component-based UI library

Overview

Riot logo

Simple and elegant component-based UI library

Build Status MIT License Join the discord community channel Join the chat (ja) at https://riot-jp-slackin.herokuapp.com/ OpenCollective Backers OpenCollective Sponsors

NPM version NPM downloads jsDelivr Hits Coverage Status Riot Size Code Quality

Sauce Test Status

Custom components • Concise syntax • Simple API • Tiny Size

Riot brings custom components to all modern browsers. It is designed to offer you everything you wished the native web components API provided.

Tag definition

<timer>
  <p>Seconds Elapsed: { state.time }</p>

  <script>
    export default {
      tick() {
        this.update({ time: ++this.state.time })
      },
      onBeforeMount(props) {
        // create the component initial state
        this.state = {
          time: props.start
        }

        this.timer = setInterval(this.tick, 1000)
      },
      onUnmounted() {
        clearInterval(this.timer)
      }
    }
  </script>
</timer>

Open this example on Plunker

Mounting

// mount the timer with its initial props
riot.mount('timer', { start: 0 })

Nesting

Custom components let you build complex views with HTML.

<timetable>
  <timer start="0"></timer>
  <timer start="10"></timer>
  <timer start="20"></timer>
</timetable>

HTML syntax is the de facto language on 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.

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.
  • No "magic" or "smart" reactive properties or hooks
  • Expressions are pre-compiled and cached for high performance.
  • Lifecycle methods for more control.

Close to standards

  • No proprietary event system.
  • Future proof thanks to the javascript module syntax.
  • The rendered DOM can be freely manipulated with other tools.
  • No extra HTML root elements, data- attributes or fancy custom attributes.
  • No new syntax to learn.
  • Plays well with any frontend framework.

Use your dearest language and tools

Powerful and modular ecosystem

The Riot.js ecosystem is completely modular, it's designed to let you pick only the stuff you really need:

CDN hosting

How to contribute

If you are reading this it's already a good sign and I am thankful for it! I try my best working as much as I can on riot but your help is always appreciated.

If you want to contribute to riot helping the project maintenance please check first the list of open issues to understand whether there is a task where you could help.

Riot is mainly developed on UNIX systems so you will be able to run all the commands necessary to build and test the library using our Makefile. If you are on a Microsoft machine it could be harder to set up your development environment properly.

Following the steps below you should be able to properly submit your patch to the project

1) Clone the repo and browse to the riot folder

$ git clone [email protected]:riot/riot.git && cd riot

2) Set up your git branch

$ git checkout -b feature/my-awesome-patch

3) Install the npm dependencies

$ npm i

4) Build and test riot using the Makefile

# To build and test riot
$ make riot

# To build without testing
$ make raw

5) Pull request only against the dev branch making sure you have read our pull request template

6) Be patient

Credits

Riot is actively maintained with ❤️ by:


Gianluca Guarini

Many thanks to all smart people from all over the world who helped improving it.

Official Website

https://riot.js.org

Backers

Support us with a monthly donation and help us continue our activities. Become a backer

Backers

Sponsors

Become a sponsor to get your logo on our README. Become a sponsor

Sponsors

Thanks

Special thanks to Browserstack and JetBrains for their support

jetbrains browser stack
Comments
  • When updating a tag with a loop, rendered result doesn't always reflect the updated data

    When updating a tag with a loop, rendered result doesn't always reflect the updated data

    The below fiddle recreates the issue. Checking an item should remove it. However, checking any but the last item with riot 2.2.2, while the item is removed, the item below becomes checked. It works fine with 2.1.0 and 2.0.15.

    http://jsfiddle.net/cdanielw/bkw5ommu/4/

    bug discussion 
    opened by cdanielw 153
  • 8-10x slower than React at 10k item list reversal

    8-10x slower than React at 10k item list reversal

    I was very interested in seeing how fast Riot was compared to React based on the intro docs.

    So I put together these simple demos to help me learn and compare.

    10k item list with reverse button. After you click the button, you'll see the time it took to reverse and finish rendering. (Actually, in a separate issue, I don't understand why you have to click the button twice on the Riot version before the timing text appears.)

    React: http://jsfiddle.net/brianmfranklin/w674Lv7p/ Riot2: http://jsfiddle.net/brianmfranklin/j05ukz2r/

    On my MacBook Pro, I consistently get about 2500 ms for Riot, and only 250-350ms for React.

    I thought maybe this was a quirk of how I was having to measure the timing. But it DOES seem to actually take longer to do the re-render.

    Is this expected? Or are there more optimizations to do?

    bug fixed enhancement 
    opened by brianmfranklin 145
  • Riot next - roadmap to v4

    Riot next - roadmap to v4

    Roadmap proposal for the future riot major release:

    (this list just a draft and it's going to grow)

    • [ ] Complete rewrite of the compiler simplifying the sourcecode allowing also sourcemaps
    • [ ] Fix all the yield issues introducing the use of <slot> deprecating the <yield>
    • [ ] Make the use of riot-observable optional
    • [ ] Remove this.tags from the tags instances in favor of ref https://github.com/riot/riot/issues/2360
    • [ ] Automounted components deprecating the riot.mount method
    • [ ] Add support for shadow DOM or at least support the :root selector instead of :scope
    • [ ] Make the tags options explicit avoiding to pick per default all the custom tags attributes
    • [ ] Avoid the use of riot.csp in favor of a simpler solution
    • [ ] Cleanup the readme file removing dead links to tutorials or old riot stuff
    • [ ] Simplify the mixin logic avoid the use of es6 classes and functions instances
    • [ ] Remove the shouldUpdate method in favor of a smarter DOM updates strategy
    • [ ] Drop IE9/10/11 support
    • [ ] Use new ES6 features like Proxies and template strings
    • [ ] Drop the use of each={ items } in favor of each={ item in items }
    • [ ] Reduce the source code simplifying a lot the api
    • [ ] Update the api simplifying the core methods arguments handling
    • [ ] Prefer a functional approach over the current objects extension strategy

    We will track the progress here

    ✌️

    discussion 
    opened by GianlucaGuarini 125
  • Riot next - roadmap to riot 2.3

    Riot next - roadmap to riot 2.3

    Riot 2.2.3

    The next riot release the 2.2.3 (maybe we could split it also in 2 releases 2.2.4) will fix the mainly the issues raised up by our users

    • Bugs
      • [x] #1055
      • [x] #1048
      • [x] #1040 #974 #995
      • [x] #1016 #984
      • [x] #976
      • [x] #907
      • [x] #1071

    Riot 2.2.4

    bugs list

    Riot 2.3.0

    I would like also to discuss here the updates I've planned for riot 2.3.*

    • [x] rethink/refactore the riot loops to keep them fast but also updating the DOM node correctly
    • [x] remove the compiler, router, observable (maybe also the cli).. from the riot repo. We could publish all these scripts as separate npm modules riot-* and use them to build riot in this repo (or even extend the basic riot functionalities like the router 4 ex.). This solution allows us to split and test all the riot core modules in their own repos avoiding to pollute this repo with too many unrelated tests. Indeed we could also track better the issues related to small parts of our code base. I have already prepared riot-observable containing the folder structure I would like to use also for the other riot modules. Notice that the doc folder could be used to update the whole riot documentation/website here avoiding to rely on @tipiirai on any new riot release. The submodules versioning should be in sync with riot at least for the major releases
    • [x] remove the ie8 support as one of the main riot pros from the doc, I would like explain the hacks about how to use eventually riot on IE8 only in our FAQ section
    • [ ] remove the dist folder from the .gitignore to easily debug the release in the dev branch
    • [x] decide whether we want to optimize our build using webpack or keep using smash
      • with smash we could only include the index.js files of all our riot submodules
        • Pros: It will keep the riot codebase small
        • Pros/Cons: Our source files will not be processed by any other tool, they will be only concatenated in riot.js
        • Cons: Use of a deprecated technology
        • Cons: We will lose control over the global variables, functions risking global namespace conflicts
      • with webpack
        • Pros: We can get only the methods exported from our riot submodules keeping, the riot context clean
        • Pros/Cons: We could parse our modules, using babeljs using also es2015 features
        • Cons: Our output will not match the codestyle used in the sourcecode
        • Cons: Our output will be bigger containing extra code generated by webpack to handle the commonjs calls
    • [x] merge the new tmpl.js https://github.com/riot/riot/pull/954 version (maybe it could also be a riot submodule riot-tmpl?! )
    • [x] update the riot website automatically on any new riot release enhancing the code [here].(https://github.com/riot/riot.github.io) Do we need to redesign it? Or do you want to keep the current template?
    • [x] enhance the riot-router using the HTML5 history API

    Your feedback is really appreciated @tipiirai @cognitom @rsbondi @aMarCruz

    :v:

    discussion 
    opened by GianlucaGuarini 98
  • Feature request: Specify transclusion position

    Feature request: Specify transclusion position

    It would be great to specify where to include the content of a parent tag. Ie:

    <!-- form-group.tag -->
    <form-group>
      <div class="form-group">
        <label>{ opts.label }</label>
        { innerHTML } <!-- somehow transclude given content here (there is probably a better name than "innerHTML" ;) -->
      </div>
    </form-group>
    
    <!-- index.html -->
    <form>
      <form-group label="Field 1">
        <input type="text" name="field-1"/>
      </form-group>
    </form>
    

    .... producing ....

    <div class="form-group">
      <label>Field 1</label>
      <input type="text" name="field 1"/>
    </div>
    
    opened by johngeorgewright 95
  • Riot 3.0.0 roadmap

    Riot 3.0.0 roadmap

    3.0.0 will be quite a big release for riot. @rsbondi and the new member of the team @rogueg are already working on the next branch fixing many of the important issues that we can solve only by introducing breaking changes. Here you can check the list of the issues we want to close for the next major release:

    • [x] improve the loop performances using the @pakastin's hint http://jsfiddle.net/paldepind/rju8rzmn/4/
    • [ ] ~~switch from makefile to a more crossplatform solution #2024~~
    • [ ] add sourcemaps generation in the compiler compiler/56
    • [x] use the ref attribute instead of names and ids riot/1185
    • [x] allow the es6 import also inside the tags compiler/69
    • [x] build riot using rollup+babel instead of smash using the new es6 modules syntax
    • [x] remove riot-route from the core making it optional https://github.com/riot/riot/issues/1485
    • [x] fix all the issues related to the if conditions https://github.com/riot/riot/issues/1477 https://github.com/riot/riot/pull/1658
    • [x] avoid that the update and the updated events get triggered before any tag has been mounted https://github.com/riot/riot/issues/1661
    • [x] decision regarding how the input/select tags should react on the updates https://github.com/riot/riot/issues/1642
    • [x] remove the automatic preventDefault from the riot DOM events https://github.com/riot/riot/issues/1770 https://github.com/riot/riot/issues/1718 https://github.com/riot/riot/issues/526
    • [x] avoid to inherit properties from the parent in loops of custom children tags https://github.com/riot/riot/issues/1697
    • [x] avoid to update the parent tag on the events generated from a child tags https://github.com/riot/riot/issues/1319
    • [x] remove the __ prefix for the "boolean" html attributes https://github.com/riot/riot/issues/276
    • [x] clean up the tests splitting them into several files
    • [x] Add the shouldUpdate method to the tags to emulate componentShouldUpdate in react

    I also hope to have enough time to add a blog section on our site describing the riot status on any release.

    I would like also to mention that we started a pledgie donation campaign and if you would like to sustain us and you like riot it might be nice to consider a donation at least to let us paying the costs of the riot maintenance (domain, saucelabs, browserstack.. )

    :v:

    discussion 
    opened by GianlucaGuarini 77
  • Riot next

    Riot next

    Bugs:

    • [x] https://github.com/muut/riotjs/issues/766
    • [x] https://github.com/muut/riotjs/issues/764
    • [ ] ~~https://github.com/riot/riot/issues/810~~ in the next release
    • [ ] ~~https://github.com/riot/riot/issues/334~~ in the next release
    • [x] https://github.com/riot/riot/issues/809
    • [x] https://github.com/muut/riotjs/issues/700
    • [x] https://github.com/muut/riotjs/issues/484 ( probably the most important )
    • [x] https://github.com/muut/riotjs/issues/763

    Features/Enhancements

    • [x] faster each rendering ( related to #484 )
    • [x] fix the saucelabs tests on the iPhone/iPad (I have removed them)
    • [x] increase the code coverage
    • [x] enable use strict

    p.s. This list could change at anytime, new ideas and suggestions are welcome Your contribute to riot is precious :v:

    opened by GianlucaGuarini 72
  • Looping is at the wrong level

    Looping is at the wrong level

    I think looping through element is at the wrong tag level. Specially when you have this case you need to write twice the each to get it work as expected.

    <dl class="dl-horizontal" >
        <dt each={name in opts.data.metrics}>{name}</dt>
        <dd each={name, value in opts.data.metrics}>{value}</dd>
    </dl>
    

    It iterates the same list twice right?

    Shouldn't that be like this? And more efficient.

    <dl class="dl-horizontal" each={name, value in opts.data.metrics}>
        <dt>{name}</dt>
        <dd>{value}</dd>
    </dl>
    

    It feels more natural too. If you base on templating engines such as Jinja http://jinja.pocoo.org/docs/dev/templates/#for

    enhancement feature request 
    opened by assertnotnull 70
  • Riot 4 roadmap

    Riot 4 roadmap

    Recap

    It's almost one year that we didn't release updates about Riot v4 so I think opening a new roadmap issue (closing the old one https://github.com/riot/riot/issues/2283) is the cleanest way to keep our community updated regarding the upcoming news.

    Riot v3

    Riot v3 is feature complete and bug free so we will update the source code just in case of security vulnerabilities. All the enhancements and the yield problems submitted by some users will introduce breaking changes so I would like to keep the current API/behavior stable as it is and move forward.

    Core Contributors

    Please see here

    Riot v4

    Riot and Simulacra.js will join forces

    Riot 4 will use Simulacra.js as default rendering engine. Simulacra.js is currently one of the fastest and smartest rendering engine available and its creator @daliwali is now a riot core member. Dali will actively be part of the riot 4 rewrite and we started already working on a new parser/compiler.

    Components Structure

    The riot components structure will be a bit refreshed but it will not be a radical change. We will avoid the current ambiguities in favor of a cleaner and nicer structure.

    Old

    <my-component>
      <h1 if={ title }>{ title }</h1>
      <ul>
        <li onclick={ onClick } each={ items }>{ value }</li>
      </ul>
    
      var goodbye = 'goodbye'
    
      this.on('mount', function() {
        console.log('mounted!')
      })
    
      onClick() {
        this.title = goodbye
      }
    
      <style>
        :scope {
          color: red;
        }
      </style>
    </my-component>
    

    New

    <my-component>
      <h1 if={ title }>{ title }</h1>
      
      <ul>
        <li onclick={ onClick } each={ item in items }>{ item.value }</li>
      </ul>
    
      <script>
        var goodbye = 'goodbye'
    
        export default {
          onMount() {
            console.log('mounted!')
          },
          onClick() {
            this.title = goodbye
          }
        }
      </script>
    
      <style>
        :root {
          color: red;
        }
      </style>
    </my-component>
    

    New Ideas

    We got many new ideas for the rewrite but we need to test them first so you will be informed when the compiler will be in a functional prototype state.

    Release date

    At moment we don't have any fixed release date, we only know that a full rewrite of the framework in 2 of us (working only during our spare time) will take quite some time. We will inform you about a plausible release date when a first prototype will be released. Please donate to our open collective campaign if you want to actively support the development of the new Riot.js major release

    API changes 🚧

    • [ ] Complete rewrite of the compiler simplifying the sourcecode and the parsing
    • [ ] Switch to Simulcra.js as default rendering engine
    • [ ] Remove riot-observable in favor of callbacks lifecycle methods
    • [ ] Remove this.tags from the tags instances in favor of ref https://github.com/riot/riot/issues/2360
    • [ ] Add support for shadow DOM or at least support the :root selector instead of :scope
    • [ ] Remove riot.csp.js in favor of a single version compatible for any environement
    • [ ] Cleanup the readme file removing dead links to tutorials or old riot stuff
    • [ ] Simplify the mixin logic allowing only object
    • [ ] Make the use of <script> and <style> obligatory
    • [ ] Remove the shouldUpdate method
    • [ ] Drop the use of each={ items } in favor of each={ item in items }
    • [ ] Update the API simplifying the arguments overload issue for many riot methods

    ✌️

    discussion 
    opened by GianlucaGuarini 66
  • Test suite with mocha, travis, karma & saucelabs

    Test suite with mocha, travis, karma & saucelabs

    I would like to make a unit test with mocha to check that the code pushed on any pull request does not break. Another advantage could be to check the crossbrowser compatibility on any release automatically. We need to create an account on saucelabs ( email + psw ) and @tipiirai you should create also the travis hook

    opened by GianlucaGuarini 51
  • Super Powerful Routes

    Super Powerful Routes

    This PR introduces a huge improvement in our routes making it easy to define different callbacks for each path. Below I am adding some examples, check the tests for more details.

    // Defining several routes at once
    riot.route({
       // static route
       "/home":  function(params) { ... },
    
       // RegEx route 
       ".*/something": function(params) { ... }, 
    
       // Passing params
       "/items/{item}": function(params) { ... },
    
       // With RegEx and several params 
       ".*/{type}/{id}?.*q={q}.*": function(params) { ... }
    });
    
    // Defining a single route
    riot.route("/somepage", function(params) { ... });
    
    // Trigger a route, this will execute the the callback of this route
    riot.route("/somepage");
    
    opened by 3den 47
  • Spread operator merges new props object with the old one

    Spread operator merges new props object with the old one

    Help us to manage our issues by answering the following:

    1. Describe your issue: I have parent component with object in this.state and child component. In parent component I use spread operator to pass object to the child component like this:
    <my-child-tag {...state.tagProps}></my-child-tag>
    <script>
    state: {
            tagProps:{
              a: 1
            }
          }
    </script>
    

    When I modify the object in parent state, this.props in child component contains combaination of former object and the new one. For example if I call in parent component:

    this.state.tagProps = {b:2}
    this.update()
    

    I would expect child component's props to be {b:2}, but it is {a:1, b:2}.

    1. Can you reproduce the issue? https://plnkr.co/edit/cxJodpvyO82BJCpJ

    2. On which browser/OS does the issue appear? Chrome 108 / Windows 10

    3. Which version of Riot does it affect? 7.1

    4. How would you tag this issue?

    • [ ] Question
    • [X ] Bug
    • [ ] Discussion
    • [ ] Feature request
    • [ ] Tip
    • [ ] Enhancement
    • [ ] Performance
    opened by svoboda-ske 0
  • Class merge not working as expected

    Class merge not working as expected

    Help us to manage our issues by answering the following:

    1. Describe your issue: Classes set on a component element are not merged with classes from the tag's definition. The source code below produces this DOM:
    <counter count="1" class="inline-flex flx-col align-items-center" style="color: lime"></counter>
    

    when I was expecting this:

    <counter count="1" class="mar-r-xl inline-flex flx-col align-items-center" style="color: lime"></counter>
    

    Source code: index.html

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <title>Trying Riot</title>
    </head>
    <body>
        <counter count="1" class="mar-r-xl" style="color: lime"></counter>
        <counter></counter>
    
      <script src="counter.riot" type="riot"></script>
      <script src="https://unpkg.com/[email protected]/riot+compiler.min.js"></script>
      <script>
        (async function main() {
          await riot.compile()
          riot.mount('counter')
        }())
      </script>
    </body>
    </html>
    

    counter.riot

    <counter class="inline-flex flx-col align-items-center">
      <p>Count <span class="fnt-bold">{state.count}</span></p>
      <button onclick="{incrementCount}" ord="primary">Increment</button>
    
      <script>
        export default {
          state: {
            count: 0
          },
    
          incrementCount() {
            this.state.count += 1;
            this.update();
          }
        }
      </script>
    </counter>
    
    1. Can you reproduce the issue?

    The code above can be copy pasted to easily reproduce.

    1. On which browser/OS does the issue appear?

    Chrome on macOS

    1. Which version of Riot does it affect?

    I'm using 7.1.0

    1. How would you tag this issue?
    • [ ] Question
    • [x] Bug
    • [ ] Discussion
    • [ ] Feature request
    • [ ] Tip
    • [ ] Enhancement
    • [ ] Performance
    feature request 
    opened by jfbrennan 0
  • The draggable attribute isn't handled right

    The draggable attribute isn't handled right

    The issue:

    1. The draggable attribute isn't handled right by riot when you assign it a boolean expression.
    2. The HTML standard (and the browser) expects values of "true" or "false" (unlike, "checked", for example, which expects "checked" value or non).
    3. Riot translate a truthy value into the string "draggable" - which doesn't make it draggable.

    Reproduction https://codesandbox.io/embed/riot-js-7-bug-template-forked-1mco0f?fontsize=14&hidenavigation=1&theme=dark

    Test context browsers: Chrome and Firefox, linux OS, riot version 7

    Issue type Bug

    enhancement discussion breaking change 
    opened by dharmax 1
  • Using riot components in an Angular application

    Using riot components in an Angular application

    Help us to manage our issues by answering the following:

    1. Describe your issue:

    In my company we are working on a huge and terrible legacy code written in Angular 11 and we'd like to gradually migrate out of it into Riot, with which we have a good experience in other project. We thought about building an angular component which will function as a bridge between the containing application to the riot component. So far, we managed to do so only when we precompile the riot file into a js file. However, this method would be pretty cumbersome. We didn't manage to properly configure the webpack to do that compilation for us. If you have any ideas how to solve this "bridging problem" we'd be grateful.

    1. Can you reproduce the issue? n/a
    2. On which browser/OS does the issue appear? all
    3. Which version of Riot does it affect? latest (7)
    4. How would you tag this issue?
    • [ ] Question
    question needs repro 
    opened by AndrewPetrishin 3
  • Storybook Support on latest Riot version.

    Storybook Support on latest Riot version.

    Help us to manage our issues by answering the following:

    1. Describe your issue:

    There is an issue in Storybook repository, Storybook does not seem to support the latest Riot.js.

    https://github.com/storybookjs/riot/issues/1

    1. Can you reproduce the issue?
    1. On which browser/OS does the issue appear?
    1. Which version of Riot does it affect?

    v4 and later

    1. How would you tag this issue?
    • [ ] Question
    • [ ] Bug
    • [ ] Discussion
    • [x] Feature request
    • [ ] Tip
    • [ ] Enhancement
    • [ ] Performance
    enhancement 
    opened by nibushibu 3
Releases(v7.1.0)
  • v7.1.0(Nov 7, 2022)

    • Fix https://github.com/riot/riot/issues/2972
    • Fix https://github.com/riot/riot/issues/2967 (enhance the previous patch)
    • Fix https://github.com/riot/riot/issues/2969
    • Update Riot.js has now 0 dependencies. All the needed dependencies will be bundled before the publishing on npm
    • Update dev dependencies
    Source code(tar.gz)
    Source code(zip)
  • v7.0.7(Nov 1, 2022)

    • Fix https://github.com/riot/riot/issues/2971
    • Fix https://github.com/riot/riot/issues/2967 adding support for css complex pseudo selectors
    • Fix riot.version wrong value in the esm export
    • Fix circular dependencies
    • Update improve rendering performance preferring loops over recursion for DOM manipulations
    Source code(tar.gz)
    Source code(zip)
  • v7.0.6(Sep 9, 2022)

  • v7.0.5(Sep 2, 2022)

  • v7.0.4(Aug 23, 2022)

  • v7.0.3(Aug 14, 2022)

  • v7.0.2(Aug 4, 2022)

  • v7.0.1(Aug 3, 2022)

  • v7.0.0(Aug 2, 2022)

    • Update: code cleanup to improve the esm bundle and treeshaking
      • Remove: riot.esm.js in favor of the esm folder
    • Add: runtime slots https://github.com/riot/riot/discussions/2917
      • The runtime slots are available in the riot+compiler.js bundle (A documentation update will be available soon)
    • Update: reduced bundle size to 5kb riot.min.js gzipped
    • Update: new Compiler (riot+compiler.js) bundle 50% lighter than the previous one

    Important: The documentation will be updated during the next few weeks, however no API breaking changes were introduced.

    Source code(tar.gz)
    Source code(zip)
  • v6.1.2(Jan 24, 2022)

  • v6.1.1(Dec 17, 2021)

  • v6.1.0(Dec 11, 2021)

    • Update compiler
      • Components output code will use modern javascript (like arrow functions) reducing heavily their size
      • Components code output will be smaller due to compiler optimizations
    • Update dependencies
    Source code(tar.gz)
    Source code(zip)
  • v6.0.4(Sep 19, 2021)

  • v6.0.3(Aug 6, 2021)

    • Fix tags with only named export statements. Their javascript will be properly generated also without an export default
    • Update @riotjs/dom-bindings types adding better typescript support
    Source code(tar.gz)
    Source code(zip)
  • v6.0.2(Jul 29, 2021)

  • v6.0.1(Jul 14, 2021)

    • Update: update the @riotjs/compiler improving the typescript support for type aliases like export type ComponentInterface = RiotComponent<MyComponentProps, MyComponentState>
    Source code(tar.gz)
    Source code(zip)
  • v6.0.0(Jul 11, 2021)

    • Add strict typescript support https://github.com/riot/riot/pull/2912 Breaking Change: the Riot.js types have been updated
    • Add fallback rendering for slots https://github.com/riot/riot/issues/2920
    • Add typescript Parser as default compiler parser https://github.com/riot/compiler/pull/149
    • Fix https://github.com/riot/riot/issues/2925
    • Fix typescript compilation https://github.com/riot/riot/issues/2926

    If you are not a typescript user this release doesn't introduce any braking change. If you are a typescript user you can start writing Riot.js components as follows

    <my-component>
      <p>{ state.greeting }{ props.username }</p>
    
      <!--
        Notice that lang="ts" does actually nothing.
        It's just needed to let your IDE interpret the below code as typescript.
        The riot compiler will ignore it
      -->
      <script lang="ts">
        import {withTypes, RiotComponent} from 'riot'
    
        export type MyComponentProps = {
          username: string
        }
    
        export type MyComponentState = {
          message: string
        }
    
        export type MyComponent = RiotComponent<MyComponentProps, MyComponentState>
    
        export default withTypes<MyComponent>({
          state: {
            message: 'hello'
          }
        })
      </script>
    </my-component>
    

    Many thanks to https://github.com/kachurun for his help on this major release

    Source code(tar.gz)
    Source code(zip)
  • v5.4.5(Jun 13, 2021)

    • Fix https://github.com/riot/riot/issues/2914 many thanks to @kachurun
    • Fix template tags rendering with empty DOM https://github.com/riot/dom-bindings/pull/19
    Source code(tar.gz)
    Source code(zip)
  • v5.4.4(Jun 5, 2021)

  • v5.4.3(May 29, 2021)

  • v5.4.2(May 15, 2021)

    • Fix mountand unmount type declarations https://github.com/riot/riot/pull/2909 @kachurun
    • Fix Parent Tag access in lifecycle events https://github.com/riot/riot/pull/2910 @kachurun
    Source code(tar.gz)
    Source code(zip)
  • v5.4.1(May 4, 2021)

  • v5.4.0(May 4, 2021)

    • Update: replace the compiler acorn javascript parser with the (bigger but more modern) @babel/parser
    • Add: typescript syntax support in Riot.js <script> tags

    Notice: Riot.js will not type check your components scripts nor transpile them. This version allows you to use the typescript syntax without forcing the use of a typescript preprocessor, but type checking and transpilation should be handled with tools like babel or ts-loader You can check the new compiler here with the following demo component:

    <random>
      <h3>{ props.title }</h3>
    
      <button onclick={ generate }>
        Generate
      </button>
    
      <h1>
        { state.number }
      </h1>
    
      <logs logs={ state.logs } onclear={ clearLogs }></logs>
    
      <script lang="ts">
        import Logs from '../logs/logs.riot'
        import {RandomComponent} from './types'
    
        function Random(): RandomComponent {
          return {
            state: {
              number: null,
              logs: []
            },
            generate(event: MouseEvent): void {
              this.update({
                number: Math.floor(Math.random() * 10000),
                logs: this.state.logs.concat({
                  text: `Generate button clicked. Event type is ${event.type}`
                })
              })
            },
            clearLogs(): void {
              this.update({
                logs: []
              })
            }
          }
        }
    
        Random.components = {
          Logs
        }
    
        export default Random
      </script>
    </random>
    
    
    Source code(tar.gz)
    Source code(zip)
  • v5.3.3(Apr 5, 2021)

  • v5.3.2(Apr 5, 2021)

  • v5.3.1(Feb 28, 2021)

    • Fix https://github.com/riot/riot/issues/2895
    • Update improve compiler legacy syntax support. The following syntax is now also supported
    <my-component>
      <p>{ state.message }</p>
      <button onclick={onClick}>Click Me</button>
    
      <script>
        const context = this
    
        context.state = {
          message: ''
        }
        
        context.onBeforeMount = () => {
          context.state.message = 'Hello'
        }
    
        context.onClick = () => {
          context.update({
            message: 'Goodbye'
          })
        }
      </script>
    </my-component>
    
    Source code(tar.gz)
    Source code(zip)
  • v5.3.0(Feb 13, 2021)

    • Update improve support for legacy Riot.js syntax fixing some edge cases
    • Update improve support for recursive tags

    Now you can recursively render tags without having to register them globally

    <recursive-tree>
      <p>{ props.name }</p>
      <recursive-tree 
        if={ props.children.length && props.children } 
        each={ child in props.children } { ...child }/>
    </recursive-tree>
    
    Source code(tar.gz)
    Source code(zip)
  • v5.2.0(Jan 31, 2021)

    • Add support for old style Riot.js syntax

    Some liked more the old RIot.js syntax so you can now write components also as follows

    <old-syntax>
      <p>{ state.message }</p>
      <button onclick={onClick}>Click Me</button>
    
      <script>
        this.onBeforeMount = () => {
          this.state.message = 'Hello'
        }
    
        this.onClick = () => {
          this.update({
            message: 'Goodbye'
          })
        }
      </script>
    </old-syntax>
    
    Source code(tar.gz)
    Source code(zip)
  • v5.1.4(Jan 23, 2021)

  • v5.1.3(Jan 17, 2021)

Owner
Riot.js
Simple and elegant component-based UI library
Riot.js
A Web Component compiler for building fast, reusable UI components and static site generated Progressive Web Apps

Stencil: A Compiler for Web Components and PWAs npm init stencil Stencil is a simple compiler for generating Web Components and static site generated

Ionic 11.3k Jan 4, 2023
The AMP web component framework.

AMP ⚡ ⚡ ⚡ ⚡ Metrics Tooling AMP is a web component framework for easily creating user-first websites, stories, ads, emails and more. AMP is an open so

AMP 14.9k Jan 4, 2023
Web component server-side rendering

?? Ocean Web component HTML rendering that includes: Rendering to Declarative Shadow DOM, requiring no JavaScript in the client. Automatic inclusion o

Matthew Phillips 163 Dec 16, 2022
📓 The UI component explorer. Develop, document, & test React, Vue, Angular, Web Components, Ember, Svelte & more!

Build bulletproof UI components faster Storybook is a development environment for UI components. It allows you to browse a component library, view the

Storybook 75.9k Jan 9, 2023
🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)

English | 简体中文 dva Lightweight front-end framework based on redux, redux-saga and react-router. (Inspired by elm and choo) Features Easy to learn, eas

null 16.1k Jan 4, 2023
A declarative, HTML-based language that makes building web apps fun

A declarative, HTML-based language that makes building web apps fun ?? Docs ∙ Try Online ∙ Contribute ∙ Get Support Intro Marko is HTML re-imagined as

Marko 12k Jan 3, 2023
App development framework based on cocos creator3.1.1

todo: Waiting for English translation cx-cocos App development framework based on cocos creator3.1.1 一个基于cocos creator3.1.1的应用App和游戏开发框架 关键词:cocos cre

null 63 Dec 7, 2022
A basic helper to simplify relations among values, based on WeakRef

transform-once A basic helper to simplify relations among values. Optionally compatible with WeakValue too. import transformOnce from 'transform-once'

Andrea Giammarchi 8 Jan 19, 2022
Kunlun architecture element generation based on Angular schematics 🎬

A fullstack(NestJS、React) framework for building efficient and scalable applications. Description The Kunlun CLI is a command-line interface tool that

图灵人工智能研究院前端技术团队 8 Aug 1, 2022
A declarative, efficient, and flexible JavaScript library for building user interfaces.

React · React is a JavaScript library for building user interfaces. Declarative: React makes it painless to create interactive UIs. Design simple view

Facebook 200k Jan 4, 2023
A declarative, efficient, and flexible JavaScript library for building user interfaces.

Solid is a declarative JavaScript library for creating user interfaces. It does not use a Virtual DOM. Instead it opts to compile its templates down t

Ryan Carniato 24.5k Jan 4, 2023
ENS Avatar resolver library for both nodejs and browser.

ens-avatar Avatar resolver library for both nodejs and browser. Getting started Prerequisites Have your web3 provider ready (web3.js, ethers.js) [Only

Ethereum Name Service (ENS) 27 Dec 30, 2022
:fire: An extremely fast, React-like JavaScript library for building modern user interfaces

Inferno is an insanely fast, React-like library for building high-performance user interfaces on both the client and server. Description The main obje

Inferno 15.6k Dec 31, 2022
Tiny (2 KB) turboboosted JavaScript library for creating user interfaces.

Develop web applications with 100% JavaScript and web standards. ?? RE:DOM is a tiny (2 KB) UI library by Juha Lindstedt and contributors, which adds

RE:DOM 3.2k Jan 3, 2023
🙋‍♀️ 3kb library for tiny web apps

3kb library for tiny web apps. Sometimes, all you want to do is to try and do something—No boilerplate, bundlers, or complex build processes. Lucia ai

Aiden Bai 699 Dec 27, 2022
🌙 The minimal & fast library for functional user interfaces

Moon The minimal & fast library for functional user interfaces Summary ?? Small file size (2kb minified + gzip) ⚡ Blazing fast view rendering ?? Purel

Kabir Shah 6k Jan 2, 2023
jCore - JavaScript library for building UI components

JavaScript library for building UI components

iOnStage 11 Jan 21, 2022
KioskBoard - A pure JavaScript library for using virtual keyboards.

KioskBoard - Virtual Keyboard A pure JavaScript library for using virtual keyboards. Current Version 2.0.0 * Documentation and Demo https://furcan.git

Furkan MT 177 Dec 29, 2022
A JavaScript UI Library with JQuery like syntax

A JavaScript UI Library with JQuery like syntax. (Beta)

Sijey 5 Jan 16, 2022