Hacker News new | ask | show | jobs
by jnbiche 2308 days ago
> though now we use Vue.js instead of jQuery

You realize Vue.js is fundamentally an SPA framework, right? It's got built-in router, state management, etc. In frontend dev, those are all things that are only SPAs really need.

To people "suspicious" of SPAs: are you suspicious of Gmail? Slack? Those are typical use-cases of SPAs. What you're actually suspicious about are ill-informed devs building SPAs when they should be using simple static websites, or server-side includes, or simple progressive enhancement in vanilla JS. But none of those options are practical if you want to build something like Slack, GMail, or Google Docs, or any of the myriad other desktop app replacements we find now on the browser.

All the said, I agree that Laraval looks like an attractive framework. I haven't had the chance to work in it professionally, and probably never will, but it looks solid and with the improvements PHP is making as a language, probably would be totally tolerable and perhaps even enjoyable to work in.

EDIT: Ok, the router and state management are official, but not built-in. Fair enough. I've not used VueJS professionally before (only React, AngularJS, Backbone, and custom frameworks before them) but it's one of the appealing things about VueJS compared to React, which seems to be its major competitor presently.

2 comments

Vue has an official router, but it's not built in and usually something like Vuex is used for state management. I'd certainly agree Vue is oriented towards SPAs, but that's not all it does.
Vue is much more 'batteries included' than React, while also being incrementally adoptable. IMO this is why it's popular with the jQuery crowd.
> IMO this is why it's popular with the jQuery crowd.

I had no idea. I've only used React, Angular, Backbone, and custom frameworks at work (mostly React in recent years), but I like what I've seen of VueJS because of its "batteries included approach" (which is React's weak point, although they seem in some ways to be moving toward being a full framework).

VueJS seems about as different from jQuery as you could get. I mean, it's even got a virtual DOM.

The closest thing you could get to jQuery? Modern, vanilla JS, whose recent APIs were often inspired by jQuery. But the jQuery crowd vehemently rejects that option because their idea of vanilla JS is stuck in the year 2010.

The reason why Vue works well for jQuery devs it’s because it allows you to continue doing what you’ve always done: server render then enhance on the client. Vue does this beautifully by accepting rendered HTML as its template. This means you can augment regular HTML and get the benefits of React without transpiration of JSX, nor the cumbersome nature of string templates in script tags. That’s where the jQuery comparison comes from, and it’s one of the major reasons for Vue’s success in that crowd. It’s a feature that doesn’t seem to get enough attention from/is often overlooked by those in the know because usually those people are writing SPAs.