Questions tagged [riot.js]

Riot is a React-like user interface micro-library. Incredibly fast, powerful yet tiny client side (MV*) library for building large scale web applications.

About

Despite the small size all the building blocks are there: a template engine, router, event library and a strict MVP pattern to keep things organized. On a finished application your views are automatically updated when the underlying model changes.

Current frameworks base their existence on following assumptions:

There's a big mass of common problems
MVC (or MVP) requires a framework
jQuery leads to spaghetti

Riot will teach you that none of the above is true. Client applications can be faster, simpler and smaller. They could be maintained with less people, less knowledge, and less worries.

Riot is a manifesto for vanilla JavaScript and jQuery.

Links

221 questions
28
votes
3 answers

IE11 innerHTML strange behaviour

I have very strange behaviour with element.innerHTML in IE11. As you can see there: http://pe281.s3.amazonaws.com/index.html, some riotjs expressions are not evaluated. I've tracked it down to 2 things: - the euro sign above it. It's encoded as…
Antoine
  • 5,055
  • 11
  • 54
  • 82
12
votes
9 answers

How do I access child elements within riot.js

If I have a custom riot tag with a p in it like this:

This is a text

How do I access the

element from within the tag? Update: I've received a whole bunch answers that are of ways to select it from the DOM.…

ThomasReggi
  • 55,053
  • 85
  • 237
  • 424
11
votes
1 answer

Load multiple files using the d3-fetch module

I try to load data from two different sources. After loading the data I want to use it within a riot tag file. But I do not understand how to load the second file, because I do not really understand the asynchronous call. What do I have to modify in…
Felix
  • 987
  • 1
  • 12
  • 23
11
votes
1 answer

Improving code quality/organization of event-heavy riot applications

I am building an application using riot.js and jquery. Everything works as expected, however as the code grows, so does my worry that triggering and handling events (.trigger/.on) in random/unexpected places in the code is doing nothing to keep my…
Gurunandan Bhat
  • 3,544
  • 3
  • 31
  • 43
6
votes
2 answers

Riot.js 2: Attribute with falsy value

I need to have an attribute which can have value of zero (0) Riot template: this.time = condition ? '10' : '0' Desired result: However, Riot automatically omits whole attribute if it…
6
votes
3 answers

How to pass variable to child tag using riot js

I am not that much experienced in riot js. Hierarchy of tags which i created are like Now i need to pass variable (whcih contains JSON) to "tag-3", and on every update of…
Ahmed Khakwani
  • 410
  • 2
  • 8
  • 18
5
votes
1 answer

Browserify with Riot Custom Tags giving Type Error

I'm trying to use riot custom tags with browserify. TypeError: Cannot read property 'render' of null while parsing file: /Users/michaelmostachetti/Google_Drive/dev/web/mike_mostachetti_site/app/views/blog.tag at _html.jade…
mjmostachetti
  • 378
  • 1
  • 4
  • 14
5
votes
5 answers

RiotJS - How to pass events between subtags using Observable pattern?

Im not really sure if Im understanding correctly the way observables work and how to get references from mounted tags. I have a component. Within this component we have a component and a component. The purpose is to avoid coupling between…
kitimenpolku
  • 2,604
  • 4
  • 36
  • 51
5
votes
5 answers

How to use jQuery plugins in React, Riot 2.0

I have a jQuery heavy app I'm in the middle of that has many jQuery plugins and I want to restructure the app, so I'm looking at different frameworks like Angular, React, Riot 2.0, etc. I like React and Riot, but I can't figure out how I'd make your…
Timmerz
  • 6,090
  • 5
  • 36
  • 49
4
votes
1 answer

RiotJS onclick triggering on load

I am writing a table application using RiotJS and I keep running into the same problem with the onclick event. Almost every time I try to use the I get very erratic behaviour. Sometimes it will call the function a…
stmfunk
  • 663
  • 5
  • 20
4
votes
1 answer

how to include external css and javascript in riot tag?

I want to create a tag for a carousel, but I only want to load the CSS and Javascript files when this tag is used on the site, but I can only make it work if I add it to the of my website. Is there a way to only load is in the tag? my tag…
balexandre
  • 73,608
  • 45
  • 233
  • 342
4
votes
3 answers

Is it possible to separate the javascript code from the tag file in Riot Js?

I would like to know if it is possible to do something like:
Hello, world!
The tag would keep the view (html) while the js code stays in a different…
Fernando Gabrieli
  • 980
  • 3
  • 15
  • 31
4
votes
1 answer

Riot.js dynamically render nested custom tags from different files server side

I am trying to make use of riot.js server-side rendering to make a static HTML page that could be read by google spiders. I have a basic example working but I am trying to figure out how to dynamically load tags from different files when rendering…
4
votes
1 answer

How to make a variable update work in riot js

Loving riot js but why is "Hello 0" not incrementing on the page in the following code example, and what is the workaround for now?

Hello {myNumber}

this.myNumber = 0; var thisApp = this; setInterval( …
Navigateur
  • 1,852
  • 3
  • 23
  • 39
4
votes
3 answers

Riot JS unmount all tags in a page and then mount only one tag is not working

I am using Riot JS and in my index.html, I have 3 custom tags - header, login-panel and candidates-panel inside my body. In my main app.js, in the callback function of $(document).ready, I execute the current route and also register a route change…
Prabu Rajan
  • 103
  • 1
  • 4
1
2 3
14 15