Live data from Hacker News

React Tutorial: Cloning Yelp

fullstackreact.com

201–210 of 258 posts

Re: React Tutorial: Cloning Yelp

#201

yes, your problem seems to be learning by banging the keyboard like a monkey which you inherited from clicking like a monkey to get a mere sense of how to use something instead of reading some upfront documentation.

Personal attacks are not allowed on HN. We ban accounts for doing this, so please don't do it again. Instead, please (re)-read the site guidelines and comment civilly and substantively, or not at all.

https://news.ycombinator.com/newsguidelines.html

https://news.ycombinator.com/newswelcome.html

We detached this comment from https://news.ycombinator.com/item?id=11781593 and marked it off-topic.

Re: React Tutorial: Cloning Yelp

#202
post #194

Earlier quoted context omitted.

This is how I start off a React app: $ npm install --save react react-dom $ npm install --save-dev webpack webpack-dev-server babel-core babel-preset-es2015 babel-preset-react react-addons-test-utils /webpack.config.js module.exports = { entry: 'src/index.js', output: 'dist/bundle.js', module: { loaders: [{ test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel', query: { presets: ['es2015', 'react'] } }] } } /src/…

Out of curiosity, why did you write the function like this: const MyRootComponent = (props) => { When it's shorter and more obvious what's happening if you write them like this: function MyRootComponent(props) {

"An arrow function expression has a shorter syntax compared to function expressions and lexically binds the this value (does not bind its own this, arguments, super, or new.target). Arrow functions are always anonymous."

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Re: React Tutorial: Cloning Yelp

#203

I've been on the fence for quite a while, but a couple of weeks ago I finally bit the bullet and taught myself webpack, ES6, React, CSS modules, Redux, and everything else that comes along with these tools. It definitely felt like relearning my job (coming from working with Grunt, Backbone and jQuery) and it took a lot of time and effort to really get to understand everything (still learning many new things each day)…

> a couple of weeks ago I finally bit the bullet and taught myself webpack, ES6, React, CSS modules, Redux, and everything else that comes along with these tools Can you share how you did that? Was it a number of different resources you consulted, or is there some all-in-one resource you found?

These resources have been very helpful to me:

http://survivejs.com https://github.com/markerikson/react-redux-links https://github.com/HenrikJoreteg/hjs-webpack

Re: React Tutorial: Cloning Yelp

#204
post #48

I'm no Javascript Boilerplate Fatigue apologist, but there are many comments in here that are treating this as a "Learn how to use React" tutorial. This is not what is advertised nor the stated reason this article was written. From the first sentence: "we get a lot of questions about how to build large applications with React and how to integrate external APIs" Large application strucutre, external integrations...not…

There is a nice tutorial which is about building huge application in Ember.js. Totally free and easy to follow. Check it out. http://yoember.com

Re: React Tutorial: Cloning Yelp

#205
post #145

Earlier quoted context omitted.

> What are you doing with python and go that "just works"? Anything you want. Dependency management is taken care of by a simple `pip install flask`, or a requirements.txt. The rest depends on the packages you are using. > It takes a lot more work to build a yelp clone with python than it does with react. And why do you think that? I could build a simple and performant Yelp clone with full authentication, admin acces…

> Anything you want. Dependency management is taken care of by a simple `pip install flask`, or a requirements.txt. And what if I want to use multiple versions of a given library for my development? Suddenly I'm learning virtualenv...

Or, if you want to use compiled code and have it be installable on multiple OSs, conda

Re: React Tutorial: Cloning Yelp

#207
post #148

I've dealt with many technology stacks. If this is the future, we're F#$$%. Seriously, how can people be blasting older technology like Flash and Flex (which was GREAT), out of the water for not using web standards and then this Frankenstein of a "stack" is going so mainstream. Sure, there is the VM problem, but the language was good and so was the framework. This looks horrendous and scary. Imagine maintaining this…

This isn't mainstream; it's barely behind the bleeding edge. Mainstream is Express, Angular 1.5, and Browserify, and you can have it up and running in five minutes, maybe fifteen if you don't have Node installed.

Re: React Tutorial: Cloning Yelp

#208
post #194

Earlier quoted context omitted.

Out of curiosity, why did you write the function like this: const MyRootComponent = (props) => { When it's shorter and more obvious what's happening if you write them like this: function MyRootComponent(props) {

"An arrow function expression has a shorter syntax compared to function expressions and lexically binds the this value (does not bind its own this, arguments, super, or new.target). Arrow functions are always anonymous." https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

None of which, in this context, matters; none of those is in scope where the function is defined, so it won't be closing over them anyway.

Re: React Tutorial: Cloning Yelp

#209
Not React specific, but how do we tackle SEO for a site like Yelp, where SEO is very important? I want to turn an article-based site into a SPA, so it can consume a stateless API and horizontally scale. But I fear it'd lose a lot of pages in Google.

Re: React Tutorial: Cloning Yelp

#210
post #48

I'm no Javascript Boilerplate Fatigue apologist, but there are many comments in here that are treating this as a "Learn how to use React" tutorial. This is not what is advertised nor the stated reason this article was written. From the first sentence: "we get a lot of questions about how to build large applications with React and how to integrate external APIs" Large application strucutre, external integrations...not…

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 upgra…

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.

Post reply on HN