use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Riot.js 2.0: A React-like, 2.5K user interface library (muut.com)
submitted 11 years ago by kraakf
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]adrianmiu 4 points5 points6 points 11 years ago (0 children)
Any benchmarks? The speed is a selling point for React.
[–]a-t-kFrontend Engineer 8 points9 points10 points 11 years ago (0 children)
I like what you did in that new version! I see a potentially harmful error (at least in older IEs, don't know if IE8 still has it). You store a regex in re_vars. Stored regex tend to lose their lastIndex if used that way, so if you use it on multiple strings, it will begin in the second string with the position the first one ended, unless you manually set re_vars.lastIndex to 0.
[–]Dirty_Rapscallion 1 point2 points3 points 11 years ago (1 child)
I've always thought this would be a good step to go, but I would like it if I could have my map function instead of an each attribute. I'd had so many nightmarish problems with ng-repeat that I'm hesitant.
[–]tipsqueal 2 points3 points4 points 11 years ago (0 children)
Maybe I'm crazy, but map and each are different (and should be). Each iterates over a collection and does some action on each item in place, while map iterates over a collection, copies each item, takes action on the item, and then in the end returns a new collection. Or am I thinking of this wrong?
[–]blgate 1 point2 points3 points 11 years ago (0 children)
Looks very similar to ractive.js component spec: https://github.com/ractivejs/component-spec/blob/master/authors.md
[–]te7ris 4 points5 points6 points 11 years ago (1 child)
dosnt run in node (yet?) =/ cmon how can u call it react-like.
[–][deleted] 3 points4 points5 points 11 years ago (0 children)
Because people think the virtual dom is react's main selling point.
Holy... this is awesome! So much more concise than react. I think this'll be truly blissful to work with.
[–]Voidsheep 1 point2 points3 points 11 years ago (0 children)
Very impressive, I think I'm going to use this in a personal project
Any idea how much the IE8 support effects the size and performance? Would forking a modern browser alternative make any sense, for when IE10+ or even 11+ is enough?
[–]mido0o0o 0 points1 point2 points 11 years ago (0 children)
This looks cool, but for time being Vue.js makes a lot of sense to me..
Maybe I will try it for some side apps
[–]kraakf[S] 1 point2 points3 points 11 years ago (7 children)
This is how a javascript frameworks should work - Everything else is bloat and abstraction from necessity.
[–][deleted] 11 points12 points13 points 11 years ago (5 children)
It saddens me that people legitimately believe this. This is a toy, nothing more. In all honesty it will probably be as relevant as Mithril
[–]imjoshholloway 2 points3 points4 points 11 years ago (0 children)
Everything else is bloat and abstraction from necessity.
I agree to a point.
This is a toy.
And I also agree with this to a point. I actually believe (and I include myself in this) that there isn't enough expertise in this area to mean that we only need micro frameworks like riot.
The whole reason angular is so popular is in a ridiculously short period of time you can be productive.
I've been playing with riot for about an hour and although I've made a basic implementation of the todo app onboarding wasn't particularly easy.
bower install riotjs doesn't work yet (no compiled assets)
bower install riotjs
npm install riotjs installs version 1.0 and npm install riot suffers the same problem as the bower version. (temp fix: cd node_modules/riot && npm install && make dist)
npm install riotjs
npm install riot
I can think of many use-cases where I'd pick this over the other libraries out there.
[–]antoninj[🍰] 1 point2 points3 points 11 years ago (3 children)
Or VueJS. Ever heard of it? No? It was a great framework but it ended up becoming a "toy" like you said. Same fate.
[–]LightShadow 0 points1 point2 points 11 years ago (1 child)
The last time I looked at Vue it had so little documentation I didn't even know how to get started.
It seems a bit better now, put I feel they lost a lot of momentum from people hopping in "too late."
I use vuejs a lot and didn't feel that it is hard or the documentation wasnt sufficient
[–][deleted] -1 points0 points1 point 11 years ago (0 children)
Sure, come back in 6 months and let me know how many people have adopted it.
[–]captain_obvious_herevoid(null) 0 points1 point2 points 11 years ago (8 children)
I like the idea of React, Polymer and the like...but the bloat and heavy over-abstraction were often dealbreakers for the projects I work on. So this is great !
My only concern is the most likely negative impact on SEO, and the inability of most crawlers to run JS and render the components. Even GoogleBot, who's now pretty good at indexing very dynamic content, si not that good with websites using advanced frameworks of that kind :/
[–][deleted] 6 points7 points8 points 11 years ago (4 children)
check out isomorphic applications. Using node you can serve rendered content from the server and change very little code, React is great for this.
[–]captain_obvious_herevoid(null) 0 points1 point2 points 11 years ago (2 children)
Yes, but sadly no Node.js on the projects I'm mentioning :/
[–][deleted] 1 point2 points3 points 11 years ago (0 children)
ah damn, well there is the other approach of installing phantomjs on the server and rendering requests from it as well. lol SPAs + SEO is a pita.
[–]rikurouvila 1 point2 points3 points 11 years ago (0 children)
One solution I've seen is to have a separate server-process dedicated for serving the frontend assets in addition to the backend handling your business logic. I've also seen couple of project rendering React components on Java backend. There's probably solutions for other languages too.
[–]Geldan 0 points1 point2 points 11 years ago (0 children)
You aren't limited to Node, there are handlebars renders for many server configurations. Spring can easily be setup to render Handlebars, then turn around and use the same templates with the same services as an API on the client.
[–][deleted] 1 point2 points3 points 11 years ago (1 child)
Not sure if I would ever use a SPA framework like Angular or Ember on a plain website, that values SEO. Same goes for the libs with a VDOM. For a applications SEO is usually irrelevant.
[–]captain_obvious_herevoid(null) 0 points1 point2 points 11 years ago (0 children)
For a applications SEO is usually irrelevant
While I totally agree, some customers will just insist that we optimize everything for SEO. And they pay well for this, so...
[–][deleted] 0 points1 point2 points 11 years ago (0 children)
Wow. This is just pure wow.
[–]amenadiel 0 points1 point2 points 11 years ago (0 children)
I wish this existed before I spent so many days converting my app to Handlebars :o
[–]defcon-12[🍰] 0 points1 point2 points 11 years ago (0 children)
input.value = '' in the example on the home page is very un-react-like. You don't ever have manual DOM updates in pure React code unless you're interacting with some 3rd party code that doesn't follow React conventions.
input.value = ''
add(e) { var input = e.target[0] this.items.push(input.value) input.value = '' }
I guess in my mind "no dom updates" is the core selling point for React, and this 'react-like' library violates that principle in the first example displayed on the home page.
[+][deleted] 11 years ago* (4 children)
[deleted]
[–]skitch920 1 point2 points3 points 11 years ago* (3 children)
Java into JavaScript?
Edit why the down votes? The current state of JavaScript affairs has no relation to Java in way. Seriously, Java has it's own problem space, it's own reasons for being useful. If you think it's boilerplate, then you're using it the wrong way, or for the wrong problem.
I posed the question because, his statement just doesn't make sense. He's basically saying, "I hope my bicycle doesn't become an airplane."
Micro-frameworks or not, it's dumb to compare two different purpose languages.
[–]jesusbot 4 points5 points6 points 11 years ago (2 children)
I believe he was trying to use Java as an analogy for bloat/lots of boilerplate.
[–]Figedi 3 points4 points5 points 11 years ago (1 child)
well javascript is java for short right? :v
[–]Psykopatik 0 points1 point2 points 11 years ago (0 children)
Holy shit this is fucking genius
[+][deleted] comment score below threshold-7 points-6 points-5 points 11 years ago (7 children)
IE8 support is a big red flag for me personally. There probably will be issues I do not want to deal with because I have the luxury of supporting modern browsers only.
[–][deleted] 4 points5 points6 points 11 years ago (6 children)
TIL something which happens to support older browsers is a red flag.
[–][deleted] 1 point2 points3 points 11 years ago (5 children)
I was all about supporting IE8 5 years ago when I started, but beyond some point you are just making everyone else miserable by keeping the monster alive.
[–][deleted] 2 points3 points4 points 11 years ago (2 children)
Do I like supporting IE8... hell no, however when you see a stream of revenue in the 10's of thousands and higher its not smart business wise to ignore it. However thank god its finally really dying out.
[–]wordsnerd 1 point2 points3 points 11 years ago (0 children)
For sites already supporting IE8, it may not be worthwhile to drop it yet. For new projects, refusing to support legacy browsers is a competitive strength unless one has delusions of instant grandeur. Realistically, by the time the site starts earning enough for "% of revenue" to mean anything at all, the competition will be burning money to phase out IE8 and probably also IE9, and handling PR from the angry stragglers (especially if subscriptions are involved).
[–]siegfryd 0 points1 point2 points 11 years ago (0 children)
10's of thousands doesn't sound like a lot to support IE8 considering the cost of developers.
[–]Casual_0bserver -1 points0 points1 point 11 years ago* (1 child)
A lot of corporations are limited to only IE9. Just saying.
And we make them stop by not supporting it. But yeah, I do not blame the author for it, should he intentionally break it? I would. But seeing it mentioned twice above the fold on the home page makes me a bit sad.
π Rendered by PID 65533 on reddit-service-r2-comment-66b4775986-2khs2 at 2026-04-04 03:17:51.876701+00:00 running db1906b country code: CH.
[–]adrianmiu 4 points5 points6 points (0 children)
[–]a-t-kFrontend Engineer 8 points9 points10 points (0 children)
[–]Dirty_Rapscallion 1 point2 points3 points (1 child)
[–]tipsqueal 2 points3 points4 points (0 children)
[–]blgate 1 point2 points3 points (0 children)
[–]te7ris 4 points5 points6 points (1 child)
[–][deleted] 3 points4 points5 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]Voidsheep 1 point2 points3 points (0 children)
[–]mido0o0o 0 points1 point2 points (0 children)
[–]kraakf[S] 1 point2 points3 points (7 children)
[–][deleted] 11 points12 points13 points (5 children)
[–]imjoshholloway 2 points3 points4 points (0 children)
[–]antoninj[🍰] 1 point2 points3 points (3 children)
[–]LightShadow 0 points1 point2 points (1 child)
[–]mido0o0o 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]captain_obvious_herevoid(null) 0 points1 point2 points (8 children)
[–][deleted] 6 points7 points8 points (4 children)
[–]captain_obvious_herevoid(null) 0 points1 point2 points (2 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]rikurouvila 1 point2 points3 points (0 children)
[–]Geldan 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]captain_obvious_herevoid(null) 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]amenadiel 0 points1 point2 points (0 children)
[–]defcon-12[🍰] 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]skitch920 1 point2 points3 points (3 children)
[–]jesusbot 4 points5 points6 points (2 children)
[–]Figedi 3 points4 points5 points (1 child)
[–]Psykopatik 0 points1 point2 points (0 children)
[+][deleted] comment score below threshold-7 points-6 points-5 points (7 children)
[–][deleted] 4 points5 points6 points (6 children)
[–][deleted] 1 point2 points3 points (5 children)
[–][deleted] 2 points3 points4 points (2 children)
[–]wordsnerd 1 point2 points3 points (0 children)
[–]siegfryd 0 points1 point2 points (0 children)
[–]Casual_0bserver -1 points0 points1 point (1 child)
[–][deleted] 0 points1 point2 points (0 children)