Live data from Hacker News

React v15.5.0

facebook.github.io

191–200 of 209 posts

Re: React v15.5.0

#191

Earlier quoted context omitted.

ES6 classes are a complete mess brought by corporate people loving OO, even in a setting that doesn't make sense. You can "autobind" with this notation: myMethod = () => { } but it doesn't look as good as myMethod() {} and you have to remember this EVERY TIME you add a method. Also, you never need to use the constructor in React. Just do: state = {} in the body of the class. You may need babel presets #918718$$&ééàdi…

Classes and inheritance are features of type systems, not OOP. Plenty of functional programming JS libraries use classes for testing types (for example, the Either monads' Left and Right).

Classes and class inheritance are features of class-based systems, yes.

Prototypes and prototype inheritance are features of prototype based systems.

Re: React v15.5.0

#192

Earlier quoted context omitted.

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

This compiles poorly and has a performance cost, it turns out. Doing: constructor(props) { super(props); this.func = this.func.bind(this); } Is better if you care about performance.

Just curious: are there tests proving this?

Re: React v15.5.0

#193

Earlier quoted context omitted.

Chrome, Firefox, Edge, Safari and Opera all support ES6. That's the current version of all major browsers. No, it isn't. For a lot of web developers, two of those aren't major browsers at all and you've missed the 800lb gorilla. You're also ignoring older versions of mobile browsers, the current Firefox ESR, and at least one other browser that has a larger market share than several of the above in parts of Asia, amon…

Yes, "current version" specifically doesn't include "older versions", that should be uncontroversial. Not sure the 800lb gorilla you're referring to, but maybe UC Browser? That thing is so odd it's difficult to know what it supports, and it's not supported in nearly any popular CI service. I'm sure all kinds of things are broken on it, but you can still compile your app to ES5. And ES6 _is_ a proper long lived standa…

>Not sure the 800lb gorilla you're referring to

Are you kidding? she/he is talking about IE.

Re: React v15.5.0

#194
post #97

Earlier quoted context omitted.

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.

Huh? That's funny--I would have said the opposite. It was from watching Obama's speeches that I learned that silent pauses can be much less annoying than "umms". If you want to see someone using a lot of "umms", watch Justin Trudeau.

Re: React v15.5.0

#195
post #61

Earlier quoted context omitted.

It's not just that - is JSX part of ES6? It isn't, but a lot of pre-Babel transpiled code uses it. So people would need to transpile to ES6 for distribution, then to ES5 when someone uses the library. Messy.

Don't distribute JSX, it's not JavaScript. Distribute what engines actually support.

A nice sentiment, but you could say the exact same thing about ES6. "What engines actually support" is a pretty fuzzy metric.

Re: React v15.5.0

#196

Earlier quoted context omitted.

The situation has really improved, mostly due to auto-updating, increased competition between browsers, the iPhone's power to compel modernisation, and the resulting fading of proprietary technology like flash or ActiveX. Sure, google.com probably needs to support IE 6. For my own business, I'm not willing to make compromises for browsers below 2%. That currently means Safari 10, Chrome 56, and IE 11. And IE 11 is re…

That's crazy to me: you'd give up 2% of your customer size (and potential revenue?) just to make your dev workflow more convenient?

particularly for a young or fast-growing product, this makes a ton of sense - shipping features that multiply your target market can be a _much_ better strategy than keeping 2% of your current user base.

Re: React v15.5.0

#197

Earlier quoted context omitted.

All current browsers support ES6. That's debatable, particularly when you factor in bugs. However, even if they did, it seems unwise to assume that all relevant users for all or even most projects will be on the latest evergreen browsers. Several large groups, including business users on IE and mobile users on slightly older devices, probably won't be. I know there's a certain type of web developer who would love for…

This is a common theme I'm noticing a lot lately. Meanwhile, I check my product's browser breakdown and IE9/10 is still too significant to ignore. There's just no way our customers would be okay with this. Many are still locked on older IE versions due to (bad) corporate policies. I can't strongarm them into upgrading. Which leads me to wonder: are developers that are so willing to advocate breaking compatibility wit…

I propose a warning... "For security reasons, all versions of Internet Explorer are no longer supported. Please upgrade to a modern/current browser such as Chrome, Firefox or Edge."

Make sure to state "For security reasons" policies always have that even when it's not true, or bad security, because most people don't question it.

Re: React v15.5.0

#198
post #97

Earlier quoted context omitted.

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.

Huh? That's funny--I would have said the opposite. It was from watching Obama's speeches that I learned that silent pauses can be much less annoying than "umms". If you want to see someone using a lot of "umms", watch Justin Trudeau.

He speaks very differently during Q/A sessions than during speeches. During Q/A he's never not making a sound.

Re: React v15.5.0

#199

Earlier quoted context omitted.

Agree. This is Maker's Triangle stuff (Good, Cheap or Fast, pick two). Everyone is picking Cheap and Fast, and not only Cheap, but Free, so the amount of Good left in this stuff is non-existent. If there's no Good chosen, then it all gets crufty and full of tech debt. So someone else thinks they can do better, and starts developing a replacement. In order to get traction, though, they need to make it Free and develop…

I'm unsure if this Maker's Triangle thing applies to OSS. But if it does, it's my impression that it's usually the "Fast" that is abandoned, not the "Good". But how does that apply to Chrome, or React? Is there any indication that Chrome carries more technical debt than, say IE7? Similarly, in what way does Facebook need people to adopt React, and would that matter enough to accept such compromises? Is there any indi…

As someone who's been building against browser/web tech for over two decades now... that React is emphatically no less than "Good"... The diagnostic messages alone are leaps and bounds ahead of anything else I've used. Angular just breaks in weird ways with no warnings, sometimes non-sense error messages, other platforms likewise... React regularly warns on usage that might break something in the next release, and more than a clue how to fix it. Nothing else I've used comes close to that. Not that it was your implication.

Now, I'll admit, I've dev'd against React and deployed with preact-compat as a build sub for size... but a couple times back to React for broader support, and it really didn't save on speed anyway.

React is hands down the first web tech I've used (out of dozens of platforms and toolkits over the years) that just made sense. Not everything I agree with, and would love some adjustments. All the same, more often than not, it does what I expect, and I definitely can't say that of most of the rest.

As to jQuery, I think it's a great idea, was and still is in a lot of ways. I do wish they'd just drop their XHR, and Promise implementation at this point... but the selection library + eventing is cool and easier to grasp to this day, despite going without it for about 2 years now. There are cases where it was just nice, and still is.

I'm actually fine with JSX, imho it's better having some XML in my JS than it ever was having weird DSL in templates in JS.

Re: React v15.5.0

#200
post #88

Earlier quoted context omitted.

All current browsers support ES6. That's debatable, particularly when you factor in bugs. However, even if they did, it seems unwise to assume that all relevant users for all or even most projects will be on the latest evergreen browsers. Several large groups, including business users on IE and mobile users on slightly older devices, probably won't be. I know there's a certain type of web developer who would love for…

Many user are still on ES5/JS5 capable browser. IE11, older FF and Chrome, and especially older mobile devices with older Webkit based browser (Android and iOS)

There's still a handful of features (though far fewer than 2 years ago) that I need babel for anyway, so just sticking with that, and may adjust my babel-preset-env config as things change. I may even do dual builds, one for bleeding edge (a bit more than half the users) and a catch-all ES5 build. YMMV.
Post reply on HN