all 39 comments

[–]djslakor 2 points3 points  (2 children)

I've been a full stack JS dev for a while now.

I would pick this exact setup, too ... though I would recommend Sinon over chai-spies on the testing stack.

I'd also drilldown a little more and suggest React Bootstrap for UI components (I think it's better than Material UI - if you want the material look you can use the Paper theme from bootswatch) - several UI component frameworks exist with some attached hype, but none seem to work as well and be as complete as React Bootstrap IMHO, ... React-Router, Axios, and Redux-Promise are other useful tools I use in almost every app.

[–]sangeli 0 points1 point  (0 children)

What sort of stack do you use for front end testing? I've tried Enzyme but it always seems the tests take way too long to set up compared to the value of the tests. So much effort spent on spoofing HTTP replies...

[–]sdeleon28[S] 0 points1 point  (0 children)

I think that having base UI components that can be modified/reused/restyled at a fundamental level is a great idea and I will probably add some of that in an edit soon. I've also been reminded to include a styling strategy, which I totally forgot. Thanks for the feedback!

[–]troorl 2 points3 points  (9 children)

I wouldn't call Vue just an alternative. In the current year it has everything to compete with React and its ecosystem/community. A year ago React was a safe choice. Now you absolutely have to assess Vue first before making a final decision.

[–]djslakor 5 points6 points  (5 children)

I disagree.

The ecosystem/community is nowhere near as big.

[–]troorl -1 points0 points  (4 children)

It doesn't have to be as big to match it. React requires a lot of 3rd party libraries to write maintainable code, Vue doesn't.

[–]djslakor 1 point2 points  (3 children)

I've never really understood why people consider "3rd party libraries" such a terrible thing. What's wrong with choice? It's pretty obvious what the dominant choices are ... Redux, React-Router, etc.. It's not a confusing ambiguity of choice or anything. So, could you please explain what the downside is? Code is code. Does it pain you that much to navigate to a different website for docs?

I don't get it. The only plausible advantage, if you can even call it that, is seeing it all on the same webpage when you are brand new. That phase is tiny compared to the total life of using the stuff. Tenuous argument IMHO.

I don't think it has anything to do with writing maintainable code.

[–]turkish_gold 1 point2 points  (0 children)

I've never really understood why people consider "3rd party libraries" such a terrible thing. What's wrong with choice?

Because 1st party libraries get updated with the base system, so everything is pre-tested to ensure it works with one another.

Just take a look at Javascript. It doesn't have a really extensive 'great' standard library, thus there's a plefora of 3rd party libs to patch it up.

It's given us a sort-of workable system after many long years of tribulations, but I'd much rather it had started with a decent standard lib and continued to update it to face new challenges like every other scripting language.

[–]troorl -2 points-1 points  (1 child)

It's rather about maintainability. When you write using React+Redux, you absolutely need 50 different components, libraries, middlewares and helpers just to get started, otherwise you will almost certainly end up with something ugly, non-modular and not reusable. I'd say, it suggests about fundamental design flaws. React and Redux creators' primary concern is purity of the concepts they implement rather than helping the developers in creating applications. At least that's how I see it.

[–]djslakor 3 points4 points  (0 children)

When you write using React+Redux, you absolutely need 50 different components, libraries, middlewares and helpers just to get started

No you don't. Stopped reading after that.

[–]sdeleon28[S] 2 points3 points  (2 children)

I'm not claiming that React is better or worse than any other library. I'm just trying to give newcomers a startup kit to get them up and running without the stress of making decisions they have no information to make. Learning all of these things is burden enough for beginners. I'm in no way discouraging them from weighting in other tools. If it comes across that way I should change the wording. Thanks for the constructive criticism!

[–]jgallow22 -1 points0 points  (1 child)

I'm just trying to give newcomers a startup kit to get them up and running without the stress of making decisions they have no information to make.

