Live data from Hacker News

React Native for Windows and Mac

microsoft.github.io

311–320 of 505 posts

Re: React Native for Windows and Mac

#311

Earlier quoted context omitted.

The web has become truly awful and it’s invading desktop apps. We need to refactor our technology stack.

Most native apps I've downloaded are well into tens or hundreds megabytes. I just tried a few big popular sites with caching off and none of them downloaded more than a couple megabytes of javascript. I'm really skeptical of the popular wisdom around here that web dev is doing something especially egregious when it comes to build sizes or dependencies.

Slack: usually ~300MiB of RAM for one account. The Ripcord [1] Slack/Discord client written in C++ and Qt: currently using 33MiB. Qt is not the native toolkit on Windows/Mac, but Qt apps typically follow platform conventions far better than Electron apps.

This also voids the argument "we need Electron, because it reduces development costs, and we can get truly cross-platform apps". Ripcord is written by a single indie developer and runs on Windows, Mac, and Linux. Imagine what could be done if Slack employed a team with 10 Qt developers.

Most web apps are egregious. The problem is that there is a whole generation that is not exposed to Delphi or Qt Designer and have the false believe that developing web apps is an order of magnitude easier. It's only an order or magnitude easier for them, because web tech is the only thing they know. Heck, I was writing GUI apps as a 12y/o with Delphi.

[1] https://cancel.fm/ripcord/

Re: React Native for Windows and Mac

#312
post #88

Earlier quoted context omitted.

Any large financial services company you're working with is already deploying sensitive apps on Node, for what it's worth.

Right, but they’re probably mirroring dependencies locally, scanning them regularly, and have a process for adding new ones that isn’t “npm works on my desktop”.

Cute, no they don't. Speaking from experience. It's a shit show.

Re: React Native for Windows and Mac

#313

Earlier quoted context omitted.

No, React Native still uses Javascript, not “native code”. It’s different in that it doesn’t use HTML or CSS (which is a major difference, sure).

