Live data from Hacker News

React v15.5.0

facebook.github.io

31–40 of 209 posts

Re: React v15.5.0

#31
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…

Isn't there option (3) as well? Which would be, writing classes the old way, using prototypes and something like `util.inherits`

Re: React v15.5.0

#32

React team is doing an amazing job. I remember when it was first announced, I thought Facebook was crazy. "JSX? That sounds like a bad joke!" I don't think I've ever been so wrong. After hearing so much about React, I eventually tried it out and I realized that JSX wasn't a big deal at all, and in fact it was actually pretty awesome. Their migration strategy is great for larger actively developed applications. Since…

I still think JSX is a bad joke. Luckily React has nothing to do with it.

Re: React v15.5.0

#33
post #16

I still remember the times when warning were actual likely mistakes in your code, not "we're adding some more churn, update your stuff until we churn more". If you want people to always ignore warnings, this is how you go about it.

> 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.

Re: React v15.5.0

#34

For those still using propTypes, I'd recommend to take a look at Flow as replacement. https://flow.org/en/docs/frameworks/react

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 complex string keys for UI actions, rendered templates, etc., and make Flow actually enforce them via its $Keys helper. This has the incredible effect of making it a type error if you try to execute an action that doesn't exist.

Cumbersome APIs become easy with Flow, and that's just scratching the surface of its utility on any sufficiently-complex JS project. It's nothing but wins for your development team.

TS is great too. Honestly, either way is a giant leap forward.

Re: React v15.5.0

#35
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…

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.

Re: React v15.5.0

#36

React team is doing an amazing job. I remember when it was first announced, I thought Facebook was crazy. "JSX? That sounds like a bad joke!" I don't think I've ever been so wrong. After hearing so much about React, I eventually tried it out and I realized that JSX wasn't a big deal at all, and in fact it was actually pretty awesome. Their migration strategy is great for larger actively developed applications. Since…

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

Re: React v15.5.0

#37
post #31
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…

Isn't there option (3) as well? Which would be, writing classes the old way, using prototypes and something like `util.inherits`

That's basically what `createClass` does: https://github.com/facebook/react/blob/72196da82915bee400edb...

Re: React v15.5.0

#38
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 think what we need is a mix between a module bundler and package manager. When you pull in a dependency, it should confirm the code can run on all your targets. If it wouldn't run, e.g. ES2015 classes but you have an ES5 target, it should be compiled. That way when you bundle your app, you can skip the compilation check on all third-party modules. Adopting an incremental compilation strategy will also speed up larger apps.

Re: React v15.5.0

#39
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…

It's really time to start distributing ES6 via npm. All current browsers support ES6. It's now generally faster than equivalent ES5, it minifies better, tooling is better, etc.

It's the app that should compile all the code to run in the target environment if needed. This is what we've done in the new Polymer CLI / polymer-build: we compile all dependencies but only if necessary.

Re: React v15.5.0

#40
So... create-react-class is an unrelated node module. react-create-class (the correct one, I guess) is completely empty, other than the package.json.
Post reply on HN