Live data from Hacker News

Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

proton-native.js.org

11–20 of 37 posts

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#12
post #9
post #8

> But those components are not native, meaning they are drawn by Qt instead of using the components provided by the OS. In the case of macOS, this is no longer true - when Apple finally kicked Carbon fully, Qt (IIRC, in 5.13 or something? 5.12 and prior used HIThemes, which was... showing age) switched to rendering true AppKit behind the scenes. There's a few custom controls where they render their own, if no AppKit…

Hm, are you sure about that? The documentation[1] for 5.14 still says it uses HIThemes for drawing: "As with Cocoa and Carbon, Qt provides widgets that look like those described in the Human Interface Descriptions. Qt's widgets use HIThemes to implement the look and feel. In other words, we use Apple's own APIs for doing the rendering." I guess the documentation could be outdated, but changing over from drawing nativ…

You're right that we no longer use HITheme to render the macOS style for Qt Widgets, we use AppKit. But it's used to render into pixmaps, so we're not actually wrapping native NSViews.

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#13
post #2

Proton Native is a way to make cross-platform desktop apps with React, without using Electron or any sort of web browser. Your React code gets translated into Qt or wxWidgets API calls and runs directly on the machine. After a long time, Proton Native V1 was starting to show it's age. So I ended up making a complete rewrite that includes a lot of the most requested features including flexbox, styling, hot reloading,…

Any chance of supporting a library agnostic approach, such that developers could use vanilla JS or a framework of their choice?

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#14
post #2

Proton Native is a way to make cross-platform desktop apps with React, without using Electron or any sort of web browser. Your React code gets translated into Qt or wxWidgets API calls and runs directly on the machine. After a long time, Proton Native V1 was starting to show it's age. So I ended up making a complete rewrite that includes a lot of the most requested features including flexbox, styling, hot reloading,…

First off, well done, this looks like a good initiative and you've clearly worked hard on it!

My main question is about app size. Once one has fully built an app and is ready to distribute it to users... how does the file size compare to an Electron app?

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#15
post #12
post #9

Earlier quoted context omitted.

Hm, are you sure about that? The documentation[1] for 5.14 still says it uses HIThemes for drawing: "As with Cocoa and Carbon, Qt provides widgets that look like those described in the Human Interface Descriptions. Qt's widgets use HIThemes to implement the look and feel. In other words, we use Apple's own APIs for doing the rendering." I guess the documentation could be outdated, but changing over from drawing nativ…

You're right that we no longer use HITheme to render the macOS style for Qt Widgets, we use AppKit. But it's used to render into pixmaps, so we're not actually wrapping native NSViews.

Ah! Learn something new every day.

My knowledge of that came from digging through the source code over the course of the changes. Great to hear from someone more involved with it - and also, great job on the approach, really glad to see it!

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#16
post #13
post #2

Proton Native is a way to make cross-platform desktop apps with React, without using Electron or any sort of web browser. Your React code gets translated into Qt or wxWidgets API calls and runs directly on the machine. After a long time, Proton Native V1 was starting to show it's age. So I ended up making a complete rewrite that includes a lot of the most requested features including flexbox, styling, hot reloading,…

Any chance of supporting a library agnostic approach, such that developers could use vanilla JS or a framework of their choice?

The library is already built to be largely library agnostic. To add a new library, just add a file that translates my calls to the library calls. This is how I achieved both Qt and wxWidgets backends.

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#17
post #14
post #2

Proton Native is a way to make cross-platform desktop apps with React, without using Electron or any sort of web browser. Your React code gets translated into Qt or wxWidgets API calls and runs directly on the machine. After a long time, Proton Native V1 was starting to show it's age. So I ended up making a complete rewrite that includes a lot of the most requested features including flexbox, styling, hot reloading,…

First off, well done, this looks like a good initiative and you've clearly worked hard on it! My main question is about app size. Once one has fully built an app and is ready to distribute it to users... how does the file size compare to an Electron app?

The only thing that meaningfully contributes to the size of the app is the size of the GUI library libraries. It currently bundles both Mac and Windows, so you can build packages for each and remove the libraries you don't need. It should be around 50 MB maximum.

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#18
post #2

Proton Native is a way to make cross-platform desktop apps with React, without using Electron or any sort of web browser. Your React code gets translated into Qt or wxWidgets API calls and runs directly on the machine. After a long time, Proton Native V1 was starting to show it's age. So I ended up making a complete rewrite that includes a lot of the most requested features including flexbox, styling, hot reloading,…

> ...requested features including flexbox, styling, hot reloading, and components with the same API as React Native.

That sounds like the way to go for a near 1:1 port of a cross-platform desktop app for React-based apps. Also the move from libui to Qt for the UI backend sounds interesting for this project to be used as a lightweight alternative to Electron.

To be a true alternative to Electron one must provide a simple migration path for existing Electron apps to Proton Native which would change everything in cross-platform desktop app development.

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#19
post #2

Proton Native is a way to make cross-platform desktop apps with React, without using Electron or any sort of web browser. Your React code gets translated into Qt or wxWidgets API calls and runs directly on the machine. After a long time, Proton Native V1 was starting to show it's age. So I ended up making a complete rewrite that includes a lot of the most requested features including flexbox, styling, hot reloading,…

This is incredible! Last semester I had my undergraduate software engineering class make Electron apps as group projects but I've been looking for alternatives. I'll try this out and let you know how it goes!

Re: Show HN: Proton Native V2 – Create Cross Platform Desktop Apps with React

#20
Similar to https://github.com/gabrielbull/react-desktop but with Linux support, that's great.

I hope this gets more traction than the react-desktop project.

Super curious: How does an app built with Proton Native fares against an Electron base app when ti comes to RAM and CPU?

Post reply on HN