Live data from Hacker News

React Desktop – React UI Components for OS X El Capitan and Windows 10

github.com

51–60 of 74 posts

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#51
post #47

Earlier quoted context omitted.

>> "JS is an ugly language" >> "riddled with complex JS" If you pick a technology by the aesthetics of the language, I'm pretty sure you'll make a bad decision no matter what. Not you like in you, but in principle. :) The code is clean if you write it well. Ugly code comes in all parentheses positions.

>> "JS is an ugly language" What I meant: > "JS is an ugly language, with way too many pitfalls." IMHO it's ugly from 'within', just look at the JS truth table [1] and video I linked with the quote [2]. I just feel that I have no control of what I am doing with JS. It's quite a paradox, that new people to programming, can get start quick with JS, though are not repelled how easily you can shoot yourself in the foot w…

The link you provided to demonstrate the problem also gives you the solution:

> Moral of the story: > > Always use 3 equals unless you have a good reason to use 2.

Tools like ESLint make it easy to enforce this (and to only allow == in the few cases where those good reasons apply).

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#52
post #7

The widgets aren't native, which would be about a thousand times cooler. They are fakes made out of CSS.

Here’s a real reactive-native for desktop OS X Cocoa I found: https://github.com/ptmt/react-native-desktop Currently just "hacking weekend" level maturity. https://github.com/facebook/react-native/issues/247#issuecom... I have never actually tried it, but this one is real native controls. It’s on my TODO list…

This is great stuff!

Wonder if once Swift is open-sourced we'll see a library like that in Swift. Imagine writing React code in Swift and rebuilding that for Windows!

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#53
post #20

Earlier quoted context omitted.

Because working with things like GTK and QT is horrible compared to working with HTML/JS/CSS, for anything other than trivial things. That said, it'd be cool to have native code generation from this though.

Have you used Qt and QML? For me it's much more productive and straightforward than html/js/css. Delarative legible ui with built in dataflow/reactive properties. Performs straight out of the box without having figure out how to work with the mechanisms buried in this hugely complex and opaque machine called a browser. In fact its a relief to work with it. Could you say where you think its so 'horrible'.

Although I've never had to start from scratch, the Qt projects I've maintained have been prone to crashing.

Maybe the Qt apps have legitimate bugs but the fact is that native environments like Objective-C, and most likely this JavaScript environment, would both handle those issues very cleanly compared to Qt.

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#54
post #51
post #47

Earlier quoted context omitted.

>> "JS is an ugly language" What I meant: > "JS is an ugly language, with way too many pitfalls." IMHO it's ugly from 'within', just look at the JS truth table [1] and video I linked with the quote [2]. I just feel that I have no control of what I am doing with JS. It's quite a paradox, that new people to programming, can get start quick with JS, though are not repelled how easily you can shoot yourself in the foot w…

The link you provided to demonstrate the problem also gives you the solution: > Moral of the story: > > Always use 3 equals unless you have a good reason to use 2. Tools like ESLint make it easy to enforce this (and to only allow == in the few cases where those good reasons apply).

I think we are getting into deep rant, though I want to say, that even I know this rule of JS (always use 3 equals, unless you know why you need 2) why not make double equal work as triple one?

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#55
post #40

Man it's great to see effort being put into a platform-sensitive React component set. We've been working on React components for N1, and it'd be cool to swap them out for an open source set one day. The thing is, I'm not sure 100% native appearance is the way to go. I think Spotify nailed a cross-platform desktop experience using a UI that is distinctly non-native. For folks just learning about Electron / web-based d…

Didn't we go round this with Java? Round 1: AWT. Uses the native widgets. Therefore the layout is slightly different on different platforms. Round 2: Swing. Cross-platform identical, and therefore looks nothing like native apps. You could 'skin' it, at which point it would look native but behave subtly differently. Round 3: SWT. Back to native widgets for Eclipse. Round 4: Everyone throws up their hands in despair an…

I think part of the reason that it might be different this time round is because using web technologies for desktop applications gives access to a much broader pool of UI/UX talent to help build something that works well and looks nice. Applications built with web technologies are already looking noticeably better than anything you get with a cross-platform UI toolkit without putting in a lot of effort.

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#56
I could see this being used in a desktop app using Chrome Embedded Framework or some embedded browser framework. Even if you are using HTML to generate views for your Desktop app, it could be very useful to use native-looking widgets to blend in.

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#57
post #4

Please forgive the simple question, but... Why does this exist? Is creating desktop programs out of HTML code really a good idea?

You're probably not familiar with Atwood's Law[0]:

> Any application that can be written in JavaScript, will eventually be written in JavaScript

[0]: http://blog.codinghorror.com/the-principle-of-least-power/

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#58
post #22

Earlier quoted context omitted.

Because NodeJS is popular and desktop apps were getting small and efficient so we crammed a 30MB Chrome runtime in there.

+1 With all respect to leichzeit0 comment, IMHO, JS is an ugly language, with way too many pitfalls [0]. Even big boys [1] use CoffeScript to transpile into JS. JS for cross platform desktop development may be an easy thing to manage, though it can become unusable and clunky super fast. You can spot JS desktop apps, just by the size of executable, which is at least 5-10 times bigger than you could expect (Spotify - 1…

Coffeescript is a compiler/transpiler and Babel does a much better job of doing it, Javascript has all the requirements you want in the "Next Big Language", dynamic languages will have pitfalls, implementing type coercion and lexer/parser optimization are the reason for some of the "wat" stuff in that video, if the speaker made a a popular language like javascript he would have a better understanding of why some of those pitfalls end up existing

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#59
post #22

Earlier quoted context omitted.

Because NodeJS is popular and desktop apps were getting small and efficient so we crammed a 30MB Chrome runtime in there.

+1 With all respect to leichzeit0 comment, IMHO, JS is an ugly language, with way too many pitfalls [0]. Even big boys [1] use CoffeScript to transpile into JS. JS for cross platform desktop development may be an easy thing to manage, though it can become unusable and clunky super fast. You can spot JS desktop apps, just by the size of executable, which is at least 5-10 times bigger than you could expect (Spotify - 1…

I actually find that Spotify is a good example of a well made JS desktop app:

_ I used it on Windows, OSX and several Linux distros and really like the fact that the experience is the same everywhere.

_ No notable performance issues even with modest configs. It's been always usable in my experience.

_ Install size is on par with its competitors

_ Never noticed battery draining but I'll probably keep an eye out for this one now that you made me think about it :) I really doubt that a normal user would notice a difference.

Concerning code maintenance, it would be interesting to hear the opinion of someone who worked on such a complex desktop hybrid app.

Re: React Desktop – React UI Components for OS X El Capitan and Windows 10

#60
As long as we're just talking about skins and not true native desktop behavior, I'd like to see someone port such nice styles to FLTK [0] boxes. FLTK moves you back to C++ bindings relative to an Electron-based solution, but you'd get the same "looks native but not really" and layout portability tradeoffs in a tiny, undeniably mature library.

[0] - http://www.fltk.org/index.php

Post reply on HN