It uses a combination of both JS and native code. That JS that RN calls ultimately makes calls out to native Andriod and iOS (and Windows, and macOS) APIs that are compiled to Java and ObjC/Swift (and, I assume, C#?). All of RN's targeted platforms leverage scripting bridges for JS, but only a portion of the actual running code is JS, the part that's native is (usually, but not exclusively) generalized.

It uses a combination of both JS and native code. That JS that RN calls ultimately makes calls out to native Andriod and iOS (and Windows, and macOS) APIs

Exactly like a web browser.

only a portion of the actual running code is JS

“Only a portion” meaning your entire React application! The native parts are the RN framework, any native libraries you’re using, and any native code you’ve added yourself.

What RN brings to the table, as compared to a browser, is a different layout model that’s simpler than the DOM and maps a bit more closely to native widgets.

It also has APIs for sending messages back and forth between JS and native code. That’s also possible with WebViews on all platforms, but RN has a more consistent API (at least on the JS side), so a decent amount of native bindings have been written by third parties.

Re: React Native for Windows and Mac

#314

Earlier quoted context omitted.

> As an end user why do I care about "openness"? If I pay a premium for my platform, why would I want second rate cross platform software? Falsehoods HNers believe about how people buy/use software. Didn't stop Slack/Discord from become ubiquitous. "But native tho" just becomes a circlejerk. Talking about what users care about, most people don't know what native means nor if a given app is it. They don't know if Zoom…

Let's not forget that MS Teams has more paying users than Slack.... How many people know that Slack is battery draining monstrosity? The only people that pay for Slack are companies. The definition of Enterprise Software is where the user is not the customer.

[deleted]

Re: React Native for Windows and Mac

#315

Earlier quoted context omitted.

> As an end user why do I care about "openness"? If I pay a premium for my platform, why would I want second rate cross platform software? Falsehoods HNers believe about how people buy/use software. Didn't stop Slack/Discord from become ubiquitous. "But native tho" just becomes a circlejerk. Talking about what users care about, most people don't know what native means nor if a given app is it. They don't know if Zoom…

Let's not forget that MS Teams has more paying users than Slack.... How many people know that Slack is battery draining monstrosity? The only people that pay for Slack are companies. The definition of Enterprise Software is where the user is not the customer.

MS Teams is an Electron app too. This very post is about React Native for Windows and Mac, which are being developed by MS because they're used for the front-ends of much of the rest of Office 365. Microsoft clearly thinks that it's worth rewriting large parts of their crown jewels using cross-platform frameworks.

Re: React Native for Windows and Mac

#316

Excuse my ignorance. What's new about this? I thought React Native was already a thing?

React Native at least only advertises that it only supports Android + iOS, whereas this adds "PCs, tablets, 2-in-1s, Xbox, Mixed reality devices, etc., as well as the MacOS desktop and laptop ecosystems"

Thanking you kindly!

Re: React Native for Windows and Mac

#317

Earlier quoted context omitted.

React doesn't suffer from this. It's React Native.

In theory, that is. Since it doesn't include batteries, the controller, the wheels, or the antenna you're gonna end up bringing a ton of dependencies yourself to cover the missing parts (animation, state management, routing etc). Plus you're not seeing the dev dependencies, a more apt comparison would be to create-react-app.

Since it doesn't include batteries, the controller, the wheels, or the antenna you're gonna end up bringing a ton of dependencies yourself to cover the missing parts (animation, state management, routing etc).

Or not. I've worked on plenty of applications that had few if any dependencies for those things. I'm sure many others have too.

In some cases that was because we didn't need that particular functionality. Routing has little value if you're building an in-house SPA that always starts from the same dashboard anyway, for example.

In other cases, it's because we're programmers and don't import entire library ecosystems to do what we could do ourselves with a few lines of code or some APIs that are already supported by all modern browsers anyway.

I liked React when it first arrived, because it was a tool that was that did one useful job and did it reasonably well. I dislike the direction it's taken more recently, because it now seems to be trying to do several jobs and not doing most of them very well at all. I understand that this is partly because of the way some developers coerced React into doing things it wasn't really suitable for and the React dev team have been responding to that, but I still think value has been lost in that process.

Re: React Native for Windows and Mac

#318

Earlier quoted context omitted.

Why does it have to be sad? When software becomes easier to develop, it enables everyone to benefit. More developers, more applications of software. At the same time, performance has a tangential relationship with computer code being interpreted or compiled to native. After all, Java is compiled to byte code and powers plenty of high traffic servers efficiently. Many AAA games use ActionScript, Python, Lua, etc for t…

After all, Java is compiled to byte code and powers plenty of high traffic servers efficiently. How well has Java done on the client in the last two decades? Many AAA games use ActionScript, Python, Lua, etc for their UIs and scripting for mods. What's the actual performance sensitive parts written in?

I don't think anyone is suggesting writing game engines or the core of graphics processors or video renderers in React Native. It's for the frontend. The pattern of using React Native for the frontend and native moduels for the backend is a pattern being used by many companies. The difficult stuff can be written as a native cross platform library, while the front end can use React Native. This is what MS is doing with Office.

Re: React Native for Windows and Mac

#319
post #305

Earlier quoted context omitted.

Right, each time a new project is created it contributes to global warming. The entire dependency matrix is what impacts normal development workflow, e.g. everytime I tried to update an old Webpack SPA project there would be always something that was broken that I'd have to hunt down & fix. > No idea about React Native. The OP suggests it's worse. But I no longer use React Native as I kept running into bugs & UI issu…

Flutter itself seems nice, but Dart as a language is a pretty big downgrade from TypeScript. For mobile right now, the easiest, most headache-free solution may actually be to forget about cross-platform and just do separate Android and iOS native apps. You won't need to do things like hunt for a bunch of 3rd party libraries whenever you need to use Bluetooth or something. Once SwiftUI and Jetpack Compose mature, that…

> Flutter itself seems nice, but Dart as a language is a pretty big downgrade from TypeScript.

It definitely isn't, Dart is an advanced clean, strongly typed classical language without JS's warts that's just as clean & productive with a clean complete & well-defined standard library, native support for modules, consistent async/await in all libraries, etc.

I love TypeScript, but it's major productivity advantage over Dart is in JS's dynamism, something that's a lot more restrictive in Dart because it needs to support AOT, which is what allows it to compile to native code & advanced linking + tree-shaking, resulting in its better performance. So there are areas where you need to use code-gen, but having wasted an eternity trying to diagnose runtime issues in C#/Xamarin in libraries that use reflection, I'd much rather use an AOT language that only provides language features that natively supports AOT then running into frequent on-device issues that only occur at runtime.

> For mobile right now, the easiest, most headache-free solution may actually be to forget about cross-platform and just do separate Android and iOS native apps.

Nope, Flutter's Reactive UI & live-reload is far more productive then developing using native iOS or Java/Kotlin tools (which can also be used in Android Studio). SwiftUI is close if you just need to develop for iOS, but I find Dart/Flutter to be a lot more productive than using Swift & Xcode's woefully poor tooling support.

Re: React Native for Windows and Mac

#320
post #156

Earlier quoted context omitted.

Today I installed an Electron-based terminal emulator and started seriously questioning my life choices.

I have the opinion that UI should not be async - meaning if there is some processing going on, UI elements should be disabled from interaction until the function returns. If it is a web query, I think that's fine. When applications start adding queues and jobs, UI feels "springy" instead of "snappy". User is waiting for some feedback of how long something is going to take, instead the user assumes that job is done (d…

Yes! Obviously long-running operations should be asynchronous, but the assumption that all operations should be treated as long-running is wrong. Specifically, typing feedback and button feedback should be synchronous, and should be done directly in the UI loop.

I understand the rationale for going async -- you can never be sure exactly how long anything will take, and invisible things like memory management and caching can blow up your runtime; and if you get synchronous operations wrong, that leads to spinning beach ball cursors and “app not responding” errors, which are even worse than lag. But in that scenario, an async app isn’t going to perform any more usefully, you’ll just get a blank or frozen screen instead of a beach ball.

Post reply on HN