Steve Sanderson (creator of Blazor) is working on something similar that doesn't use Electron: https://blog.stevensanderson.com/2019/11/01/exploring-lighte... From Blazor roadmaps a few months ago, I think the idea is that Blazor will become the recommended .NET Core cross-platform UI choice sometime after .NET 5.
One of the comments on that blog leads to WinUI, which I would assume Microsoft would recommend first https://github.com/microsoft/microsoft-ui-xaml/blob/master/d... Not sure if it's cross-platform though.
ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
31–40 of 87 posts
Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#32This is a great step forward, but it seems like a great deal of overhead and complexity to have a cross-platform GUI. If I were creating a new cross-platform desktop application I would probably reach for Java instead. I know that's not the popular answer, but if a .NET Core cross-platform GUI requires either using Electron or simulating a client-server setup with Node then it's not there yet. To illustrate, here is…
Good luck getting that Swing app to look nice, though. Which is a breeze with HTML/CSS.
Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#33This is a great step forward, but it seems like a great deal of overhead and complexity to have a cross-platform GUI. If I were creating a new cross-platform desktop application I would probably reach for Java instead. I know that's not the popular answer, but if a .NET Core cross-platform GUI requires either using Electron or simulating a client-server setup with Node then it's not there yet. To illustrate, here is…
Swing is probably the wrong choice if youre going java. I do electron everyday for work and we use stdin/stdout to farm json to a Java process as well. Given the chance I would probably use JavaFX over Electron or Swing. The FX app will be easier to style than swing and Gluon just announced native compilation support via Graal for new FX apps [0]. [0] https://gluonhq.com/gluon-substrate-and-graalvm-native-image...
I gave the Swing "Hello World" example because it shows a minimal, simple example of how little code is needed to create cross-platform GUI in Java.
JavaFX is also technically an external library now since Oracle spun out JavaFX to OpenJFX and Gluon has taken over development and maintenance, although many but not all OpenJDK distributions include it.
Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#34Earlier quoted context omitted.
Good luck getting that Swing app to look nice, though. Which is a breeze with HTML/CSS.
Swing can look fantastic if you put in the effort as IntelliJ (based on Swing) shows. I'm not necessarily an IDE guy, but good luck with getting that kind of functionality with JS on Electron even remotely.
That said I haven't touched their IDEs in 2 years so maybe something changed.
Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#35Earlier quoted context omitted.
Swing is probably the wrong choice if youre going java. I do electron everyday for work and we use stdin/stdout to farm json to a Java process as well. Given the chance I would probably use JavaFX over Electron or Swing. The FX app will be easier to style than swing and Gluon just announced native compilation support via Graal for new FX apps [0]. [0] https://gluonhq.com/gluon-substrate-and-graalvm-native-image...
I agree with you. JavaFX is better than Swing for most use cases. I gave the Swing "Hello World" example because it shows a minimal, simple example of how little code is needed to create cross-platform GUI in Java. JavaFX is also technically an external library now since Oracle spun out JavaFX to OpenJFX and Gluon has taken over development and maintenance, although many but not all OpenJDK distributions include it.
class HelloWorld : View() {
override val root = HBox(Label("Hello world!"))
}
class HelloWorldApp : App() {
override val primaryView = HelloWorld::class
}
I've bee conflicted in my research on choosing Tornado or default JavaFXRe: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#36Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#37Steve Sanderson (creator of Blazor) is working on something similar that doesn't use Electron: https://blog.stevensanderson.com/2019/11/01/exploring-lighte... From Blazor roadmaps a few months ago, I think the idea is that Blazor will become the recommended .NET Core cross-platform UI choice sometime after .NET 5.
Instinctively this does seem better than Electron as a solution. It's much leaner, isn't subject to the browser sandbox, and should be consistent across platforms - so it ticks the same boxes in a leaner package. I just don't think Electron is a solution we should try to emulate elsewhere.
Most Electron apps that I've seen don't really need access to the underlying platform, and as a user I really don't want to trust the author with native access to the platform where it's not obviously necessary. Even where it is necessary I have no real granularity as regards the permissions I'm handing over.
PWA's are dismissed more or less out-of-hand in the article but they're pretty much what it goes on to suggest, just with compromises.
Electron (or an Electron-but-leaner approach) gives us this:
- Common platform for offline applications that run in a browser engine.
PWA's give you that, and also this:
- Permissions system for out-of-the-ordinary platform requirements that (1) have API consistency across devices and (2) that the user has visibility and granular control over.
- Updates are managed inherently by the nature of the open web (reload page, service worker updates).
- No seperate framework to install for JS, but if a framework needs to be bundled (e.g. for .NET Core) it can be cached between applications similarly to if it were installed on the computer seperately.
Honestly I think PWA's over WebAssembly and the open web is a much better fit for this.
People complain about Electron not being available on mobile devices and things like Chromebooks, but the reason for that is because there's a better solution already in place:
Websites pinned to the home screen.
They're a webview without window chrome that can request access to perform most tasks you might want to do with Electron, but inside the sandbox.
The only thing I can think of that needs platform access and is commonly built on Electron is code editors, and even then only to run and debug command line applications that are running seperately on the platform. For almost every other type of application I've seen on Electron it would be better as a PWA.
Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#38Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#39Earlier quoted context omitted.
Swing can look fantastic if you put in the effort as IntelliJ (based on Swing) shows. I'm not necessarily an IDE guy, but good luck with getting that kind of functionality with JS on Electron even remotely.
I wouldn't say IntelliJ's stuff looks -good-. It's a lot more workable than most Swing apps but it's still a long way from looking "good". That said I haven't touched their IDEs in 2 years so maybe something changed.
Re: ElectronCGI – A Solution to Cross-Platform GUIs for .NET Core
#40Earlier quoted context omitted.
I agree with you. JavaFX is better than Swing for most use cases. I gave the Swing "Hello World" example because it shows a minimal, simple example of how little code is needed to create cross-platform GUI in Java. JavaFX is also technically an external library now since Oracle spun out JavaFX to OpenJFX and Gluon has taken over development and maintenance, although many but not all OpenJDK distributions include it.
Makes sense. The tornadofx hello world is pretty minimal too: class HelloWorld : View() { override val root = HBox(Label("Hello world!")) } class HelloWorldApp : App() { override val primaryView = HelloWorld::class } I've bee conflicted in my research on choosing Tornado or default JavaFX