Live data from Hacker News

Ask HN: Is a React Native like approach to desktop apps better than Electron?

news.ycombinator.com

21–28 of 28 posts

Re: Ask HN: Is a React Native like approach to desktop apps better than Electron?

#23

Earlier quoted context omitted.

That's pretty much what React Native is, but using JS as the control and React's declarative API.

I thought React ran in-process for native apps.

No, the React process and JS engine run on a separate thread from the main UI thread. The JS thread just passes messages to functions defined natively on the main thread. A lot of this is abstracted away in the components themselves.

Re: Ask HN: Is a React Native like approach to desktop apps better than Electron?

#24
post #10
post #9

Earlier quoted context omitted.

Huh? There are thousands of successful apps doing exactly that. The browsers Electron builds upon are the prime example!

How so? They are rendering HTML, not native elements.

They probably mean the underlying browsers like chrome or Firefox.

Re: Ask HN: Is a React Native like approach to desktop apps better than Electron?

#25

Earlier quoted context omitted.

I thought React ran in-process for native apps.

No, the React process and JS engine run on a separate thread from the main UI thread. The JS thread just passes messages to functions defined natively on the main thread. A lot of this is abstracted away in the components themselves.

Yes different threads, same process.

If you wanted to use React to render a view for a Golang controller, you’d have to embed a JavaScript engine in your Go process or vice-versa. That’s why I like the idea of a multi process desktop UI kit that coordinates with the renderer via pipes. You could actually use React to do the rendering in this case as well.

Re: Ask HN: Is a React Native like approach to desktop apps better than Electron?

#26
post #3

It can be in theory, but in practice managing native widgets across all major platforms is such a mammoth project that it's almost impossible. People have been trying for decades, rarely with success.

You could say that's why web won. OP should ask (and perhaps share with us) why the native widgets are important, genuinely interested!

Re: Ask HN: Is a React Native like approach to desktop apps better than Electron?

#27

Earlier quoted context omitted.

No, the React process and JS engine run on a separate thread from the main UI thread. The JS thread just passes messages to functions defined natively on the main thread. A lot of this is abstracted away in the components themselves.

Yes different threads, same process. If you wanted to use React to render a view for a Golang controller, you’d have to embed a JavaScript engine in your Go process or vice-versa. That’s why I like the idea of a multi process desktop UI kit that coordinates with the renderer via pipes. You could actually use React to do the rendering in this case as well.

Yeah, I think the React Native implementations being intra-process has only been a function of mobile OS's sandboxing requirements. A macOS / Windows / Linux application can feel free to separate the processes, which I agree does sound nicer on the surface.

Re: Ask HN: Is a React Native like approach to desktop apps better than Electron?

#28

Earlier quoted context omitted.

I googled for Blink and couldn't find what I think you might be referring to. Would you mind dropping a link to Blink?

The blink rendering engine inside chrome?

yep
Post reply on HN