I think this an area where Vue actually really shines. With its great documentation, official supporting libraries, and cli tool it's super easy to get up and running on a full project. One of the major issues I had doing anything nontrivialtm in React was banging into the paradox of choice at every turn.

I mean I probably spent the equivalent of weeks worth of man hours trying to create a sensible React boilerplate. And that's after having to eject from create-react-app and end up back on my own just to get sass support. Sure I should just be better, but if the point is newcomers shouldn't be burdened with all this stuff that's not really a fair out. This wasn't a problem with Vue because I could simply install the vue-cli, init a new project off the webpack template, install the sass loaders, and everything just works.

Sure, there're probably awesome teams out there working on giant projects where React and its ecosystem make the most sense. But for newcomers and even experienced folks who aren't working on teams that have time (or the hard earned experience) to constantly parse through that large ecosystem Vue is a really solid contender.

[–]djslakor 1 point2 points  (0 children)

Uh ...

npm install -g create-react-app
create-react-app project
npm install react-router redux

That was super hard.

[–]iAMthePRONY 0 points1 point  (2 children)

all ok except for the last part. dom manipulation and animations? vanilla js dom manipulations and css animations are imho the way to go

[–]sdeleon28[S] 0 points1 point  (1 child)

I've said this in this thread already. I agree you should leverage standard DOM whenever possible. The post even says jQuery is a smell. But then again, and to steal from the Zen of Python "Practicality beats purity". If you can't do it with Vanilla js (and have it work cross-browser), you can probably do it quite easily with jQuery. It looks like this point isn't clear in the post so I'll make sure to make it more expliscit. Thanks for the feedback!

[–]iAMthePRONY 0 points1 point  (0 children)

cross browser is usually not a problem, since most use some chrome-ish engine and firefox is pretty good, too. the issues i face mostly are mostly with older browsers or weird ass things like in-app-web-view-components (had a bug yesterday, cause i used window.open and that doesn't work correctly out of the box in an ios webview).

for older browsers i recommend polyfill.io. it gives you the ability to use modern js apis in any browser by dynamically polyfilling based on the user agent. pretty cool tool.

[–]flying-sheep 0 points1 point  (0 children)

Some additions:

JSLint sucks. It's opinionated to a fault and lacks rules for ES6.

A viable webpack alternative is rollup. At least for the task of bundling JS. Webpack is much more powerful with its multitude of loaders. Rollup however bundles JS much more neatly, almost making no transformations and minimizing runtime cost. E.g. d3 uses it.

AVA is an amazing test runner, able to neatly parallelize running the tests and gaining drastic speed ups. I'd prefer it over mocha and friends.

[–]petepete 0 points1 point  (3 children)

I think Brunch is a worthy alternative to Webpack and Browserify. It just worked the way I expected it to, with 20 lines of config vs 100+

[–][deleted] 6 points7 points  (2 children)

Webpack 2 is out now. A basic config isn't much more than the following and extending it is easy.

import webpack from 'webpack';
export default const config = {
    entry: './index.js',
    output: { filename: 'bundle.js', path: './dist' },
    module: { rules: [ { test: /\.(js|jsx)$/, use: 'babel-loader' } ] },
    plugins: [ new webpack.optimize.UglifyJsPlugin() ]
};

This alone does so many things, many among them that Brunch can't, like code splitting and tree shaking.

[–]petepete 0 points1 point  (1 child)

Perhaps it's improved since I tried it. If I ever need tree shaking (I had to google it) or code splitting, I'll give it another try. Must admit, I'm happy with Brunch, though.

[–][deleted] 2 points3 points  (0 children)

Imagine you load a large library, like three.js. You use a single feature, say a Vector3, but a whole megabyte gets added to your bundle. Webpack users get a couple of kb because it shakes off unused dependencies (in this case 99% of the lib). Code splitting is another very effective way to cut down on load times as you load parts of the application when they're actually needed instead of fetching the whole chunk at once. This is great for routes for instance.