TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

React 16

914 pointsby markthethomasover 7 years ago

34 comments

Androiderover 7 years ago
5 minute real-world performance test: I just upgraded a relatively large (200K+ LOC) app that performs server side rendering of charts from React 15.6 to 16.0. Render time dropped from ~50ms to ~15ms. The previous version was already optimized and precompiled (e.g. none of the process.env performance penalties were applicable).<p>Very impressive improvement for a drop-in upgrade! Especially considering the previous version was not considered slow at all given the complexity.
评论 #15341545 未加载
评论 #15341562 未加载
评论 #15342219 未加载
spicyjover 7 years ago
We&#x27;re really excited about this release. I also wrote about how we made the rewrite happen on our Facebook engineering blog: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15339825" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=15339825</a>.<p>Happy to answer questions if y&#x27;all have any. :)
评论 #15340507 未加载
评论 #15340276 未加载
评论 #15343019 未加载
评论 #15341758 未加载
评论 #15340623 未加载
评论 #15340328 未加载
评论 #15342140 未加载
评论 #15346303 未加载
评论 #15340613 未加载
评论 #15340573 未加载
评论 #15340693 未加载
orb_ytover 7 years ago
Lovely. The file size reductions are quite surprising.<p>Removing the need to wrap sibling elements in a single parent element is a welcome change.<p>I&#x27;d be interested in hearing some use cases for using the Portal API.<p>Lastly, the new licensing announced last week was fantastic news. I commented on last weeks thread, but I want to extend another round of compliments to Facebook and the React community as a whole for prompting this change. <i>Props</i> to them.
评论 #15341015 未加载
评论 #15341460 未加载
评论 #15340301 未加载
评论 #15340982 未加载
alexquezover 7 years ago
I&#x27;m impressed by how accessible Facebook makes open source tech. It&#x27;s always top notch but documented in a way that allows regular devs the opportunity to use it in their own apps.<p>Smaller size and easier to use is a big win. Going with the MIT license puts a real bow on this release. Thank you to the React team.
评论 #15344357 未加载
评论 #15340506 未加载
评论 #15343451 未加载
评论 #15343409 未加载
评论 #15342166 未加载
hitekkerover 7 years ago
Great release but forcing the capturing of errors seems to violate the JS value of forgiveness. Worse, this &quot;forcing&quot; actually seems to <i>hinder</i> debugging.<p>For example, I have one component that throws an exception. Previously, React would print the stack trace in console and carry on. Now, it destroys the entire DOM, spews three times as many errors, without even letting me see what the visual result was of that error.<p>To debug, I need to write a componentDidCatch method in the parent class of the erroring class, because the root componentDidCatch error handler can&#x27;t reconstruct the DOM, because of that one sub-sub-sub-sub-sub-child state error.<p>Even after writing all this new code, React still removes the erroring element from the DOM, leaving ambiguous what its impact was on the end-user experience.<p>Does anyone else feel that the new version of React is fault-intolerant?<p>While I do enjoy Java, I would argue that Null-Pointer-Exception hell does not belong in JS scripting.
评论 #15342176 未加载
评论 #15342967 未加载
评论 #15342261 未加载
Kwastieover 7 years ago
Even though React 16 is almost a complete rewrite, it&#x27;s amazing how they kept an almost complete compatible api between releases.<p>Congrats on shipping!
评论 #15340922 未加载
unohooover 7 years ago
2 awesome things about this release: 1) No need to wrap siblings in an enclosing element - upgrade is worth it just for this change alone (j&#x2F;k)<p>2) I&#x27;m surprised no one has mentioned it so far -- but this release uses the new fiber architecture - I saw the video presentation about fiber and think it could really help in terms of performance
评论 #15344943 未加载
debaserab2over 7 years ago
Portals seem like a great idea. It seems like it eliminates one of the major use cases (imo) for inlined styles: rendering child components deep within the DOM when visually the component doesn&#x27;t appear that it should be that deep (e.g., rendering a global level modal that in the DOM might be appear in a deeply nested div). That always wreaked havoc with stylesheet selectors and is one of the reasons I started moving towards injected inline styles.<p>Overall reduction of container elements is a huge plus. I&#x27;ll be happy if I can start thinning out the giant christmas tree that react tends to create, even if it&#x27;s not a huge performance gain, this will improve debugging immensely.
mhdover 7 years ago
So, what&#x27;s the current ES5, non-Babel&#x2F;Webpack&#x2F;Rollup&#x2F;Brunch&#x2F;etc story of React? When I first tested it, all you had to include was two Javascript files and you could go, and if you were foregoing JSX it was even easier.<p>These days it seems you need to download half the internet for even the most trivial uses, never mind using the half-finished ersatz JS du jour. And yes, I know that it gets compiled to a tiny thing worth of the IOCCC for the end user, but sometimes even us programmers want an easy setup. It seems the only framework that still has a good story regarding that is Mithril…
评论 #15342933 未加载
评论 #15342918 未加载
评论 #15345383 未加载
评论 #15343354 未加载
a13nover 7 years ago
So much good stuff in here. Perf wins, in both bytes down the wire and render time. I&#x27;ve been wanting to return sibling elements from render for <i>years</i>!<p>Crazy to see such a robust, mature framework still improving so much. Can&#x27;t wait to upgrade!
supernintendoover 7 years ago
Really excited about Portals. I work on a web app which was originally built with Spine.js (an MVC framework similar to Backbone). We&#x27;ve long moved on to React and Redux but have a few old views that have yet to be ported over. Portals seems like a nice way to refactor by incrementally replacing controller + template logic with components.<p>I&#x27;m also glad to see the switch to MIT license if only to put this patents controversy behind us. Now curious to see what happens with GraphQL...
评论 #15340637 未加载
评论 #15340511 未加载
评论 #15340880 未加载
评论 #15340708 未加载
评论 #15340484 未加载
slaymaker1907over 7 years ago
I&#x27;m super excited for pseudo-components. This should make it much easier to use CSS constructs like flexbox and the new grid system since they don&#x27;t like nested DOM tags.<p>I tried to make a set of React components that worked like a table (with rows and columns) using CSS grid in React 15, but it was nearly impossible to do. For the record, the reason I didn&#x27;t just use a table was because the grid system allows for more expressive sizing of columns than plain tables.
fortythirteenover 7 years ago
The big news it that they removed the PATENTS.md file that made it nearly impossible to use for anyone concerned with protecting their IP. Good on them for making right with the open source community.
评论 #15340348 未加载
评论 #15340224 未加载
评论 #15340261 未加载
评论 #15340719 未加载
fairview14over 7 years ago
Thank you FB React team. Along with the new license I can&#x27;t be happier to see your good work and improvements on React.<p>Before the license change I was looking around for other options, but now I can continue to enjoy front-end development with this awesome library for at least a few years more. For me this definitely helps fighting JS fatigue not having to change to another framework.
SlyShyover 7 years ago
Impressive improvements in this version and very heartening to see performance improve in addition to the new APIs.<p>Multiple render return types and portals both solve some annoying situations that can come up.
评论 #15340170 未加载
评论 #15340240 未加载
skrebbelover 7 years ago
Small nitpick: the reduced file size appears to be, in part, due to depending on Map and Set. Polyfilling these will, in turn, increase file size so there&#x27;s no real file size impact in practice. IMO the blog post could&#x27;ve been more honest about that.<p>Fantastic release nevertheless!
评论 #15343141 未加载
评论 #15342285 未加载
评论 #15343056 未加载
3131sover 7 years ago
If I were to cave in and learn React, can someone recommend an existing project that would serve as good learning material?
评论 #15342265 未加载
评论 #15349537 未加载
评论 #15343598 未加载
评论 #15342509 未加载
petetntover 7 years ago
Congrats for shipping this for everybody involved! 16 has been a long time coming and I super happy for all the new features it brings us. Error boundaries! Fragments! Even better SSR! And so much more.
tootieover 7 years ago
If I&#x27;m building a site where SEO is paramount, am I safe using React and SSR? I&#x27;d kinda like to, but my inclination is to stick with a traditional server page approach.
评论 #15340502 未加载
评论 #15341165 未加载
评论 #15345438 未加载
评论 #15343712 未加载
scottfrover 7 years ago
This is interesting<p>&gt; Instead of ignoring unrecognized HTML and SVG attributes, React will now pass them through to the DOM.<p>Does that mean we can start using &quot;class&quot; instead of &quot;className&quot;?
评论 #15342001 未加载
评论 #15342033 未加载
MatthewPhillipsover 7 years ago
Just for clarification, React 16 does <i>not</i> support streaming, at least not in any way that is meaningful. React 16 has an API that gives you a Readable stream, but this stream doesn&#x27;t provide HTML in chunks. It provides it all-at-once exactly like renderToString does.<p>What you <i>really</i> want with streaming is whenever rendering is blocked by something asynchronous, like a database request, that whatever HTML is finished can be flushed out. React <i>could</i> support real streaming in the future, but would likely require some new API.<p>Anyways, the sentence from the article &quot;start sending bytes to the client faster&quot; isn&#x27;t factually true, it doesn&#x27;t send it out any faster than renderToString would.
评论 #15340794 未加载
评论 #15340887 未加载
wereHamsterover 7 years ago
<p><pre><code> We&#x27;ve added support for returning strings, too: […] See the full list of supported return types. </code></pre> Why not express that with… ehm… proper types?!? You know… like those used by Flow or TypeScript.
评论 #15340914 未加载
sharnoover 7 years ago
So, are there any plans to use ReasonML as the main React internal language in the future? I knew that Messenger is 50% using ReasonML
iamcwuover 7 years ago
Just wanted to add I noticed CRA (create-react-app) was just migrated to MIT license!
_Codemonkeyismover 7 years ago
Not a flamewar, starting a new project, VUE or React?
评论 #15340288 未加载
评论 #15340265 未加载
评论 #15341170 未加载
评论 #15340610 未加载
评论 #15340251 未加载
评论 #15343947 未加载
评论 #15345664 未加载
评论 #15340250 未加载
评论 #15340688 未加载
评论 #15384882 未加载
mmgutzover 7 years ago
Will existing create-react-app apps automatically get React 16 when they update it?
评论 #15340601 未加载
评论 #15341055 未加载
RichardDudkaover 7 years ago
My shop has seen failure to black screen since migrating. Anyone else?
root_axisover 7 years ago
Thanks for first-class async rendering, been a long while coming.
lechiffre10over 7 years ago
Congrats to the facebook team. Awesome work!
_mbover 7 years ago
Congratulations on the release. Well done!
footaover 7 years ago
Amazing work, hats off to y&#x27;all.
zghstover 7 years ago
Congrats team!
hazelnutover 7 years ago
How does it compare to Marko? <a href="https:&#x2F;&#x2F;github.com&#x2F;marko-js&#x2F;marko" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;marko-js&#x2F;marko</a>
评论 #15343378 未加载
jimmy2020over 7 years ago
<p><pre><code> This release is MIT license release after they start losing in front of more real open source frameworks like vue. Better late than sorry facebook!</code></pre>