Live data from Hacker News

Proton Native – React Native for the desktop

proton-native.js.org

221–230 of 295 posts

Re: Proton Native – React Native for the desktop

#221

Earlier quoted context omitted.

NIBs in macOS/iOS are horrible for development and code review. Using a UI to build UI is slow and clunky. There is no "moving past" it. That's a bad way to develop stuff. We don't do it with HTML, do we? No.

Absolutely, most big mobile development teams I know do not use storyboards or NIBs because they are not easily human reviewable. (A small change will rearrange sections for seemlying no reason.)

Who reviews code for UI?

I review design screens and UI/UX workflows with end users.

Re: Proton Native – React Native for the desktop

#222
post #207

Earlier quoted context omitted.

> You're in pretty much every thread that pops up as a naysayer re: not using UIKit/AppKit/etc You got me :) But yes, I'm in a lot of these threads because I do a lot of iOS development and have strong opinions on how iOS apps should work. > The thing about the link you just pointed out is that it's literally 100% UINavigationController. I've used this in projects and had to work with the native source layer - it's n…

I think you are misunderstanding what this is. This literally is UINavigationController, controlled by Apple's JavaScriptCore. If you want extra animations or whatever, you just turn them on . There are some advantages to using native code vs ReactNative, but access to native controls and their behavior isn't one.

Yes, I'm aware of that; I've just finished up writing an treatise in reply to sibling comment that you might want to read.

But in short: yes, you're right. React Native uses native controls, and it's probably the best solution right now. That doesn't make it good enough in my eyes, though. I want apps that I can't tell apart from "real" native ones. With Reactive Native I can do so almost invariably, and it's because someone forgot to "turn on" an animation or whatever. Or it's because they clearly just didn't understand the UI paradigm that iOS enforces. Or it might even be more insidious: React Native was just structured in a way that made easy to do the wrong thing. Whatever it is, it's clear to me that React Native still doesn't match native controls, and no, this isn't because they don't use them. It's that they use them wrong.

Re: Proton Native – React Native for the desktop

#223
post #94

Earlier quoted context omitted.

NIBs in macOS/iOS are horrible for development and code review. Using a UI to build UI is slow and clunky. There is no "moving past" it. That's a bad way to develop stuff. We don't do it with HTML, do we? No.

But you use live reload, no? That's just webshit for an UI editor. WPF has(d?) this figured out. No drag and drop of UI elements (aka "components"); that gets you into "absolute position" hell of Windows Forms. Instead you have a DSL that you use to build the UI with grids and other standardized layout containers and the WYSIWYG view is there mostly as a preview and navigation help. Of course their fatal mistake was…

> No drag and drop of UI elements (aka "components"); that gets you into "absolute position" hell of Windows Forms

Only for those that never bothered to learn how to use Window Forms layouts.

https://docs.microsoft.com/en-us/dotnet/framework/winforms/c...

Re: Proton Native – React Native for the desktop

#224
post #199

> You can create a GUI using something like Qt, but the code to make it is messy and unorganized. Having made a very large GUI myself, it gets very cumbersome to manage all of that. Haven't we moved past writing UIs in code about twenty years ago? I see your code samples, and all they look like is an improved version of the code UI creation we had in OWL, MFC, and other UI frameworks on other platforms. Starting abou…

Form designers produce their own issues like compatibility between versions, poor interactions with source control and poor responsiveness. I don't see an issue with creating UI's in code, with a decent API like Qt and Gtk provide it's quite straightforward. Why should UI code be treated differently to other code?

Because of productivity, and UI/UX workflows while prototyping.

Why should I spend 30 coding something away that is doable in a few seconds with a couple of mouse clicks?

It is not good to generalize, but most coders I have meant without any sense of UI design never used graphical tooling for doing UIs.

Re: Proton Native – React Native for the desktop

#225

Am I the only one who think that this: class Example extends Component { render() { return ( console.log('Hello')}> Button ); } } render( ); is using too many artificial parsing layers ? 1) Like run JS, then there 2) parse JSX that will build virtual DOM, then 3) interpret that vDOM to 4) create physical window. Why not just let app = Application({params}); let window = app.window({url:"content.xml", type: "frame" })…

