Live data from Hacker News

Create React Apps with No Configuration

facebook.github.io

191–200 of 250 posts

Re: Create React Apps with No Configuration

#191

Earlier quoted context omitted.

2 years ago is decades in the front-end world. If we make decisions today based on the state of things years ago, we'd be screwed.

And yet nothing much changed in the needs of webapps or in the Javascript language in the past two years. And if we CAN'T "make decisions today based on the state of things years ago", then we're really screwed.

> And yet nothing much changed in the needs of webapps or in the Javascript language in the past two years.

But Ember has likely come a long way in that time - I think this is mcardleliam's point.

Re: Create React Apps with No Configuration

#192
So I was looking through the modules in react-scripts module and I noticed postCSS, HMR is activated (I tested this myself). I also installed react-router with ease and it appears to work just fine. So far so good from where I'm sitting. I was able to start coding right away while I was half assed looking through the modules to see what is actually in there and just play while I talked with my roommates. It took me all of 10 minutes.

Re: Create React Apps with No Configuration

#193
post #57

Earlier quoted context omitted.

Kind of interesting to think about the two projects and how they diverge based on the core developers. Ember is made by folks who work on / for small and medium companies[1]. They don't have the build infrastructure Facebook does and are able to create an anointed solution in Ember-CLI because they'll use it daily. React is stuck in a place where the environment it's developed in is unique from what any other user wi…

The idea that Ember is made by/for small and medium sized companies is a bit dated. Several Ember and Ember-CLI core contributors have and continue to work at larger companies like LinkedIn and Yahoo. In particular, LinkedIn has been using Ember (with Ember-CLI) for over a year now and has found a lot of benefits from its adoption. Having a build system and conventions that a community maintains lets us focus on buil…

For anyone else curious about Ember Engines, I found the RFC provided a good explantion of the what and why:

https://github.com/tomdale/rfcs/blob/master/active/0000-engi...

Re: Create React Apps with No Configuration

#194

Earlier quoted context omitted.

>However I do wish the React team would pick between ES6 classes and `React.createClass` We’re going with ES6 classes. Expect createClass() to go into another package some time this year. (Obviously we’ll provide an automated “codemod” utility to convert your existing code.)

Please say it isn't so! Class is terrible syntactic sugar to please old Java programmers. I'd be really interested in why this decision would be made. Im just getting going in React and am looking to make a move away from Angular, because Angular 2 is so hyper focused on classes and decorators. I like React because it's closer on the purity scale to something like Cycle.js. But nevermind me, React is a great tool, an…

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 together, rather than every library inventing their own version of inheritance.

Since ES6+ is now the actual Javascript language standard, it makes sense for React to move away from their homegrown class definition approach, and build on top of the approach that is now standardized in the language. The React community has already eagerly adopted ES6, and while React.createClass() isn't going to be deleted any time soon, it's time to start encouraging people to move away from using it.

Either way, though, React's API _does_ depend on having something "class"-like available.

Re: Create React Apps with No Configuration

#195

Earlier quoted context omitted.

Having used Ember and React, this was my experience too. Ember lets you get up and running really fast. However, once you start doing anything outside of something it doesn't have an opinion about, you're stuck working around the framework. Good luck with that. At the end of last summer we started to make the migration from Ember to React, and we removed the last Ember code from our code base in April of this year. I…

> I'd rather write code to solve all my problems than have a solution that solves 90% of my problems out of the box but then makes solving the remaining 10% a hacky, unpredictable process. So are you saying that, absent a better framework than Ember, you would have recommended migrating to no framework at all?

No, when I say "I'd rather write code to solve all my problems" I'm talking about React. In React, things happen because you call a function, not because you named something the name that makes them get called, with only a handful of exceptions. You want to change the state, you call `setState`, you want to render the component you call `renderComponent`. It all looks surprisingly like writing code with a very helpful library.

Re: Create React Apps with No Configuration

#196

Earlier quoted context omitted.

Lol. No, I still fully agree. We think React is a tool to create great UIs, and UIs definitely include concerns like data fetching, etc. So some of this might make it into React in some form in the future.

In the meantime, you can also try out the official Flux library from Facebook ( https://github.com/facebook/flux ), or Redux ( https://github.com/reactjs/redux ), which offer great solutions for data manipulation and storage

Who wants to tell him Dan wrote Redux?

Re: Create React Apps with No Configuration

#198

Sane defaults and pieces made to go together are critical to lowering the adoption barrier and building a community, so huge props for that. But no ability to configure anything at all? I think that for most people, at some point there will be some small change to the default configuration their environment will require[1], and that means they'll need to jettison the entire project. It's nice that this is easy to do,…

https://facebook.github.io/react/blog/2016/07/22/create-apps... > “Ejecting” lets you leave the comfort of Create React App setup at any time. You run a single command, and all the build dependencies, configs, and scripts are moved right into your project. At this point you can customize everything you want, but effectively you are forking our configuration and going your own way. If you’re experienced with build too…

I just published a similar tool:

    > npm install -g react-app-tools
    > react-app new
    > react-app start
The idea is to have no configs (though you will be able to configure anything if needed) and a bare minimum package.json:

    {
      "private": true,
      "dependencies": {
        "react-app": "^1.0.0",
      },
      "devDependencies": {
        "react-app-tools": "^1.0.0",
      },
      "scripts": {
        "build": "react-app build",
        "start": "react-app start",
      }
    }

Re: Create React Apps with No Configuration

#200
post #57

Earlier quoted context omitted.

Kind of interesting to think about the two projects and how they diverge based on the core developers. Ember is made by folks who work on / for small and medium companies[1]. They don't have the build infrastructure Facebook does and are able to create an anointed solution in Ember-CLI because they'll use it daily. React is stuck in a place where the environment it's developed in is unique from what any other user wi…

> There's no official path from view layer -> complete app (no guidance for data flow, how to communicate with the server, server side rendering, routing on the client). Every time I've decided to take an afternoon to poke at React this is where I've given up. I totally understand the model and appreciate how useful it can be but I've never been clear about how to actually hook it up to a backend that isn't just the…

It seems like an afternoon is an awfully short time to allot to try a new framework / approach. I have definitely found lots in the Frontend world extremely frustrating at first given there are so many ways to do something, but it eventually clicks and makes sense.
Post reply on HN