News for hackers. Stuff that matters.
Re:Rax – A universal React-compatible render engine by rtpg on Friday January 13, 2017 @02:28AM (#13389085)
reading that, it seems pretty good. Are there performance costs to its diffing against the "real" DOM?

3kb for "React" is pretttttty tempting

Re:Rax – A universal React-compatible render engine by bjacobel on Friday January 13, 2017 @08:01AM (#13390461)
Preact doesn't offer a full synthetic events system so handling e.g. touch events cross-browser may cause you a little more headache than it would in React.

But I'm currently using Preact (server-rendered) for my personal site and loving the speed and byte size.

Re:Rax – A universal React-compatible render engine by developit on Friday January 13, 2017 @10:08AM (#13391335)
FWIW, there is actually no code in React to normalize touch events between browsers. For touch events react and preact are basically the same (aside from React creating a lot of pooled objects for their synthetic event system, and preact not using delegation).
Re:Rax – A universal React-compatible render engine by Etheryte on Friday January 13, 2017 @04:15AM (#13389508)
Forget about file size, 40kb vs 8kb doesn't really matter in the modern era. If anything, using an obscure library may cost you more because it's less likely to be a CDN cache hit for the user.
Re:Rax – A universal React-compatible render engine by simonw on Friday January 13, 2017 @08:59AM (#13390778)
Start testing on a mid range Android device on 3G and tell me you still believe that.

On mobile it's not just the file transfer that takes time: it's the JavaScript parsing and execution (on a single core) that hurts too. iPhones are massively faster than Android (especially cheaper Androids) at this, so many developers don't realize how much performance cost there is for a growing majority of their users.

Given how many different versions there are of popular libraries I'm personally skeptical that CDNs give you much of a chance if the asset being preloaded from another site. I'd love to see real numbers on this though.

Re:Rax – A universal React-compatible render engine by Kiro on Friday January 13, 2017 @11:46AM (#13392272)
I build games where the player is supposed to play for hours. Am I wrong thinking that file size matters less for me? It adds 1% to the loading screen.
Re:Rax – A universal React-compatible render engine by rtpg on Friday January 13, 2017 @09:59PM (#13396585)
Yeah for games it's not much of an issue.

It becomes more of an issue if you are doing a "business" app, where there's a lot of moving between pages and a lot of eventual page refreshes.

Re:Rax – A universal React-compatible render engine by rtpg on Friday January 13, 2017 @04:35AM (#13389594)
we package our JS into one bundle, so just one CDN to hit (ours).

Another thing is that even if you're at 40kb gzipped, that's still at least 20ms for parsing JS. When you're trying to improve performance, chopping out 30kb is nice

Re:Rax – A universal React-compatible render engine by nobleach on Friday January 13, 2017 @11:41AM (#13392235)
You mean, in America... in a metropolitan area.... with a nice newer device... with an unlimited data plan. A 40kb vs 8kb savings can mean quite a bit to those in other conditions.
Re:Rax – A universal React-compatible render engine by Touche on Friday January 13, 2017 @08:03AM (#13390471)
40kb is 40% of your budget if targeting mobile.
Re:Rax – A universal React-compatible render engine by developit on Friday January 13, 2017 @10:09AM (#13391339)
If you're loading libraries individually off a shared CDN, performance must not be much of a concern :P