JSX is JS. While there's technically 'parsing' involved, it's fundamentally just syntactic sugar: import { createElement as e } from 'whatever' return e(App, {}, [ e(Window, { title: 'Example', size: { w: 300, h: 300 }, menuBar: false }, [ e(Button, { stretchy: false, onClick: () => console.log('Hello') }, [ 'Button' ]) ]) ])

No it isn't, in the sense that it's not part of a language spec for JavaScript, like E4X (now deprecated) once was considered to become. But I guess E4X's problem was that it was too far ahead of its time and had XML in its name.

[1]: https://developer.mozilla.org/en-US/docs/Archive/Web/E4X

Re: Proton Native – React Native for the desktop

#226
post #81

Earlier quoted context omitted.

React-Native for WPF already exists. Same repro as React Native for UWP.

> React-Native for WPF already exists. WPF and Win32 are not the same thing.

Your original comment indicated non-UWP or Win32.

Re: Proton Native – React Native for the desktop

#227

Earlier quoted context omitted.

> and now we're making traditional UI dev like web It's been like that on Windows since 2006 with XAML. In fact, if you squint at typical JSX, it looks like XAML. Disclosure: I work at Microsoft.

If you squint at JSX it also looks like JSP…

I refer to JSX as client side PHP.

Re: Proton Native – React Native for the desktop

#228

Earlier quoted context omitted.

Something I would be curious about is what happens when you try to change the view. Like what if you want to make a counter. For me that was always the best thing about react.

I'm not sure what you're asking, but the answer to what I think you're asking is that views change by way of bindings. They can also be changed directly/procedurally, but I'll give an example of a binding. (Think of an Item as a visual component, which can either be referred to by an id or, as I've done here, referred to by its children as "parent".) Item { property int count: 1 Button { height: 30; width: 80 onClick…

Can you have higher order components? In react this is a function that returns a component, often taking another component as a parameter.

What's nice about react is that the JSX syntax is just sugar that converts to function calls.

Re: Proton Native – React Native for the desktop

#229

Earlier quoted context omitted.

...mmhmm, look dude, I do iOS/macOS development as well, and I've corrected you in a few threads around here already. I'm very acutely aware of how UINavigationController works. I've worked on ports of it for React Native, and even ported it backwards to macOS. All the JS in that package is doing is driving the native interactions on an in-memory UINavigationController. I've used this in recent contract work where I…

> All the JS in that package is doing is driving the native interactions on an in-memory UINavigationController. I've used this in recent contract work where I can confirm that the title handling and animations are the same as what you'd get with a stock UINavigationController. That project is not replicating the behavior in JavaScript, contrary to what you seem to be implying - e.g, tapping the status bar does indee…

> I'm aware of that–that's why I said it is possible that you can do it from JavaScript. What I'm saying is that the JavaScript layer generally causes issues like this, because UINavigationController only works in specific cases. For example, scrolling only works if you're a singular top-level scroll view. Getting the titles to animate only works if you don't try to modify it after the fact. Putting a button in the navigation bar's title view just makes it mess up when it runs its first layout pass. A lot of frameworks end up doing this, or making it very easy for this to occur, so you end up with "broken" navigation of the likes seen in that GIF. Of course, it's not unusable, so those who aren't as familiar with how it should work don't notice the difference.

Most of those issues that you bring up with UINavigationController are, while annoying, not actually _that_ common in apps, and people run into them at the native level too - it's not entirely a JS issue. Provided you're not doing anything too against the grain (which the Wix API more or less protects novice users from doing), you're unlikely to experience too many issues and it functions as an almost completely indistinguishable UINavigationController experience for pretty much everyone.

As an aside, if React Native would fix TouchableOpacity to follow platform convention, most people would have difficulty detecting RN apps.

> I'm surprised you haven't drawn the cynical conclusion from this: that I'm desperately trying to keep my skills relevant in a world where they're being increasingly obsoleted...

I didn't draw that conclusion, you're correct - but had it been the case, I really wouldn't have blamed you. I prefer writing [UI|App]Kit day to day and I'd hate to not be able to. I'm more than capable in... just about any programming ecosystem, but they're simply not as enjoyable for reasons that are tough to put into words.

>Wait, are you really telling me to stop "putting down" non-native projects?

No, not at all. I put down Qt all the time myself, but then again, how do you define native? ;)

