News for hackers. Stuff that matters.
Re:Why Is Front-End Development So Unstable? by _bxg1 on Wednesday May 30, 2018 @05:39PM (#17192096)
At some point, when modules get "micro" enough, the effort of managing them and learning their usage outweighs the effort of implementing the thing yourself. Most JavaScript projects seem to walk that line quite closely.

I'm a React developer at work, but I recently gave Vue a try at home. This is one of the things that most stood out to me about it. React makes a selling point out of the fact that it's "just rendering". It doesn't try to do everything for you, it tries to do one thing really well. That sounds great, but it leaves out a factor. Having your primary framework be "simple" and "lean" doesn't translate to your project being simple and lean, because your project still needs all that other stuff. You just now have to get it from somewhere else, which often adds more complexity than it's worth.

When I downloaded Vue all I had to do was add a script tag to my HTML document and start writing a modern reactive UI. No other modules or frameworks. No build system. No special JS-targeted languages. Vue does everything you need, and it does it all pretty well, and sometimes that's more valuable.

Re:Why Is Front-End Development So Unstable? by philliphaydon on Wednesday May 30, 2018 @11:05PM (#17193647)
I learned React at home, then learned Vue. I fell in love with Vue because i clicked on the getting started, threw a bit of code in a html file, and ran it, and it worked, then I played around and changed things, the moment i ran into something like "oh how do i do this?" the documentation is second to none for client side frameworks, I found what I was looking for quickly.

Then I started to find other stuff like vetur, the vue cli, and I felt like I was just building stuff, and it worked, and I wasn't pulling in other plugins just to get stuff done.

The barrier to entry was much lower IMO.

Just wish I could switch from Angular X to Vue at work :(

Re:Why Is Front-End Development So Unstable? by _bxg1 on Thursday May 31, 2018 @06:19PM (#17200835)
Vue gave me that wonderful jQuery bootstrapping experience, but with a modern data-driven DOM. It's so pleasant.
Re:Why Is Front-End Development So Unstable? by digitalzombie on Thursday May 31, 2018 @02:15AM (#17194309)
Seriously, I feel the same way. I tried Angular1 5 years (?) ago and had to do ember for a gig. They were way too complicated, bloated, and terrible.

Vue just works. One of the book suggest that if you like React JSX you can do it too in VueJS. I've never done React but the thought of mixing javascript with template sounds horrifying. VueJS default template system make sense and it is self contain to a file or component.

Re:Why Is Front-End Development So Unstable? by mlsarecmg on Thursday May 31, 2018 @04:22AM (#17194819)
The view and the presentational code that builds it are one, they belong to the same presentational layer and always have been. To artificially separate them was a major mistake of the old paradigm. Older approaches, like Knockout, Angular, Vue, etc., have to support presentational code as well, and obviously it is mixed into your html, but in a way that is severely limited and causes complications. Think of it, to be able to do your v-if, v-for, v-else, etc. an entire templating language had to be built, your view isn't part of the scope that that can access the data-model, so dependency injection had to be utilized, components in that model aren't components but directives that have to be registered to re-use one another. The complexity is actually mind-boggling.

These are the exact reasons why React came about - it removes that complexity entirely. It is tiring having to learn frameworks and arbitrary extensions, googling for framework-specific solutions for every trouble that surfaces.

Re:Why Is Front-End Development So Unstable? by hajile on Thursday May 31, 2018 @11:54AM (#17197256)
My small goto has been preact with director plus a small custom redux implementation (which contains thunk, action arrays, event emitter, etc). At less than 5KB zipped, it's amazing how well it performs.

If absolutely simple is the goal, maybe hyperapp?

Re:Why Is Front-End Development So Unstable? by freetonik on Thursday May 31, 2018 @02:05AM (#17194281)
If I remember correctly, first versions of React were similar in that respect: you could just add a script tag to your page and you that’s it (save for the mount-point thing).
Re:Why Is Front-End Development So Unstable? by wiennat on Thursday May 31, 2018 @05:26AM (#17195056)
You still can do the same with the current version.
Re:Why Is Front-End Development So Unstable? by _bxg1 on Thursday May 31, 2018 @06:23PM (#17200856)
Technically. But

1) Your "templates" look like this:

  React.createElement(
    "div",
    null,
    React.createElement(MyComponent, null),
    React.createElement(
      "ul",
      null,
      React.createElement(
        "li",
        null,
        "Thing 1"
      ),
      React.createElement(
        "li",
        null,
        "Thing 2"
      ),
      React.createElement(
        "li",
        null,
        "Thing 3"
      )
    )
  )
2) Since things like decent state management don't come in the box, you're almost forced to start including other modules, which pushes you back towards a build system.
Re:Why Is Front-End Development So Unstable? by sayword on Thursday May 31, 2018 @12:59AM (#17194063)
The script tag approach is nice and lowers the threshold for the curious, but looking back, I'd recommend starting with vue-cli right away, because as your app grows you'll run into limitations of that setup, esp. with more advanced babel features, runtime transforms, ... The warning about using the cli in the vue docs is imo a bit exaggerated, you get some nice prompts and an equally smooth experience :)
Re:Why Is Front-End Development So Unstable? by andrewingram on Thursday May 31, 2018 @05:40AM (#17195103)
I'd use a decent React-based framework. My issue with Vue is that I disagree with some of the design choices.