Live data from Hacker News

Create React Apps with No Configuration

facebook.github.io

231–240 of 250 posts

Re: Create React Apps with No Configuration

#232
post #2

This is actually pretty huge. #1 complaint/barrier/hate with getting started with React is all the tooling to do it "the right way" Kudos to React team for bringing a superior pattern and making it actually practical to use.

I'm really hoping to see the React team make React more user friendly. Maybe an all in one React framework much like Meteor, where you can just do `react createapp myapp` or something and start coding right away.

React is so versatile (raw React, React + Redux, React + Relay, to name a few) I don't think they should tie it too closely to one framework. I would love to see a more official/opinionated framework that uses React, but call it something besides "React".

Ditto for Redux. They're both low-level building blocks that could benefit from some official "opinions".

Re: Create React Apps with No Configuration

#233
post #219
post #216

Earlier quoted context omitted.

One thing though, is that the standard classes are just not up to the job without a lot of stuff tacked on. Eg: the function binding problem pushes people to use class properties, which aren't yet a standard, and then they hit walls with tools that don't support them (eg: I dunno if it's still the case, but for a while class properties caused issues with Flow). createClass might not have been the answer, but on top o…

There was not such thing like ES3 module syntax. This is just programming pattern many people used: https://addyosmani.com/resources/essentialjsdesignpatterns/b... It was a great idea back then, but that was never syntax. This and similar patterns rely on the fact JavaScript is very dynamic and flexible language and enables creating closures and creating objects dynamically. These are very powerful features of langua…

Classes don't do anything about the dynamic nature of JavaScript. They spit out basically the same constructor that everybody was using for pseudo-classes in ES5. You can still do crazy things like manipulate the prototype outside the class, tack extra stuff onto instances after they've been instantiated and so on...

In other words, classes in JavaScript are a poor substitute for static types, and should not be used that way. That's why a lot of React people are using flow, and a lot of Angular people are using TypeScript.

Re: Create React Apps with No Configuration

#234

Earlier quoted context omitted.

React's lifecycle methods and other similar features require some kind of "object instance" to exist. Since React was created prior to ES6, the React team created their own "inheritance"-ish approach, which is something that every JS library out there was doing as well. One of the main arguments for classes being included in the ES6 standard is that it's a common approach that libraries can converge on and use togeth…

Exactly. We don't like classes, but we don't like "pseudo classes" (createClass) even more. Better the devil that's standardized. We already offer a way to create stateless components with just functions. We will keep exploring that space and eventually might have a class-less solution we like that satisfies all our use cases.

I'm all for better solutions for functional components. I hope we go down that road instead of locking in the decision to rely on `class` with things like class decorators and so on.

Several React libraries are already doing that. In spite of all our warnings, people are trying to extend classes for React views, and use `class` in the rest of their code, as well, moving it into the state layer, and modeling their business domains with them instead of using pure functions and Redux.

`class` affords `extends` like balls afford throwing and chairs afford sitting. When you ignore the power of suggestion that comes with the tool affordances, you point users in the direction of trouble.

Sadly, scaling developer education is a lot harder than it seems from inside our ivory towers, surrounded by smart colleagues well-versed in programming wisdom and design patterns.

Re: Create React Apps with No Configuration

#235

This is the most exciting thing to come out of the ReactJS project since it started. The very best investment a technology platform can make is onboarding new developers. ReactJS is recognising that and it's great news that they are making the hardest bit easier. I whined a while back on exactly this topic. "Babel 6 - useless by default - a lesson in how NOT to design software. " http://fourlightyears.blogspot.com/20…

Babel doesn’t get it wrong, it just wants to be a lower level tool. You can (and should) build on top IMO.

Re: Create React Apps with No Configuration

#236

Earlier quoted context omitted.

What’s wrong with using webpack under the hood? The problem is webpack being a lower level tool. This is why we abstract it away from you (and we can swap it for something better if it comes along, but actually webpack is pretty powerful).

We discussed this on Twitter Dan, fyi, no need to rehash here. But they very fact you had to spend time abstracting away WebPack speaks volumes IMO...

Sorry, didn’t realize it was you :-)

>But they very fact you had to spend time abstracting away WebPack speaks volumes IMO...

Speaks volumes about its poor public API. I don’t understand how this this affects create-react-app, really.

But if you can suggest something better that solves the same problems, please do.

Re: Create React Apps with No Configuration

#237
post #124

Earlier quoted context omitted.

I actually use browserify for personal projects. It's ultra simple to get started. My boss insists on using webpack.

If you don't care about the stupid arbitrary bundling system for other assets (like CSS and images) that WebPack has (and you shouldn't: it's an awful code practice) then yes... Browserify is literally better in every way (other than tree shaking)

>If you don't care about the stupid arbitrary bundling system for other assets (like CSS and images) that WebPack has (and you shouldn't: it's an awful code practice)

The “stupid arbitrary” system has a number of benefits. It revs your assets for production automatically with content hashes. It saves you from filename typos because all assets (CSS, images) are part of the same build pipeline. It throws on parse errors in CSS as part of your normal dev flow, not at some later stage. It allows for fast hot reloading of styles in development.

The only downside I’m aware of is that it doesn’t work with some other tools without special plugins or configuration. Well, you have to pick your tradeoffs, right? I’d love to talk about technical tradeoffs of both systems but your comment reads more like a knee-jerk reaction than a technical assessment.

Re: Create React Apps with No Configuration

#238
post #221

Earlier quoted context omitted.

Many people (especially beginners) appreciate automatic updates of their dependencies. If you eject straight away you’ll have to manage them yourself, which is a big turnoff to many.

Could there be some sort of npm feature that incorporates a remote list of dependencies & versions?

Yep, it’s called a “package”. ;-)

Re: Create React Apps with No Configuration

#239
post #179

Earlier quoted context omitted.

And now working for Facebook, one of the most active members of the react team at that.

Facebook created React.

Parent did not say Facebook itself is one of the most active members of the React team. They know Facebook created React.

They say that Dan, at Facebook, is one the most active members of the React team.

Re: Create React Apps with No Configuration

#240
post #221

Earlier quoted context omitted.

Could there be some sort of npm feature that incorporates a remote list of dependencies & versions?

Yep, it’s called a “package”. ;-)

So could whatever create-react-app is delivering be substantially approximated with an npm-based solution?
Post reply on HN