Live data from Hacker News

Ask HN: JavaScript framework that I can use “right now”?

news.ycombinator.com

1–10 of 24 posts

Ask HN: JavaScript framework that I can use “right now”?

#1
After spending a week learning and experimenting "modern" JavaScript I think it's not worth the effort to use React.js and Webpack if I'm not making a full SPA. It's like alpha software with constant changes (I'm mainly talking about the ecosystem and its components). Documentation is also lacking, specially Webpack. Even tutorials from 3~6 months ago are somewhat outdated. Funny thing I learned Flux's basics and now they are already talking about Relay (ffs!)

Right now I have a tradicional (and huge) MVC back-end and an API (I'm not using Node.js). Assets = Gulp to concat+rev+uglify.

What would be the best approach to my pages where a lot of user interaction is needed? Using jQuery and handlebars seems ugly but I think I'll be overcomplicating things if I adopt an entire new stack (React, Babel JSX/ES6, Webpack, modules, hot-reload...) on top of what I already have.

I'm the single developer on this web app, I feel extremely productive on the back-end side but the front-end is driving me NUTS. Since it started making a good amount of money I quit my job a few months ago and it's my main income now.

I'm (literally) having nightmares about a JS bug I won't be able to solve since it's so many moving parts and I'm a back-end dev who doesn't have the time or patience to replace his entire front-end stack every 6 months.

Re: Ask HN: JavaScript framework that I can use “right now”?

#3
Don't kill the messenger but I tend to stick to plain jQuery + ba-hashchange for building SPAs.

I don't think its worth the time to really learn Angular or whatever is the current fad these days - quality of both the software and the documentation of JS frameworks is an afterthought to "getting an MVP ready to ship".

I'm not a ripening chamber for bananas, especially bananas with no papers.

Re: Ask HN: JavaScript framework that I can use “right now”?

#5

Don't kill the messenger but I tend to stick to plain jQuery + ba-hashchange for building SPAs. I don't think its worth the time to really learn Angular or whatever is the current fad these days - quality of both the software and the documentation of JS frameworks is an afterthought to "getting an MVP ready to ship". I'm not a ripening chamber for bananas, especially bananas with no papers.

My english is awful, I was trying to say it's not really a SPA that I'm making. I want to keep the routing mainly on my back-end and only do ajax calls to my API where needed. But if it's not another alpha-state component I would love to have the added possibility of using one or two extra routes on the JS side. It's just that checking the most popular repos and reading things like these is awful: "We are currently working hard on some major API changes for version 1.0."

Is like "mini-SPA's" on a few places that deal with too many data sources and would be a pain to make my users change screens.

I really enjoyed doing "one way binding" and some ideas around React though.

Re: Ask HN: JavaScript framework that I can use “right now”?

#6
Having worked on a fairly large SPA using Ember.js 1.*, I can tell you that React.js (with Webpack, React Router and something like Redux) would probably be better than Ember (perhaps even Ember 2.0, which is still not fully mature).

But if you need something even more stable than React, I'm not sure there is a good option out there. I dislike Angular.js for a number of reasons (which I won't go into here). I've heard good things about Mithril, but it's MVC so as the app grows larger, you're likely to end up with the same problems you have with your current implementation.

Ironically, I'm currently considering a move to the exact stack you're considering (React, Babel JSX/ES6, Webpack...) and I find it better than everything else I've evaluated over the past year.

Thoughts?

Re: Ask HN: JavaScript framework that I can use “right now”?

#7

Don't kill the messenger but I tend to stick to plain jQuery + ba-hashchange for building SPAs. I don't think its worth the time to really learn Angular or whatever is the current fad these days - quality of both the software and the documentation of JS frameworks is an afterthought to "getting an MVP ready to ship". I'm not a ripening chamber for bananas, especially bananas with no papers.

My english is awful, I was trying to say it's not really a SPA that I'm making. I want to keep the routing mainly on my back-end and only do ajax calls to my API where needed. But if it's not another alpha-state component I would love to have the added possibility of using one or two extra routes on the JS side. It's just that checking the most popular repos and reading things like these is awful: "We are currently w…

> I want to keep the routing mainly on my back-end and only do ajax calls to my API where needed.

I'm not trying to push React (I'm still evaluating it myself), but that sounds like just the job for React components?

Re: Ask HN: JavaScript framework that I can use “right now”?

#8
I have the same feelings about "modern" JS development.

Knockout.js is worth checking out. It can be picked up in a day or so, and can be integrated into existing sites easily.

I actually started down the road of learning Backbone/Marionette to work on an existing codebase, and I'm liking what I see overall. It offers models that can sync up to your backend easily, and adds much needed structure to handlebar templates and jQuery.

If you feel like using React, it looks like it would be quite easy to use Backbone models in the same way Flux implementations are used (basically a data store w/ events). I might try this down the road as I like React but want to avoid CommonJS/ES6 and whatever the Flux lib du jour is.

Re: Ask HN: JavaScript framework that I can use “right now”?

#9
I'd use Backbone. It's old (relative to other JS stuff) but stable. It's one thing to learn and has all the pieces (model, views, events, router). Plenty of resources online or in paper form.

If you want, try applying some of the ideas of the "modern" tools to Backbone: make a backbone view that has two models - one for data (aka React props) and one for view state (aka React state). Bind both model "change" events to your view's `render` method. It won't have the performance boost of React virtual DOM diffing - but you get some of the other design benefits.

Re: Ask HN: JavaScript framework that I can use “right now”?

#10
post #6

Having worked on a fairly large SPA using Ember.js 1.*, I can tell you that React.js (with Webpack, React Router and something like Redux) would probably be better than Ember (perhaps even Ember 2.0, which is still not fully mature). But if you need something even more stable than React, I'm not sure there is a good option out there. I dislike Angular.js for a number of reasons (which I won't go into here). I've hear…

I liked React ideas it's just that it feels incomplete not to use the entire stack you mentioned. And it's too much for my taste. I'm sure webpack works fine for most people it's just that the possible edge cases with the black box that is the compiled modules files and lack of good documentation makes me lose my sleep. Combined with the alpha state of the rest of the ecosystem is not really an easy choice for a paranoid developer like me. I also faced a lot of small inconveniences because I'm using Vagrant. IIRC there were options like watch-polling that was available as a cli arg but not on the config file. And the usual CORS problems that I had to solve.
Post reply on HN