News for hackers. Stuff that matters.
Re:Vue.js 1.0.0 by lemevi on Tuesday October 27, 2015 @12:05AM (#10456261)
> More importantly, there’s no need to worry about calling $apply in a timeout, or calling setState(), or listening to store events

Calling `setState` is not a big deal and neither is dealing with stores. It's very simple and you keep your state separate from your HTML.

At this point I probably can't do web development without JSX and not be miserable. The days of separate templates are hopefully forever behind me. Not trying to dismiss your very hard work I'm sure, but React has taken us into the future. Maybe with esperanto you could add templates into your own JS or make it work with JSX and react-dom.

Re:Vue.js 1.0.0 by bradstewart on Tuesday October 27, 2015 @01:53AM (#10456502)
See http://vuejs.org/guide/application.html#Single_File_Componen.... While it is certainly not JSX, Evan has written a Webpack loader, Browserify transform, and even a Sublime syntax highlighter to let you write JS, CSS, and HTML for a component in a single file.

I personally like this approach as it lets me mix and match my favorite languages (Coffeescript, SASS, etc), and it makes plugging Vue into existing code a straightforward process.

Re:Vue.js 1.0.0 by cristianpascu on Tuesday October 27, 2015 @03:45AM (#10456741)
Just yesterday I was looking for a solution to mix HTML, *Script and CSS preprocessors in one single file. So happy I found this project! There's hope.
Re:Vue.js 1.0.0 by EvanYou on Tuesday October 27, 2015 @08:50AM (#10457630)
Having to call `setState` kinda becomes a big deal when you want to separate state manipulation and make your components dumb. Both dirty checking and Virtual DOM are pull-based mechanisms - i.e. nothing happens when the state itself changes, you have to give the system a signal to pull and apply. This means when manipulating externalized state you need to hold a reference to all the components that are interested in it, or do it by registering events - which is why the original Flux is unnecessarily complex. It becomes less awkward when you have a single state atom, and that's why Redux is an improvement over vanilla Flux.
Re:Vue.js 1.0.0 by ocean3 on Tuesday October 27, 2015 @02:14AM (#10456557)
After using React with Redux i can't even go back to plain Flux stores.
Re:Vue.js 1.0.0 by feider on Tuesday October 27, 2015 @10:50AM (#10458307)
I'm not disagreeing, but when I hear "..., but React has taken us into the future." - is it just me or does this sound a bit too pompous?
Re:Vue.js 1.0.0 by andrezsanchez on Tuesday October 27, 2015 @12:25AM (#10456312)
It would be neat if Facebook had implemented JSX as a framework-independent transform rather than a React-only one, that way other frameworks could use the pretty XMLish syntax rather than strings or JS objects.
Re:Vue.js 1.0.0 by rvikmanis on Tuesday October 27, 2015 @12:29AM (#10456322)
Re:Vue.js 1.0.0 by andrezsanchez on Tuesday October 27, 2015 @02:12AM (#10456553)
Emphasis on "implemented" haha. At least this makes it more open since someone can come in and make their own implementation. As it currently stands I don't think you can use Facebook's implementation to transform JSX to a framework-agnostic object.
Re:Vue.js 1.0.0 by dmnd on Tuesday October 27, 2015 @02:27AM (#10456589)
You can use babel. Look at the custom example here: http://babeljs.io/docs/advanced/transformers/other/react/
Re:Vue.js 1.0.0 by k__ on Tuesday October 27, 2015 @08:24AM (#10457523)
Well, you could fork it:

https://github.com/insin/msx

Re:Vue.js 1.0.0 by tiles on Tuesday October 27, 2015 @12:29AM (#10456321)
There are alternatives though, like JSX implemented in sweet.js: http://jlongster.com/Compiling-JSX-with-Sweet.js-using-Readt...
Re:Vue.js 1.0.0 by EvanYou on Tuesday October 27, 2015 @08:43AM (#10457595)
There are babel transforms for it: https://github.com/openjsx In fact I've seen a user use JSX-to-HTML for his Vue templates.
Re:Vue.js 1.0.0 by sdegutis on Tuesday October 27, 2015 @12:20AM (#10456304)
Evan:

I'd love to know your response to lemevi here. In particular, what you consider the strengths and weaknesses to be in both your approaches, and why you prefer yours.

Re:Vue.js 1.0.0 by hhsnopek on Tuesday October 27, 2015 @02:51AM (#10456651)
I disagree, I've never used jsx and I can still build web apps. There are plenty of templating languages to choose from, my choice is Jade. I actually have never touched React because I've never had so much DOM manipulation to make use of it. If anything I can smoothly update my DOM with marionette/backbone and a little css animation.
Re:Vue.js 1.0.0 by Kiro on Tuesday October 27, 2015 @04:00AM (#10456767)
What are you disagreeing with exactly? They're not saying you can't build web apps without React and if you haven't even used React I don't see how you can make any judgement on that part.
Re:Vue.js 1.0.0 by rapind on Tuesday October 27, 2015 @02:02PM (#10459909)
I'm a fan of HAML / Slim / Jade too. You might want to check out React w/ CoffeeScript as it gets you pretty close (and has some benefits).

It's not as pretty, but still better than JSX imo. I posted some examples here: http://rapin.com/blog/2015/02/03/reactjs-with-coffeescript/

Re:Vue.js 1.0.0 by k__ on Tuesday October 27, 2015 @08:23AM (#10457518)
Funny thing is, I switch away from React if I have much DOM manipulation and only use it for the "normal" stuff, like forms.
Re:Vue.js 1.0.0 by keithy on Tuesday October 27, 2015 @08:32AM (#10457543)
Yeah, but the thing with React is that it's one library, instead of having both Jade and Backbone, you can have a fully React stack and have peace of mind through it.

I've used Jade and honestly prefer the React way for sure because it combines the javascript with the html in the same file(s)

Re:Vue.js 1.0.0 by aug-riedinger on Friday October 30, 2015 @02:26PM (#10479581)
I actually don't understand how vue is different from react since the data flows the same way (besides different syntax and less jsx sugar, but preprocessable templates). More details on this from the author would be nice ! :) Good job anyway !