News for hackers. Stuff that matters.
Re:Building all of our new mobile apps using React Native by _hl_ on Wednesday January 29, 2020 @12:13PM (#22183011)
> What's missing until regular websites have parity with mobile apps in functionality?

Performance. But we're beginning to approach performance parity - not by the web becoming an faster, mind you, but by apps becoming slower. It used to be only cheap/poor-quality apps that felt like glorified web pages, but now even many high-profile apps are just parts of a web stack embedded into an app.

Re:Building all of our new mobile apps using React Native by weberc2 on Wednesday January 29, 2020 @12:27PM (#22183209)
Absolutely this. Native apps are just so much smoother, and I say this as someone who really wants the web to win, and who used web apps almost exclusively because my 16GB iPhone 6 had very little space for apps. Also, the quality of native apps was much higher (e.g., Twitter feed doesn’t abruptly jump all over on mobile) although this could just be due to more budget allocation into native apps for whatever reason.
Re:Building all of our new mobile apps using React Native by gargs on Wednesday January 29, 2020 @12:44PM (#22183468)
Not just smoother, native apps done right are interactive at the visual element level.
Re:Building all of our new mobile apps using React Native by weberc2 on Wednesday January 29, 2020 @01:19PM (#22183957)
Can you elaborate on this? I’m not following.
Re:Building all of our new mobile apps using React Native by sciprojguy on Wednesday January 29, 2020 @04:04PM (#22185795)
Native iOS developer here (10 years). Knowing how to leverage UIKit and CoreAnimation properly can give a very smooth UX. SwiftUI has significantly upped the ante on iOS13 and future versions; it's reactive without the middleware layers, and it lets you get your app done (with live view previews) and not have to drag in a pant-load of external frameworks.
Re:Building all of our new mobile apps using React Native by pjmlp on Wednesday January 29, 2020 @12:39PM (#22183387)
It depends pretty much on what the app is all about.

CRUD mobile apps can be made pretty fast when not doing an SPA bigger than Quake just for displaying text.

SSR, pure CSS3, caching, server workers, mobile first, can go a long way.

Naturally there are other kind of apps where native wins hands down, e.g. WebGL vs GL ES 3.2/Vulkan/Metal/DX.

Re:Building all of our new mobile apps using React Native by criddell on Wednesday January 29, 2020 @07:02PM (#22187467)
Performance is about a lot more than speed. I want low battery, CPU, data, and memory usage. That's a lot harder to do in a web app.
Re:Building all of our new mobile apps using React Native by pjmlp on Thursday January 30, 2020 @01:44AM (#22189397)
Plenty of native apps are also not the best example of that, and not being able to control when they really die, including background running tasks, doesn't help.
Re:Building all of our new mobile apps using React Native by asdff on Wednesday January 29, 2020 @10:12PM (#22188543)
It's the native apps that kill my battery, fetching content in the background all the time, not the mobile web which is suspended when I exit safari.
Re:Building all of our new mobile apps using React Native by criddell on Thursday January 30, 2020 @07:30AM (#22190871)
You think if those developers made a web app it would be significantly better?
Re:Building all of our new mobile apps using React Native by yummybear on Wednesday January 29, 2020 @03:50PM (#22185653)
It certainly possible, but there is a lot of arcane knowledge that goes in to the techniques listed. Native apps, generally, has better performance “built in”.
Re:Building all of our new mobile apps using React Native by pjmlp on Wednesday January 29, 2020 @04:10PM (#22185866)
Arcane knowledge? That is pretty basic stuff for anyone doing Web since the HTML 3 days.

Have you ever done native Android, including using the NDK?

It is full of arcane knowledge, scattered about commit comments, medium, G+ and Twitter posts from Android team instead of being on developer.android.com, APIs introduced in one IO are deprecated/replaced by the next IO, OEMs (cough Samsung) that change AOSP behaviours,...

Re:Building all of our new mobile apps using React Native by dmitriid on Wednesday January 29, 2020 @05:50PM (#22186855)
Yes. Web is full of arcane knowledge. Take virtual lists for example: https://news.ycombinator.com/item?id=22186827
Re:Building all of our new mobile apps using React Native by pjmlp on Thursday January 30, 2020 @01:45AM (#22189407)
Unfortunately I can also provide several items of arcane knowledge for Android and iOS.

So should we now measure who wins in arcane knowledge counts?

Re:Building all of our new mobile apps using React Native by dmitriid on Thursday January 30, 2020 @05:09AM (#22190267)
Yes. We could. The web would lose hands down.

The Web lacks even the most primitive of UI primitives that desktop and mobile UI kits have had for decades. Virtual lists is the prime example.

You can't even reliably animate an element independently of other elements without breaking your entire page.

You can't pick an arbitrary group of components and place them in a different location of the page without them breaking in subtle and not-so-subtle ways unless you are extremely careful with your flat global namespace that is CSS. WebComponents solve some of that, extremely poorly.

And the list of things that are taken for granted in the desktop/mobile world is near-infinite. All of them have to be re-created from scratch, poorly, on the web.

Re:Building all of our new mobile apps using React Native by pjmlp on Thursday January 30, 2020 @08:15AM (#22191080)
Sure you can animate, that is what WebGL and SVG allow for.

Ah, like breaking Android UIs when dealing with fragment management or misplaced constraints on ConstraintLayout, usually only solvable after one finds the golden post on medium?

Re:Building all of our new mobile apps using React Native by seemack on Thursday January 30, 2020 @09:53AM (#22191637)
That's not really a fair comparison. I don't think WebGL and SVG allow you to do the type of animation OP is referring to.

Furthermore, ConstraintLayout is a brand-new layout manager. Totally agree that there's bugs in it but nothing that could be called arcane knowledge. Do you have any examples for the actually arcane layout managers? Relative, Layout, etc?

Re:Building all of our new mobile apps using React Native by dmitriid on Thursday January 30, 2020 @10:42AM (#22192115)
> Sure you can animate, that is what WebGL and SVG allow for.

Yeah, sure. Try animating an element without breaking layout. Trying animating an element that gets destroyed (oh, it's impossible, there are no events for when element gets removed). Try smooth animation while changing layout. And so on and so on.

Yeah, sure. If you constrain your entire animation to just the one box of a single SVG/Canvas/WebGL, then you can pretend that everything is fine. In reality when you try to animate anything, you're really constrained to animations that don't force re-flow. So, about 3 of them. And you have to be really careful (transposing an element's position will leave gaps).

Meanwhile both desktop and mobile have hundreds of animations big and small that are either impossible or extremely hard to do in a consistent manner on the web.

Re:Building all of our new mobile apps using React Native by axbytg on Wednesday January 29, 2020 @01:46PM (#22184317)
Agreed. Map performance especially on native is night and day -- 60fps smooth scrolling even with React Native, vs choppy shitiness on the web.
Re:Building all of our new mobile apps using React Native by onion2k on Wednesday January 29, 2020 @04:13PM (#22185887)
You make a fair point but it's one about the current state of apps rather than the future of apps. In the future phones will be more powerful and apps will do mostly the same stuff. In theory that should mean the apps will be faster.
Re:Building all of our new mobile apps using React Native by kllrnohj on Wednesday January 29, 2020 @04:28PM (#22186035)
> In the future phones will be more powerful

Single-core performance is largely topping out. The gains are incremental at best.

Mobile SoCs have gone incredibly multi-core incredibly quickly (6-8 cores are common!). Meanwhile the web is incredibly bad at handling that. JavaScript code still has to fight with the GC for CPU time on the single thread they both occupy. WebWorkers are incredibly heavy & limited.

WebAssembly might have threads eventually (it's on their roadmap), but then how long until that happens and will the typical webapp ever even migrate to webasm?

Meanwhile CSS & DOM performance continues to be poor, so webapps are left in this awkward state of needing to re-write part of the browser.

Hardware isn't fixing any of this. It's been almost a decade of hardware not fixing this at this point.

Re:Building all of our new mobile apps using React Native by adev_ on Thursday January 30, 2020 @12:42AM (#22189137)
> Meanwhile CSS & DOM performance continues to be poor

The DOM is not slow, that is brain washing from React developpers to justify your VDOM.

Most Reactive app performance issue nowadays comes from library bloat loading, network saturation or data dependencies.

The main problem with the DOM is not the performance but the API. The DOM API is not appropriate anymore for a reactive usage with transactional reflows. And this triggers a lot of quirks damaging performance.

Re:Building all of our new mobile apps using React Native by kllrnohj on Thursday January 30, 2020 @12:43PM (#22193395)
> The DOM is not slow, that is brain washing from React developpers to justify your VDOM.

I'm comparing against native apps, not React VDOM vs. DOM. Direct fiddling of widget properties is common & perfectly fast in native apps, even when done naively. The same is not true of the DOM, especially with all its synchronous layout & style resolution foot-guns.

Re:Building all of our new mobile apps using React Native by Brakenshire on Wednesday January 29, 2020 @09:09PM (#22188283)
Web apps need a parallel layout engine, and such a thing exists with Mozilla’s Servo, but they’re for some reason Mozilla using it for WebVR rather than building a functional browser.