12 ms·
React v0.11
- arianvanp 12y agoGreat stuff. I really love React. Especially stuff like server-side prerendering of the DOM is extremely cool.
- swah 12y agoBut that assumes a world where everyone uses Node :)
- swannodette 12y agoReact server side rendering doesn't require Node. Works just fine with Java 8's Nashorn too.
- poseid 12y agomaybe not yet, but I just wrote a blog post why in the future here: http://radar.oreilly.com/2014/07/next-generation-web-apps-with-full-stack-javascript.html http://radar.oreilly.com/2014/07/next-generation-web-apps-wi...
- Dewie 12y ago100% javascript, that would be living the dream......
- andybak 12y agoIs my sarcasm meter on the blink again?
- notduncansmith 12y agoI don't know, but this subthread is off the charts on the Poe scale.
- Dewie 12y agoviolent beeping
- deleted 12y ago[deleted]
- Dewie 12y agoWoah, where did Haskell come from all of a sudden?
- fidlefodl 12y agoFwiw, i use serverside React rendering with a Golang API server. My JS code has an interface layer which interfaces to browser/node, and on first load a balancer throws the request to Node, which makes local API calls to the api server, and renders it all in node. Technically i use Node, but only to implement a small interface layer for things like http requests. So i don't really consider it a Node app. The real code is all React and Golang.
- juliennakache 12y agoAwesome stack. It's exactly what I've started working on lately. I have 2 questions for you :) 1. What router do you use for react as it's necessary if you want multiple entry points into your app ? Rrouter seems promising. 2. How do you elegantly proxy client cookies from your node app to your api ? (both way: read and writes) Thx!
- jjsz 12y agoDo you happen to have a boilerplate of your stack on github?
- ebiester 12y agoThe JSX translation shouldn't be too hard to write a binding. I know that it happened with mustache. Now, it would mean keeping it in sync, but it might not be a bad idea for people outside node and the JVM.
- fiatjaf 12y agoWhat should we do with all the Javascript code between the brackets?
- baddox 12y agoIt only assumes a world where everyone uses JavaScript. And in this context, "everyone" is web developers, so it's a fair assumption.
- polskibus 12y agoThere's a ASP.NET MVC plugin for server-side rendering of React http://reactjs.net/ http://reactjs.net/
- polskibus 12y agoThere's a ASP.NET MVC plugin for server-side rendering of React http://reactjs.net/ http://reactjs.net/
- rubiquity 12y agoWooohoo! Nice release. I especially like the JSX Namespacing! I sometimes found myself sacrificing better organization/naming just so my component rendering code wasn't so hideous.
- spicyj 12y agoWe still recommend exporting small modules internally in your code base so that things are easier to reason about and dead code elimination can work better -- but when interfacing with third-party libraries, the namespacing feature can be helpful. :)
- asdad 12y agoHas anyone written a large React application yet? Preferably open source?
- jypepin 12y agoI don't have any open source examples, but I have multiple friends at different mid-size startups who replaced backbone with react and they are all super happy about it. I'm looking forward to try React myself, but haven't yet. Seems like React is here to stay and become really really awesome, I haven't heard anybody say bad things about it.
- Fishkins 12y ago> I have multiple friends at different mid-size startups who replaced backbone with react They all replaced backbone with react? I haven't really used either, but I thought a lot of people used backbone and react together, since they excel at different things.
- findjashua 12y agoi'm assuming he meant 'replaced backbone views with react'
- spicyj 12y agoAt Khan Academy most of our frontend is now using React (including our personalized learning dashboard, coach reports, question editor [1], etc.) and we're really happy with it. We have about 750 React components and 50,000 lines of JSX now. We've migrated pieces incrementally and React is really great for doing that because it doesn't try to own your whole app. My friends and I also just launched Vim Awesome [2], which is not "large" but is completely written in React and is open source if you're curious to look at it. [1]: https://github.com/Khan/perseus https://github.com/Khan/perseus [2]: http://vimawesome.com/ http://vimawesome.com/
- subsection1h 12y ago
- fidlefodl 12y agoAnyone have any opinion on React vs Polymer? It's something i've been struggling with quite a bit. Conceptually i love Polymer, and really want to switch, but React's serverside rendering is just hard to beat. I'm scared of showing users page load spinners while my 20 Polymer components all load their data heh
- spicyj 12y agoI'd love to know what you love about Polymer so we can make React better. :)
- arianvanp 12y agoWhat I like a lot about polymer is that you can isolate css per component. And that you can also apply styling on your new element names..
- fidlefodl 12y agoWell, as unhelpful as this.. I love everything about Polymer, except the possible HTTP request spam and lack of serverside rendering. Polymer is sort of React Components "To the extreme" (to me). They represent everything i love about React Components, with encapsulated JS, CSS, and HTML. Meaning that i can pull in someone elses Polymer component, or use one from another project, and it "just works". Granted, the HTTP spam scares the hell out of me. Vulcanize may help with that, but i have yet to really figure out the whole process for my workflows. Having to load an html wrapper, do clientside routing, load the data into the clientside templates and render templates all for the first page load just scares me with Polymer. React solves this by letting me do it all serverside, and it is wonderful at that. I really do love React. I'll likely stick with React for another project or two, unless i conceptually have an "ah hah" moment with Polymer.. but until i can render Polymer serverside, i'll always be longing for React. edit: Come to think of it.. If someone could bake html imports and shadow dom into React, i may be in heaven.
- peterhunt 12y agoReact already can render into shadow roots, and eventually we could add a mode that tosses aside server rendering in favor of shadow DOM. However, if all you want is style encapsulation, you can get that with conventions.
- Touche 12y agoWhy React and not Mithril?
- sehr 12y agoI'm all for variety, but does someone have to mention that framework every time another one is being talked about? I get that the creator advertises it here pretty heavily, an that's cool. Doesn't mean everyone else has to as well.
- spyder 12y agoIt's relevant because it's similar to React (but more lightweight and claims to be faster). Mentioning it here can be useful for those who are looking for alternatives to React.
- fiatjaf 12y agoI seems to me that Mithril is inspired by React, and it's awesome that someone is trying to make things better than React. That said, I have a bad impression of Mithril, because, in any case, its author should bear some respect to React, as a son to his father. But, instead, he appears very arrogant when talking about React (look here: http://lhorie.github.io/mithril/comparison.html#react http://lhorie.github.io/mithril/comparison.html#react) as if it was React that was inspired by Mithril and was reimplement Mithril ideas with worse performance. That bad impression, caused just by words (and other comments from its author here), pulls me away from Mithril, which is a situation I don't love.
- fuzzythinker 12y agoI actually think that comparison is fair. Don't read as a negative towards React at all.
- k__ 12y agoI got the same impression. But I built my web-apps with a similar pattern for years. Keeping an virtual structure of my components and rendering the delta to the DOM when finished, so React didn't seem like a big deal for me. But I liked, that they baked the idea into a reusable framework.
- ChikkaChiChi 12y agoI planned on using React for my next mobile app project until Polymer was shown off at I/O. React is a fantastic alternative to Angular, but the Paper Elements make Polymer too good to pass up. I would be over the moon if React had a UI Kit that could be included. We need more app-centric first UI options for rapid development.
- yazaddaruvala 12y agohttps://github.com/react-bootstrap/react-bootstrap https://github.com/react-bootstrap/react-bootstrap?
- planckscnst 12y agoTry the paper elements demo [1] in Firefox mobile before finalizing that choice. It's pretty maddening. [1] http://www.polymer-project.org/components/paper-elements/demo.html#paper-input http://www.polymer-project.org/components/paper-elements/dem...
- bsaul 12y agoOr on an ipad. It doesn't work very well and even crashed my ipad air. I'll definitely not use it for a webapp.
- fiatjaf 12y ago"Update: New $apply command to transform values" What is that? No, no, no, stop that! You're becoming Angular!
- thomasloh 12y agoReact much?
- WickyNilliams 12y agoThat's referring to an immutability helper, not like angular at all
- fiatjaf 12y agoEvery night when I close my eyes I envision a future in which React surpasses HTML and browsers start to only render REACT code, documents are written and named index.react, amateurish people say they are REACT programmers and everything is so beautiful that you can't stop looking. _________ Now seriously: there should be a way to turn React from a library to a DSL that could be rendered by any language, so all servers, not only Node, could generate their pages in React and pass them to the browsers. Event handling could still be javascript, as servers don't need them, but code that rendered elements according to specific this.props should be universal.
- grannyg00se 12y agoWhat a great site for reading. I'm not usually into design, but reading through that blog forced me into a new appreciation for layout, font, and color.
- HorizonXP 12y agoI just started using React on my project this week. It's incredibly easy to use and get running, I'm loving it. It's really simplified my UI development. The UI for my project is something I need to just get done for now, while I build out the rest of the functionality. I'll come back later to make it prettier. But React makes that super easy to do. Wish I'd talked to the guys at FB about it more before I left.
- islon 12y agoAnd the best thing is that I can use react with Clojurescript (Om), which makes it even faster =)
- bgdam 12y agoI have been trying to use React in an application I am building. One recurring issue I have with React is child to parent component communication. The recommended way seems to be to have the child component emit events which are then caught and handled by the parent component. Unfortunately, this approach does not work very well in the cases where I have multiple instances of the same component, in which case all the parents will be recieving and handling the event emitted by a single child. I would love to hear any possible solutions for this that do not involve either registering unique event names for each instance of the component or passing in a unique id as part of the event payload, which is then verified by the handler function.
- insin 12y agoThe docs recommend passing a callback for parent-child communication: http://facebook.github.io/react/tips/communicate-between-components.html http://facebook.github.io/react/tips/communicate-between-com...
- loganfsmyth 12y agoCould you elaborate here on what you mean by "all the parents will be recieving and handling the event emitted by a single child"? Or perhaps post a question on StackOverflow.
- theycallmemorty 12y agoMaybe I'm not understanding the problem correctly, but I simply had the child components 'know' their index or id (stored in props) and then pass that to the parent with any call.
- deleted 12y ago[deleted]
- tete 12y agoIs it only me or does that remind anyone else about basic MVC frameworks, like Backbone used properly? Oh and don't get me wrong that this pattern gets used again. I can see it being extended here and it looks really nice and promising. I just don't understand the sudden hype.
- theycallmemorty 12y agoReact is not meant to replace something like Backbone, it is only the 'V' in MVC although you could argue it is also the C. React does not ship with any code for saving your data to the server.
- megaman821 12y agoDoes everyone just use Backbone.js with React, or are there other models, routers, and controllers that people use?
- bellerocky 12y agoInline JSX is such a stupid idea, and react.js doubles down on stupid. Why do this? The documentation never explains why it is good to add some invalid JavaScript syntax to a library. I want my templates in the same file as my JavaScript logic, inline no less, peppered throughout variable declarations and function calls all over the place, like I want to stub my toe. I do not want to stub my toe and I don't want to use JSX. Notice the complete lack of support in Webstorm.
- fiatjaf 12y agoI agree. It is ugly. It must be because of HTML reuse or something. But you should try writing React templates in pure Coffeescript[1], perhaps reusing your HTML through a tiny tool[2] I wrote for it. [1]: http://blog.vjeux.com/2013/javascript/react-coffeescript.html http://blog.vjeux.com/2013/javascript/react-coffeescript.htm... [2]: http://html2react.alhur.es/ http://html2react.alhur.es/
- bellerocky 12y agoI should mention that I have changed my mind about JSX after actually giving it a try.