My point here is that coming into these threads and saying that people should be building native iOS/macOS/etc is a bit of a rough sell, given how nuanced actually developing at the native level for those platforms is (e.g, most people wouldn't know that a UITableView section header is really a grouped row in NSTableView - AppKit is woefully undocumented and cobweb filled in 2018). Apple needs to get their shit together, and maybe that's what Marzipan or whatever is - in fact, I really hope it is.

Until then, there's simply no compelling reason to build native [UI|App]Kit when the writing is on the walls. Instead of fighting this battle, people need to complain (loudly, very loudly) to Apple. Electron & co are not taking over because they're inherently better as an approach, but because native platforms are literally just rolling over.

>it's developers who need to realize that the user is important

This is idealism, and I applaud you for it, but it's honestly misplaced (and I wish it wasn't). The user is only important _when you actually have users_. For most apps these days, time to market and getting it out the door trumps whatever perceived native benefits there are.

I personally build for quality in my projects because it's what I want representing me, and that's sadly about the only justifiable reason these days.

>Sorry, I'm not on Twitter, so I'm not aware of what you're talking about here. Could you provide more context?

Was a bunch of hubbub recently over this article (http://inessential.com/2018/04/25/youre_practically_a_mac_de...), where it boiled down to Xcode/Apple-ecosystem developers decrying alternative approaches (Electron, RN, etc), and more or less saying that it should be easy to just reuse the same stuff for a Mac app. The argument that most non-Xcode/Apple-ecosystem devs made was that Apple:

- Really, really sucks when it comes to Mac/AppKit documentation these days, and discoverability in comparison to the likes of JS and such is nowhere near the same.

- Live reload > compile and run, Swift playgrounds aren't a solution.

- [Almost any JS unit testing framework] > Unit testing in Xcode

The tl;dr = Apple is getting off relatively easily for not keeping their dev environments competitive, and people complaining about Electron & co making inroads should really be complaining at Apple for neglecting this stuff. I tend to agree, as noted earlier... and, hell, it's not even limited to the above points.

For example:

- Why the hell are the Apple forums not scrapped and dumped into a hosted StackExchange? It's 2018.

- Why the hell is Radar still a black hole of information? There are better ways to do this nowadays.

- Why the hell is so much of Cocoa & AppKit completely un-Google-able? Half the time you try to find something, you wind up in an archived email thread from the early 2000s. There is no way a new developer is going to put up with this crap in 2018. Shit, if it wasn't for NSHipster transcribing WWDC videos we'd still be sitting there watching video content just to understand a programming ecosystem.

- Why the hell does every Cocoa/AppKit dev put all their stuff on Twitter these days? They're just as responsible as Apple at this point. The JS community documents the everloving bajeezus out of their projects, whereas the only mention you'd find about, say, NSCollectionView frame/bounds change notifications is on Twitter. Nothing from Twitter is easily found in Google.

- This list could go on - e.g, why the hell are we _still_ dealing with Cells in AppKit for things like a TextField? We got rid of them for NSTableView, fix the rest already.

What's really painful about all of this is also that Apple is clearly capable of doing better - Swift alone is a massive improvement in how they've communicated, built, and shipped a developer oriented product. People not holding them accountable and instead expecting the developer community to bend over backwards and build for an aging platform is insanity, especially when this is the most valuable company in the world that we're discussing.

* = Edits are formatting attempts, because... well, this is another platform that could modernize a bit.

Re: Proton Native – React Native for the desktop

#230
post #149

>You can create a GUI using something like Qt, but the code to make it is messy and unorganized. It doesn't serve the author well to make this comparison. Saying it's less messy to manage Proton/React source code files and the associated Node/JS/etc infrastructure is an extremely dubious claim. One of the things I like best about Qt is how non-messy Qt development is. Most everything (source files, resources, etc.) l…

And if we want to compare the syntax then this would be the QML equivalent: import QtQuick 2.9 import QtQuick.Controls 1.3 ApplicationWindow { title: "Example" visible: true width: 300 height: 300 Button { text: "Button" anchors.centerIn: parent onClicked: console.log('Hello') } }

Wow. Thanks for posting that, as an outsider I had no idea QT was so .. straightforward. Now I want to check it out more.
Post reply on HN