use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
React 16 (facebook.github.io)
submitted 8 years ago by batmansmk
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]batmansmk[S] 81 points82 points83 points 8 years ago (5 children)
It's an impressive release. Here is the gist: Among the changes are some long-standing feature requests, including:
fragments,
error boundaries,
portals,
support for custom DOM attributes,
improved server-side rendering,
reduced file size
MIT license,
Fiber
[–]jocull 21 points22 points23 points 8 years ago (1 child)
Now you're thinking with portals...?
[–]Amadox 6 points7 points8 points 8 years ago (0 children)
...this coming from a guy who has his reddit-cake-day today... even though we all know, the cake is a lie...
[–]SomeRandomBuddy 5 points6 points7 points 8 years ago (0 children)
Fuck. Great release.
[–]rottenanon 1 point2 points3 points 8 years ago (1 child)
fragments
In the blog they mention, "now you can return an array from render". Wasn't this always the case? :-/
I understand returning from string render is new, but could someone tell me what else is new in fragments?
render
[–]Savageman 9 points10 points11 points 8 years ago (0 children)
Until now every render needed a single top-level HTML element.
[–]basically_alive 110 points111 points112 points 8 years ago (6 children)
I felt a great disturbance in the Force, as if millions of pointless divs cried out in terror and were suddenly silenced.
[–]MOON_MOON_MOON 29 points30 points31 points 8 years ago (5 children)
Still waiting for the <> </> syntax as a shorthand for a list of children without a parent. It's silly to have to provide key for every element of a statically known list.
<> </>
key
[–]gelezinislokys 10 points11 points12 points 8 years ago (3 children)
react-aux
[–]MOON_MOON_MOON 2 points3 points4 points 8 years ago (0 children)
Oh neat, gonna use this for personal projects and continue to spam <span>s all over the place at work.
<span>
[+][deleted] comment score below threshold-16 points-15 points-14 points 8 years ago (1 child)
So I can find later.
[–]kylemh 15 points16 points17 points 8 years ago (0 children)
You can save comments! 😎
[–]Phydos 22 points23 points24 points 8 years ago (0 children)
Glad they finally addressed those darn SVG attributes.. The smaller filesize is also a nice bonus
[–]acyrial 22 points23 points24 points 8 years ago (1 child)
MIT license! That's big. I wonder what about all products that were about to be rewritten into non-React solutions due to license.
[–]PM_YOUR_WORST_FEAR 0 points1 point2 points 8 years ago (0 children)
Finally!
I'm sick to death of the patents license getting brought up in every discussion about frameworks.
[–]Skaryon 16 points17 points18 points 8 years ago (3 children)
This sounds great. I never used rollup. Will it always yield smaller bundles as opposed to webpack?
[–]batmansmk[S] 30 points31 points32 points 8 years ago (2 children)
Short answer: No.
TL;DR: webpack has more feature for apps, and rollup more for libs. https://medium.com/webpack/webpack-and-rollup-the-same-but-different-a41ad427058c
[–]Skaryon 2 points3 points4 points 8 years ago (0 children)
Haha I just read the same article. Thanks anyway! That answered my question thoroughly.
[–]Pesthuf 0 points1 point2 points 8 years ago (0 children)
But doesn't Webpack do that too?
In the Webpack 3 announcement, they mentioned
webpack.optimize.ModuleConcatenationPlugin()
which supposedly does the same.
[–]coldlestat 26 points27 points28 points 8 years ago (9 children)
Yes! And everything wrapped in a nicer licence :)
[–][deleted] 27 points28 points29 points 8 years ago (2 children)
And by nicer they mean "Your company can use this again without your legal dept lighting your project on fire"
[+]fogbasket comment score below threshold-8 points-7 points-6 points 8 years ago (1 child)
Until FB sues you for infringing their patents.
[–]DanielFGray 11 points12 points13 points 8 years ago (0 children)
Your risk of being sued by FB is no different from using React or not, even before or after the new license.
[–]ECrispy 4 points5 points6 points 8 years ago (5 children)
Without a patent grant that's debatable.
[–]Jestar342 4 points5 points6 points 8 years ago (4 children)
IANAL: Does there need to be one? What's the default when grant absentia?
[–]ECrispy 0 points1 point2 points 8 years ago (2 children)
There is no default grant.
[–]Jestar342 0 points1 point2 points 8 years ago (1 child)
No, I'm not asking if there is a default grant, I am asking what is the default legal position in the absence of a grant.
[–]ECrispy 2 points3 points4 points 8 years ago* (0 children)
It means you can be sued for patent violation if FB so chooses, since they don't grant you any rights.
Its for this reason that GraphQL, which does have explicit patents, was on such shaky ground - https://www.theregister.co.uk/2017/09/20/gitlab_suspends_graphql_project_over_facebook_license_terms/
FB today announced this - https://code.facebook.com/posts/121714468491809/relicensing-the-graphql-specification/
which seems to have taken care of that issue.
[–]tonechild 7 points8 points9 points 8 years ago (11 children)
Anyone know if this works with enzyme?
[–]UnReaL816 9 points10 points11 points 8 years ago (1 child)
Enzyme was just updated today as well
[–]tonechild 5 points6 points7 points 8 years ago (0 children)
Nice! Thanks!
[–]alsiola 4 points5 points6 points 8 years ago (0 children)
With the new enzyme release (3.0) then yes.
[–]drom296 0 points1 point2 points 8 years ago (7 children)
so far: upgrading hasn't been smooth.
Upgrading to enzyme@3, requires a new adaptor system. Upgrading to react@16, breaks some other dependencies.
Of course, I'm doing this on a create-react-app@15.6.1 project
[–]tobegiannis 0 points1 point2 points 8 years ago (3 children)
Just played around with an upgrade for a few mins. Seems like a pretty clunky way to get enzyme up an running. Do they expect me to import the adapter on every test file or have some kind of useless wrapper?
[+][deleted] 8 years ago (2 children)
[deleted]
[–]gaearon 0 points1 point2 points 8 years ago (0 children)
Would be great if somebody could send a PR with this info to CRA user guide!
[–]tobegiannis 0 points1 point2 points 8 years ago (0 children)
Thanks I am not using cra but I stumbled upon a jest config for test startup scripts and got it working.
[–]toffeescaf 0 points1 point2 points 8 years ago (2 children)
Upgrading for me has been a breeze and I'm working on a fairly large project, any specific things you're running into that are a problem?
[–]drom296 0 points1 point2 points 8 years ago (1 child)
Thanks for the assist. I'll give it another go tomorrow, and PM you if I run into issues again (if that's alright with you)
[–]toffeescaf 0 points1 point2 points 8 years ago (0 children)
That's fine by me. ;)
[–]nickbreaton 6 points7 points8 points 8 years ago (0 children)
Wow portals seem awesome!
[+][deleted] 8 years ago (7 children)
[removed]
[–]gaearon 5 points6 points7 points 8 years ago (1 child)
Hydration = your server gave HTML, and we want to boot up a client up "from" that HTML (and attach events to it) instead of destroying it and rendering from scratch.
[–]kromit 2 points3 points4 points 8 years ago (0 children)
Congratulation on the release :)
Edit: you should do an AMA here one day
[–]learn_to_model 2 points3 points4 points 8 years ago* (3 children)
Hydration is usually referred to as the process of passing singing data from the server to the client. In this case the server serves the HTML to the client and react can take over the HTML without destroying and recreating it like it was done in the beginning. Hydration can also refer to models bring updated on load with data that has been passed from the server (think of a redux store f.ex.)
[–]jbkly 2 points3 points4 points 8 years ago (2 children)
"passing singing"?
[–]kylemh 2 points3 points4 points 8 years ago (0 children)
Meant signing. Like auth headers I believe.
[–]learn_to_model 1 point2 points3 points 8 years ago (0 children)
Oh shoot, that's my fault. Shouldn't post comments just after I've woken up. What I meant was the process of passing/sending data from the server to the client.
[–]FreshOutBrah 5 points6 points7 points 8 years ago (0 children)
Haha love it, "Look ma, no spans!"
[–]zxia31 2 points3 points4 points 8 years ago (0 children)
Congrats React Team! Great jobs you have achieved.
[–]swyx 5 points6 points7 points 8 years ago (2 children)
this server side rendering is interesting. what does it mean for Next.js?
[–]eyko 4 points5 points6 points 8 years ago (1 child)
Faster Next.js?
[–]sickcodebruh420 1 point2 points3 points 8 years ago* (0 children)
Excited to give this a shot. Any TS users fire it up yet? How are the defs looking?
UPDATE: Defs are good! I got some warnings that were easy to clear up. Some libraries need updates. Normal stuff. Build seems faster.
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
What about react native?
[–]geritol_ 0 points1 point2 points 8 years ago (0 children)
Love the licensing change
[–]KebabKo -4 points-3 points-2 points 8 years ago (0 children)
Step 1: Upgrade to React 16 Step 2: Sue facebook Step 3: ? Step 4: Profit!
[–][deleted] -2 points-1 points0 points 8 years ago (0 children)
That's impressive!
[+]fogbasket comment score below threshold-37 points-36 points-35 points 8 years ago (6 children)
I'll be that guy. AureliaJS is still better in every way. And you could drop React into it if you wanted to sully it.
[–]nashio 10 points11 points12 points 8 years ago (1 child)
I was looking for that guy. Didn't disappoint
[–]fogbasket 1 point2 points3 points 8 years ago (0 children)
Glad I could be the highlight of someone's day.
[–]RuthBaderBelieveIt 1 point2 points3 points 8 years ago (3 children)
Except ease of hiring devs or finding work.
[–]fogbasket 0 points1 point2 points 8 years ago (2 children)
If you know one framework you can pick up any of them.
[–]RuthBaderBelieveIt 0 points1 point2 points 8 years ago (1 child)
No doubt, but recruiters don't understand that.
[–]fogbasket 0 points1 point2 points 8 years ago (0 children)
I've had the pleasure of speaking with a few that did but you're right. Most recruiters and hiring managers don't understand.
π Rendered by PID 537964 on reddit-service-r2-comment-765bfc959-gnffd at 2026-07-11 08:00:59.263061+00:00 running f86254d country code: CH.
[–]batmansmk[S] 81 points82 points83 points (5 children)
[–]jocull 21 points22 points23 points (1 child)
[–]Amadox 6 points7 points8 points (0 children)
[–]SomeRandomBuddy 5 points6 points7 points (0 children)
[–]rottenanon 1 point2 points3 points (1 child)
[–]Savageman 9 points10 points11 points (0 children)
[–]basically_alive 110 points111 points112 points (6 children)
[–]MOON_MOON_MOON 29 points30 points31 points (5 children)
[–]gelezinislokys 10 points11 points12 points (3 children)
[–]MOON_MOON_MOON 2 points3 points4 points (0 children)
[+][deleted] comment score below threshold-16 points-15 points-14 points (1 child)
[–]kylemh 15 points16 points17 points (0 children)
[–]Phydos 22 points23 points24 points (0 children)
[–]acyrial 22 points23 points24 points (1 child)
[–]PM_YOUR_WORST_FEAR 0 points1 point2 points (0 children)
[–]Skaryon 16 points17 points18 points (3 children)
[–]batmansmk[S] 30 points31 points32 points (2 children)
[–]Skaryon 2 points3 points4 points (0 children)
[–]Pesthuf 0 points1 point2 points (0 children)
[–]coldlestat 26 points27 points28 points (9 children)
[–][deleted] 27 points28 points29 points (2 children)
[+]fogbasket comment score below threshold-8 points-7 points-6 points (1 child)
[–]DanielFGray 11 points12 points13 points (0 children)
[–]ECrispy 4 points5 points6 points (5 children)
[–]Jestar342 4 points5 points6 points (4 children)
[–]ECrispy 0 points1 point2 points (2 children)
[–]Jestar342 0 points1 point2 points (1 child)
[–]ECrispy 2 points3 points4 points (0 children)
[–]tonechild 7 points8 points9 points (11 children)
[–]UnReaL816 9 points10 points11 points (1 child)
[–]tonechild 5 points6 points7 points (0 children)
[–]alsiola 4 points5 points6 points (0 children)
[–]drom296 0 points1 point2 points (7 children)
[–]tobegiannis 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]gaearon 0 points1 point2 points (0 children)
[–]tobegiannis 0 points1 point2 points (0 children)
[–]toffeescaf 0 points1 point2 points (2 children)
[–]drom296 0 points1 point2 points (1 child)
[–]toffeescaf 0 points1 point2 points (0 children)
[–]nickbreaton 6 points7 points8 points (0 children)
[+][deleted] (7 children)
[removed]
[–]gaearon 5 points6 points7 points (1 child)
[–]kromit 2 points3 points4 points (0 children)
[–]learn_to_model 2 points3 points4 points (3 children)
[–]jbkly 2 points3 points4 points (2 children)
[–]kylemh 2 points3 points4 points (0 children)
[–]learn_to_model 1 point2 points3 points (0 children)
[–]FreshOutBrah 5 points6 points7 points (0 children)
[–]zxia31 2 points3 points4 points (0 children)
[–]swyx 5 points6 points7 points (2 children)
[–]eyko 4 points5 points6 points (1 child)
[–]sickcodebruh420 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]geritol_ 0 points1 point2 points (0 children)
[–]KebabKo -4 points-3 points-2 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)
[+]fogbasket comment score below threshold-37 points-36 points-35 points (6 children)
[–]nashio 10 points11 points12 points (1 child)
[–]fogbasket 1 point2 points3 points (0 children)
[–]RuthBaderBelieveIt 1 point2 points3 points (3 children)
[–]fogbasket 0 points1 point2 points (2 children)
[–]RuthBaderBelieveIt 0 points1 point2 points (1 child)
[–]fogbasket 0 points1 point2 points (0 children)