Live data from Hacker News

React v15.5.0

facebook.github.io

201–209 of 209 posts

Re: React v15.5.0

#201
post #56

Earlier quoted context omitted.

I think this is just a trope that JS devs and newbies have launched on to, and that it's without merit. Classes are good. Classes express concrete taxonomies of concrete things in ways that most developers can understand. I think we should be happy that JS is flexible enough that adding "class" to the language is almost purely syntactical: it clarifies and makes semantic a bunch of otherwise boilerplate "Foo.prototyp…

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…

To me, classes make more sense when you carry context with event binding, which components often do. It's syntax sugar over the Foo.prototype.* drivel, and I don't mind it...

That said, I tent to follow more functional patterns for workflows (prefer Redux and similar extension), but for some components the class syntax is usually nicer. Most components are probably best served as simple render methods though.

Re: React v15.5.0

#202
post #160

Earlier quoted context omitted.

https://code.facebook.com/pages/850928938376556 It's purely defensive, they'll only revoke your license if you sue them for patent infringement. And they only revoke the patent-grant of React as far as I can tell, not your license to use it (and there aren't any patents related to React as far as the internet claims).

Which in turn means they can infringe on any of your patents with no consequences. If they do, your only choice is to rewrite your entire application in a hurry, and only then you can sue them.

Of course if you use a similar competing technology and choose to sue them over patents, they could still find you infringing and sue you anyway.

Re: React v15.5.0

#203
post #33
post #16

Earlier quoted context omitted.

> For each of these new deprecations, we've provided a codemod to automatically migrate your code. They are available as part of the react-codemod project. They gave you tools to automatically fix any new warnings that came from this. I honestly don't know how they could have made it any easier.

Unless you use typescript or coffeescript. In which case you're on your own.

Typescript doesn't do development vs. production builds?

Re: React v15.5.0

#204

Earlier quoted context omitted.

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.

That would scare the hell out of my users and immediately increase support volume by a not insignificant amount. There's not a lot of sense in doing that anyways since many/most of the users stuck on old browser versions are stuck due to corporate policy.

Re: React v15.5.0

#205

Earlier quoted context omitted.

The JavaScript world is going to fragment soon. I'm an old school JavaScript developer... I'm not interested in Async, I'm not interested in promises, I'm not interested in classes. I think Javascript had some incredibly powerful features (functional, event-driven, small language) and ES6 removes all of those features. I totally understand why the ES6 community likes it. It lets you write very Rubyish code and has lo…

What the hell are you talking about? None of those features are removed. The issue at hand is that we are developing more and more complex single page apps and we desire our primary language to support that trend. Don't use classes. Don't use promises. Can't comment on what you said about async since it's literally nonsensical. There is no fork coming, or if there is, it will only be used by a tiny portion of the com…

Can't not use promises because they're littered all over NPM now.

Not sure what's wrong with what I said about async? it's a new keyword in ES2017. It's a difficult to use control structure that doesn't do anything you couldn't do with callbacks. What part of "modern programming" do you need Async for?

I don't think I'm brilliant for being able to think through basic functional programming concepts. Actually the opposite... I think you need to be very smart to understand and debug promises, that's why they are bad. I like callbacks because they don't require me to be smart.

Maybe I'm smart for knowing I'm shooting my future self in the foot when I write code that requires smarts, but that's a little convoluted. The reason I care is because the ES6 community sold out beginners by adding all of this syntactic sugar. Javascript used to be a good beginner language.

Re: React v15.5.0

#206
post #34

Earlier quoted context omitted.

We use Flow everywhere now and love it. It's not perfect by any means but it's a lot easier to use than Java's static typing and a lot more expressive to boot. I can't overstate how great it is to be able to strongly type your modules and ensure you don't send the wrong input or receive the wrong input from them. In fact, Flow allows us to confidently implement APIs that would just be cumbersome otherwise; we can use…

> This has the incredible effect of making it a type error if you try to execute an action that doesn't exist. I don't want to start a "JavaScript is bad" flamewar, but it's sad that there is an entire class of problems that we as software developers are solving, where simple type checking seems amazing

Yes - and no. Flow can express some really complex types that were previously only possible in much more esoteric (or modern) languages. Types as many people know them from Java, C#, etc., are more mature (aka fewer bugs), but far less powerful.

For example:

The utility types in https://flow.org/en/docs/types/utilities/ can be used to great effect to express things like "A type of the keys of T, but values passed through this function" or "A type that is the difference of these two maps".

In practice, this helps me write things like React Components that take some of their props from the root store via context, and the rest of their props directly, and for Flow to actually know which is which just by reading the code (no explicit typedefs!), override root store props as needed (so long as I don't change their types), and throw a type error if I miss or misdefine one. Awesome.

Re: React v15.5.0

#207

Earlier quoted context omitted.

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.

That would scare the hell out of my users and immediately increase support volume by a not insignificant amount. There's not a lot of sense in doing that anyways since many/most of the users stuck on old browser versions are stuck due to corporate policy.

Then their corporations are running old/insecure browsers... the end. It's not my job to coddle corporations that are endangering their own users.

Re: React v15.5.0

#208

Earlier quoted context omitted.

That would scare the hell out of my users and immediately increase support volume by a not insignificant amount. There's not a lot of sense in doing that anyways since many/most of the users stuck on old browser versions are stuck due to corporate policy.

Then their corporations are running old/insecure browsers... the end. It's not my job to coddle corporations that are endangering their own users.

Yes, actually, if that's who you are selling your product to it is exactly your job to be doing that.

Re: React v15.5.0

#209
post #33

Earlier quoted context omitted.

Unless you use typescript or coffeescript. In which case you're on your own.

Typescript doesn't do development vs. production builds?

I don't see how thats relevant? The point is that the codemod tool doesn't work on TypeScript. So you still have to fix the warnings manually.

I don't think its too bad, just saying that the tool doesn't solve the problem for everyone.

Post reply on HN