Live data from Hacker News

React v15.5.0

facebook.github.io

91–100 of 209 posts

Re: React v15.5.0

#91
post #25

This is a big deal to deprecate `createClass` and `propTypes`. PropTypes' deprecation is not difficult to handle, but the removal of createClass means one of two things for library maintainers: (1). They'll depend on the `create-class` shim package, or, (2). They must now depend on an entire babel toolchain to ensure that their classes can run in ES5 environments, which is the de-facto environment that npm modules ex…

I agree, I am really concerned about this change. But unfortunatly I do not think my feedback via twitter was well taken: https://twitter.com/wesleytodd/status/850550711804989440

EDIT: I should add, that I didn't want to say that I completely disagree with the change to remvoe this api entirely on twitter to the maintainers. I am sure they get enough crap from people.

Re: React v15.5.0

#92
post #36

Earlier quoted context omitted.

Yeah, in the beggining there wasn't autobinding, if you remember well. Then comes autobinding, now there's no autobinding anymore.

Yeah I still use `React.createClass({})` because... autobinding. Also wish someone would explain the draw of ES6 classes. React is about composition, not inheritance. Have never seen a `React.Component` extended.

I've seen one. It is the horror, the horror.

Re: React v15.5.0

#93
post #36

Earlier quoted context omitted.

Yeah, in the beggining there wasn't autobinding, if you remember well. Then comes autobinding, now there's no autobinding anymore.

Yeah I still use `React.createClass({})` because... autobinding. Also wish someone would explain the draw of ES6 classes. React is about composition, not inheritance. Have never seen a `React.Component` extended.

See my comment downthread regarding intended use of React.Component: https://news.ycombinator.com/item?id=14065106 .

Re: React v15.5.0

#94
post #44
post #35

Earlier quoted context omitted.

Are you afraid of Babel monopoly? I recommend trying https://buble.surge.sh/ . My life is much better after I started using Buble and bubleify instead of this mess that is Babel.

Come on. Buble is Babel, just with a few presets hardcoded. Yeah, it's better usability, until you need to run a production application.

Oh is it? They deceived me!

Re: React v15.5.0

#95

Earlier quoted context omitted.

Mild rant: I'm not convinced ES6 classes are better than components created the old way. First, the lack of autobinding callback functions for child props is not ideal. I don't even have to think about it with createClass, and it requires at least one extra step with ES6. It's less convenient. Second, I don't think HOCs are necessarily easier to reason about than mixins in many situations. React is already quite defi…

If you don't want to think about binding, just use the arrow function syntax: class Foo extends Component { bar = () => { // ... } }

Requires the Stage 2 Class Properties syntax to be enabled (via Babel plugin), but yes, that's the "nicest" way to do it, and the current approach recommended by the React team. There's also various binding utilities, like https://github.com/cassiozen/React-autobind . I've got discussion of the various binding approaches listed at https://github.com/markerikson/react-redux-links/blob/master... .

Re: React v15.5.0

#97
post #26

Earlier quoted context omitted.

I was in awe the entire time Lin was speaking. Not a single "um" or other verbal tic; she's an incredible speaker and was admirably lucid throughout that entire talk. That's so difficult to do. And style aside, she made understanding Fiber incredibly simple. Just wanted to express my admiration for her work and gratitude for making this information public, available, and free.

I dunno if verbal tics are necessarily the metric to use for great presentations. I know some folks who stumble constantly but present ideas that are pretty incredible. Some people just have amazing recall and can fluidly spew out facts and conclusions. Some people can present compelling ideas they have thought of that no one else but struggle on the vocalization.

Yeah and some people use them to their advantage. For instance, notice that President Obama uses "umms" to ensure that he's never not making a sound. Makes it harder for an interlocutor to interrupt.

Re: React v15.5.0

#98

Earlier quoted context omitted.

Mild rant: I'm not convinced ES6 classes are better than components created the old way. First, the lack of autobinding callback functions for child props is not ideal. I don't even have to think about it with createClass, and it requires at least one extra step with ES6. It's less convenient. Second, I don't think HOCs are necessarily easier to reason about than mixins in many situations. React is already quite defi…

If you don't want to think about binding, just use the arrow function syntax: class Foo extends Component { bar = () => { // ... } }

I use and recommend this syntax, but you do have to have babel-preset-stage-2 to enable the class properties transform.

https://babeljs.io/docs/plugins/transform-class-properties/

Re: React v15.5.0

#99

Earlier quoted context omitted.

There's nothing wrong with classes, they're just not right for JavaScript. I'm not going to claim that I'm a JS expert or anything, this is just something I've learned from pretty well established JS experts like Kyle Simpson and Douglas Crockford. The reasons they give are that 1) you should favor composition and delegation over classical inheritance 2) classes keep you from using and understanding closure and other…

It's worth noting that the React team promotes composition over inheritance, and discourages any levels of inheritance past `class MyComponent extends React.Component`. Long term, the React team plans to investigate concepts like "stateful functional components", but until then, classes are the most straightforward way of having lifecycles. The existence of ES6 classes is based on the wide range of third-party "class…

> but until then, classes are the most straightforward way of having lifecycles.

Huh? Why? React.createClass({}) is/was pretty straightforward. What is more straightforward about classes? All I see is more code.

Re: React v15.5.0

#100
post #26

For those who are interested in some of the details of the work that's going on, Lin Clark's recent talk on "A Cartoon Intro to Fiber" at ReactConf 2017 is excellent [0]. There's a number of other existing writeups and resources on how Fiber works [1] as well. The roadmap for 15.5 and 16.0 migration is at [2], and the follow-up issue discussing the plan for the "addons" packages is at [3]. I'll also toss out my usual…

I was in awe the entire time Lin was speaking. Not a single "um" or other verbal tic; she's an incredible speaker and was admirably lucid throughout that entire talk. That's so difficult to do. And style aside, she made understanding Fiber incredibly simple. Just wanted to express my admiration for her work and gratitude for making this information public, available, and free.

As someone who talks quite (very?) fast and has to carefully slow down for public speaking...

... I found Lin's style of speaking very difficult to listen to. I appreciate the professionalism of the approach (if that's what it is), but if only by a small margin (perhaps 10-20%), I found her speaking too slow to the point that I wanted to skip forward constantly and would have found it difficult to pay attention to in person. :/

Perhaps this might be about the structuring of information as well (I'm familiar with much of what's being talked about). That said however, I've historically found that when listening to really good speakers, I find it easy to sit and have explained to me things that I already know well - so I'm not sure what's happening here.

Post reply on HN