News for hackers. Stuff that matters.
Re:React Tutorial: Cloning Yelp by jimmytucson on Thursday May 26, 2016 @04:08PM (#11781079)
Sorry, but even the “Getting Started” guide on React's website requires that you have a "CommonJS module system" installed which, if you don't, means you have to make an intelligent choice between Browserify and webpack, which means you have to do some minimal research into what those are (and probably research "babel-js", while you're at it), install one of them using npm, which may require that you install or upgrade node.js which, if you're on a Mac, may require that you install homebrew, which can sometimes open another, deeper can of worms...

And that's just to get your tool chain in place. When you actually get into the tutorial, it starts with "Running a server". Running a server?

I submit that writing even basic, toy applications in React requires a trip to dependency hell and back, unless you already use these tools on a regular basis and keep up with the ever-rapidly-changing debate around build scripts, dependency managers, language preprocessors, etcetera, etcetera.

Re:React Tutorial: Cloning Yelp by tracker1 on Thursday May 26, 2016 @06:35PM (#11782234)
By the same note, you likely won't be writing a complex desktop application without some tooling installed, with similar pre-requisites. I don't know why people get so irritated at "JS tooling is hard". Try writing an (INSERT FRAMEWORK HERE) app outside the browser.

People assume that writing an APPLICATION for a browser is easy, which is why people get stuck maintaining monstrosities that are disorganized, not composed and tens of thousands of lines of spaghetti. Writing an application in the browser deserves just as much respect as one would give towards setting up the database & schema or creating a service layer.

That lack of respect for front end code is a big reason as to why front end projects have crappy code. React is a real break from this on so many levels... Yes, you'll need (webpack|jspm|browserify) with (babel|typescript), and likely (postcss|less|scss) in place closer to the start than the end. Much like if you're writing code for a desktop application you'll likely need at least an IDE installed, and potentially several libraries close to the start.

My current tooling of choice is webpack + babel, depending on the project I may bring in scss or less, and react tooling as needed. Using CSJ or ES6 style module syntax means cleaner code that's easier to restructure. Using webpack means being able to bundle resources in a logical flow. Working on a project without webpack + babel is just painful by comparison... I'm working on an ng1 app at work that's less than 6 months old, and feels like it was written in 2011... having to add .js files to some common point, and not being able to easily refactor services/controllers/directives/components into discrete modules is pretty painful in general.

What does it take to get a Java application going? Maven, some build system, some other tooling, and understanding the component/class hierarchies? It's not any easier than working with any new tooling.

Is there some churn, yes... is it that bad, not really... going to browserify mainly means that you can have references from a starting point into your application's code... each piece requires in its' dependencies. From there going to webpack adds in other dependencies and custom loaders. Babel is a translation layer... these tools generally build on or are supersets of the tools that came before.

Re:React Tutorial: Cloning Yelp by intrasight on Thursday May 26, 2016 @10:38PM (#11783506)
There is much less tooling and much less churn even for a very complex Java application
Re:React Tutorial: Cloning Yelp by Chyzwar on Friday May 27, 2016 @10:28AM (#11786257)
When I see people in other teams fighting with Maven, Jenkins builds for weeks somehow I cannot believe this.
Re:React Tutorial: Cloning Yelp by intrasight on Friday May 27, 2016 @12:22PM (#11787029)
I didn't say that Maven wasn't complex. I said there are fewer tools and less churn. The advantage of Java dev is that you can justify the intellectual investment in the tools because there are fewer of them and they are going to be around for a long time. The same cannot be said about client-side development at this time.
Re:React Tutorial: Cloning Yelp by tracker1 on Friday May 27, 2016 @03:06PM (#11788172)
Grunt still exists, npm has been a common point for close to half a decade now... it's pretty solid... everything else builds from there. If you've gotten used to npm and cjs modules, that's been very consistent for a number of years now.
Re:React Tutorial: Cloning Yelp by Drdrdrq on Friday May 27, 2016 @05:36PM (#11789219)
Would you use Grunt for new projects? Maven is still being actively used.
Re:React Tutorial: Cloning Yelp by rapind on Friday May 27, 2016 @08:07PM (#11789960)
I thought Gradle was the new Maven. Before Maven it was Ant. There's even Buildr (though not as popular).
Re:React Tutorial: Cloning Yelp by IshKebab on Friday May 27, 2016 @09:46AM (#11785968)
> you likely won't be writing a complex desktop application without some tooling installed

With C++ I can just download Visual Studio, or the Qt SDK. No other dependencies.

With Go, I download Go (a single installer) and also my Go IDE of choice - LiteIDE (a single zip).

I don't have to install an installer installer or any nonsense like that.

Re:React Tutorial: Cloning Yelp by tracker1 on Friday May 27, 2016 @03:07PM (#11788179)
And go doesn't have a package manager? It doesn't need any other modules to create gui apps? Aren't there wrapper bindings that would be simpler than direct api calls?
Re:React Tutorial: Cloning Yelp by Drdrdrq on Friday May 27, 2016 @05:46PM (#11789280)
Speaking for myself, I have used many platforms ranging from embedded to desktop and I also proud myself to be a competent old skool web developer - one who has avoided node.js, angular, amber and similar. React caught my attention and I tried to learn using it... What pain! What parent is saying about tooling is totally true. But maybe I just missed a simple hello world tutorial... I will check it out in a year or so, if it's still around by then.
Re:React Tutorial: Cloning Yelp by acemarke on Sunday May 29, 2016 @03:16PM (#11797787)
Got a whole bunch of tutorials listed in my React/Redux links repo, at https://github.com/markerikson/react-redux-links. If you're looking for a couple that are really simple and involve no other tools or libraries, you may be interested in http://jamesknelson.com/learn-raw-react-no-jsx-flux-es6-webp... or https://github.com/kay-is/react-from-zero.
Re:React Tutorial: Cloning Yelp by Drdrdrq on Sunday May 29, 2016 @03:25PM (#11797824)
Thanks, appreciate it! I will save the links for the next time I go exploring React (which should be soon).
Re:React Tutorial: Cloning Yelp by spinlock on Friday May 27, 2016 @12:50PM (#11787241)
This is why I like Ember: you get setup in 2 seconds. Sure, I don't like all of the decisions they've made in the framework but it does work really well out of the box.

I think having a cli will become standard for JS frameworks. You just need to have the batteries included to capture the newb mindshare.

Re:React Tutorial: Cloning Yelp by knite on Friday May 27, 2016 @04:33PM (#11788783)
I've recently started looking into Ember - which of their framework decisions do you dislike?
Re:React Tutorial: Cloning Yelp by spinlock on Friday May 27, 2016 @06:20PM (#11789448)
I prefer mocha to qunit and I'm a fan of coffeescript (ES6 can wait. I love the existential operator). My company had made a few decisions before ember-cli that weren't on the Ember Happy Path. I've tried to stick to those decisions to avoid making people learn a different stack. It's not that easy to rip and replace pieces of Ember.
Re:React Tutorial: Cloning Yelp by spicyj on Thursday May 26, 2016 @06:07PM (#11782070)
I'm having trouble understanding your comment.

Neither the homepage, Getting Started, the tutorial, nor the downloads page mentions CommonJS. If you do choose to use browserify or webpack, you'll want Node and npm, but Node's homepage doesn't suggest using Homebrew so I'm not sure why that would be necessary. (Besides, in my experience, most programmers using a Mac have Homebrew already.)

> When you actually get into the tutorial, it starts with "Running a server". Running a server?

We included this as a sample because most people write clients against an app server so we thought it instructive to show how to fetch and post data via AJAX. Nothing about it is inherent to React and people make React apps without any server component all the time. It sounds like this was misleading to you, which is good feedback for us. I was thinking about revamping the tutorial soon anyway and my new example wasn't going to have any server component.

Re:React Tutorial: Cloning Yelp by jimmytucson on Friday May 27, 2016 @12:22AM (#11783890)
My comment was based on notes I took from a little over a month ago, when the Getting Started guide said "We recommend using React with a CommonJS module system like browserify or webpack."

https://web.archive.org/web/20160411175140/https://facebook....

Re:React Tutorial: Cloning Yelp by spicyj on Friday May 27, 2016 @12:30AM (#11783915)
Ah, indeed. Looks like we tried to simplify it recently:

https://github.com/facebook/react/pull/6148

Re:React Tutorial: Cloning Yelp by swanson on Thursday May 26, 2016 @04:35PM (#11781336)
I'm looking here: https://facebook.github.io/react/docs/getting-started.html

And seeing a JSFiddle link that is fully configured to work and zip file that includes all necessary files.

What am I missing?

Re:React Tutorial: Cloning Yelp by EdwardDiego on Friday May 27, 2016 @12:07AM (#11783849)
A generalised hatred for the JS ecosystem, I believe.
Re:React Tutorial: Cloning Yelp by joesb on Friday May 27, 2016 @06:43AM (#11785087)
the first line of HTML code in that Fiddle link is: https://facebook.github.io/react/js/jsfiddle-integration-bab...

What you are missing is that you probably don't want to develop by putting your code in JSFiddle.

Re:React Tutorial: Cloning Yelp by bigpeopleareold on Friday May 27, 2016 @06:33AM (#11785057)
A decent toolchain of various libraries and build tools is an opportunity to avoid bigger problems and nasty, subtle bugs when you are working on large codebases. I continue to have my share of them, which tend to be in areas of the codebases I worked on that is principally jquery spaghetti or undisciplined Backbone code.

I'd rather deal with the dependency hell; that's an opportunity cost. I'd rather deal with my current toolchain than having to tell stakeholders that a particular aspect of bad code is beyond repair and needs to be replaced badly, at the cost of a large time sink.

Re:React Tutorial: Cloning Yelp by eagsalazar2 on Thursday May 26, 2016 @04:55PM (#11781518)
Submission largely accepted but you aren't making a real point with what you've submitted. I say "largely" because I agree with gp that 2 hours is hardly hell for a larger project but agreed that is pointless for basic/toy applications. This isn't really a solid indictment against React and webpack however. If you are really making a tiny/toy app, and not doing so for educational reasons, then yeah probably you should just use jquery and edit js/html/css (vs ES6/JSX or Jade/SASS + redux, testing, etc, etc which is not trivial).
Re:React Tutorial: Cloning Yelp by wmil on Thursday May 26, 2016 @04:44PM (#11781406)
Yeoman.io is supposed to solve the 'getting started' problem. But the quality of generators varies wildly, so it's hard to recommend.

You could probably build a tutorial around generator-react-webpack-redux.

Re:React Tutorial: Cloning Yelp by stylesuxx on Saturday May 28, 2016 @08:31AM (#11791405)
I would very much appreciate this. Pull requests are welcome. I have been working on some examples, but did not have the time to refine them yet.

Started to implement the Todo App in this branch => https://github.com/stylesuxx/generator-react-webpack-redux/t...

Re:React Tutorial: Cloning Yelp by leoalves on Thursday May 26, 2016 @05:24PM (#11781753)
react-cli is pretty good
Re:React Tutorial: Cloning Yelp by foota on Thursday May 26, 2016 @04:13PM (#11781127)
Any language or environment has it's hoops that you have to jump through in order to use it, in some cases these happen to be installed for you so it's less noticeable.