Live data from Hacker News

React v15.0

facebook.github.io

61–70 of 174 posts

Re: React v15.0

#61
post #40

If you are using typescript, you should read: https://github.com/Microsoft/TypeScript/issues/7270 TLD'R: React 15.0 broke TSX in typescript but the workaround is easy.

Seems to still work in my small codebase, but I get a series of type warnings.

Typings still has 0.14 tagged as the latest - I'm guessing we need an update there too?

Re: React v15.0

#62
I just tried the new release. The data-reactid is indeed gone when rendering on the client side. But on the server side, the html string generate by ReactDOMServer.renderToString still has data-reactid. Is it because client side can validate the server result and decide if it needs to re-render the page?

Re: React v15.0

#63
post #21

Earlier quoted context omitted.

I don't think we've ever promoted React based on file size. Smaller files are better but people tend to overemphasize JS file size -- gzipped, this latest release is 43k which is comparable to the size of an image or two on most websites. (Also note that growing framework code can reduce your app code size overall; I don't want to make specific claims about React but at Facebook we often see code size increase when 1…

This release gained 3k gzipped (it was 39k), in large part due to complete SVG support. In this case I think it was worth it because this was a longstanding pain point. There may be some ways to drop some dead code that we haven't eliminated efficiently yet. Here is a recent example I found that drops 1kb: https://github.com/facebook/react/pull/6401 It would be cool if somebody in the community could spare some time…

Somebody suggested having a micro-kernel approach to load modules onDemand in production, e.g. SVG, renderToString will further reduce the initial load time / size.

Re: React v15.0

#64
post #41

Can anyone say what this SVG support means for d3.js integration?

It will likely strengthen the case for having react manage the DOM while d3 takes care of any fancy math you need, like computing the d attribute for a in a line chart. Previously there were some SVG elements that simply couldn't be expressed in React and so you had to either push that DOM management onto d3 or dangerouslySetInnerHTML

Re: React v15.0

#65
post #9

Earlier quoted context omitted.

We updated the patent grant to be less restrictive in response to community feedback about a year ago (several months after the discussion you linked): https://github.com/facebook/react/commit/b8ba8c83f318b84e429... Since that change I've heard few complaints, and I know for a fact that several large companies who were previously unwilling to use it are now content with the language.

I noticed you italicized the word grant . In reality the "grant" isn't granting; it is taking away. Let me explain: If React didn't have an explicit "grant" there would be an implicit grant. Is the explicit grant better than an implicit grant? It isn't because the explicit grant has what is known as a strong retaliation clause . More info on weak vs strong retaliation clauses: http://www.rosenlaw.com/lj9.htm React's…

> If React didn't have an explicit "grant" there would be an implicit grant.

Please provide a citation to any court decision so holding, or to the text of any law that clearly implies this.

The reality is that a couple of lawyers have come up with the speculative theory that maybe, some day, a court will read the plain text of the BSD license as granting an implicit patent license because some of the words its uses are kind of similar to the words used in a seemingly unrelated law.

This theory is...tenuous at best. More to the point, it's just a theory about what a hypothetical court might rule one day in a hypothetical case. (Plus, I mean, hypothetically the court might rule that an explicit grant can't limit the rights granted by an implicit grant in this case. Since we're just speculating about what new rules a future court might hypothetically make.)

Re: React v15.0

#66
post #50
post #34

Earlier quoted context omitted.

> If React didn't have an explicit patent grant then there would be an implicit grant which does not have any retaliation clauses, and cannot be revoked. I'm not a lawyer. My understanding is that this is hypothetically possible but stands on shaky legal ground and has no legal precedent. Whether or not an implicit grant exists seems to depend on who you ask. This is apparently why GPLv3 includes an explicit grant. I…

>It could also be that there aren't any patents that cover React. If that is the case, why have this controversial patent clause at all? I haven't read them all, but Facebook seems to have a number of patents which at first glance are so broad they could apply to react: https://patents.google.com/patent/US20160092096A1/en "a method performed by one or more computing devices including defining a hierarchical structure…

I think that rather strengthens the argument that Facebook's patent grant isn't a good reason to avoid React, given that almost any possible webapp written with any framework is likely infringing. :)

Re: React v15.0

#68
post #21
post #19

Is there a reason why the file size has exploded? react.min.js is now 145.4kb. For comparioson, angular.min.js is 155.2kb. One of React's biggest selling points was that it was much smaller than Angular/Ember/Backbone etc, but I'm not sure that argument can be leveraged anymore. I think React is a culmination of some great ideas, but in my view this is a big step back. Especially since Angular/Ember/etc. offer a lot…

I don't think we've ever promoted React based on file size. Smaller files are better but people tend to overemphasize JS file size -- gzipped, this latest release is 43k which is comparable to the size of an image or two on most websites. (Also note that growing framework code can reduce your app code size overall; I don't want to make specific claims about React but at Facebook we often see code size increase when 1…

as a fan of react, i think file size should be a bigger priority.

for comparison, mithril is 7.8 gzipped. i don't see react getting that small, but i'm sure there's room for slimming down, perhaps signicantly.

Re: React v15.0

#69
post #63

Earlier quoted context omitted.

This release gained 3k gzipped (it was 39k), in large part due to complete SVG support. In this case I think it was worth it because this was a longstanding pain point. There may be some ways to drop some dead code that we haven't eliminated efficiently yet. Here is a recent example I found that drops 1kb: https://github.com/facebook/react/pull/6401 It would be cool if somebody in the community could spare some time…

Somebody suggested having a micro-kernel approach to load modules onDemand in production, e.g. SVG, renderToString will further reduce the initial load time / size.

There's interesting work happening with tree shaking, which allows you to do static analysis at compile time to remove unimported code. The new JS `import` syntax is specifically designed to enable this, so it's just a matter of time until tooling and libraries catch up.

Re: React v15.0

#70
post #19

Is there a reason why the file size has exploded? react.min.js is now 145.4kb. For comparioson, angular.min.js is 155.2kb. One of React's biggest selling points was that it was much smaller than Angular/Ember/Backbone etc, but I'm not sure that argument can be leveraged anymore. I think React is a culmination of some great ideas, but in my view this is a big step back. Especially since Angular/Ember/etc. offer a lot…

Can you elaborate why anyone should care?

Is this related to the bandwidth costs you incur in aggregate? I guess I too would be mad after converting all of my image assets into vector and CSS3 concoctions only to have my site size foiled by a dependency. But in reality one image is much larger than this.

Post reply on HN