Our long term plans (aka by end of 2020) are to rewrite all of our internal tooling from SPA (RiotJS) w/ JSON APIs to server-side Blazor. The principal motivations here are productivity gains. It is a LOT faster to write a razor view in C# with direct invocation of your business logic from view logic, than it is to determine what a clean JSON API contract looks like, write all the boilerplate for controllers, and then play the back-and-forth game between chrome devtools and visual studio with 2 separate debugging contexts. After you write your first LINQ .Where().Select() to populate a table in Blazor, you will truly understand what I am getting at in terms of productivity if you have ever tried to do the same sort of filter->map stuff in JS.
With Blazor, I only need to know C#, HTML, CSS and just enough JS to write a blazorhelper.js interop which reads and writes my session cookies. I set 1 breakpoint in visual studio and it gets hit when I press some button in the browser.
With SPA, I have to be at the top of my JS game, and also pull some SPA framework into my mental context which must then be shared with all of the other C# business logic in scope. I have to manage breakpoints in the browser as well as in visual studio. I have to deal with 10-100x the amount of JS code.
Additionally, we don't even want to move to client-side variants of Blazor for our use case. First request latency and security are the 2 largest motivators for us here. Server-side exposes precisely zero things to the client you didn't want to, as opposed to SPA which makes even unauthenticated clients download your entire application. Also, "the server" is substantially faster these days (even more so going into 2020 on AMD's warpath). For the number of concurrent clients we are anticipating, server-side Blazor is actually our best option in terms of UX.
I would be curious what aspect of Blazor feels immature to you. It is certainly a new(ish) thing, but the fundamental aspects of it (especially server-side mode) have been around for decades and microsoft has leveraged a lot of existing or otherwise proven ideas here. I would agree on the client-side aspect being "immature" relative to server-side, mostly due to WASM and the need to push a very large payload to the client upon first request.
But orcourse those tutorials could be from before the official launch which was just some months ago.
I think Blazor looks a little like Phoenix Live View. And imho this is the way to go. It is way more productive for the reasons you describe as well.
Someone has written a wrapper for Local/Session storage for you, so you don't even need to write your own jsInterop for them: https://github.com/BlazorExtensions/Storage
Blazor has been on my radar for a while. I think it’s architectural choices and workflow are a boon to most developer shops!
Isn't this what GraphQL suppose to solve?
Very interesting experiment though.
Of course this is still an experiment so it's very risky to use it, but it's cool and shows promise.
Edit: Looks like maybe this thread is talking about using Blazor at all instead of within the context of the post, but I what I said still applies so I'll leave it up.
I feel like this is the UI abstraction layer. If you want to run chromium, there is no reason you couldn't extend it.
Code is prime for extending and enhancing.
With Blazor you can also share your models and other code if needed.
1. Webview: https://github.com/zserge/webview
2. Lorca (Chrome): https://github.com/zserge/lorca
3. Carlo (js/Chrome): https://github.com/GoogleChromeLabs/carlo
Electron Pros:
1. Consistent JS runtime/API
Electron Cons:
2. Huge distributions (bundling a full browser)
3. No re-use of components (every app is huge)
Electron Pro?/Con?:
4. Consistent rendering / WebKit monoculture
By the look of it DeskGap keeps Electron's biggest pro and solves its two biggest cons. The only "issue" is that there may be rendering inconsistencies. However, given we want to avoid a WebKit monoculture, I see this as a pro more-so than a con.
With that being said Microsoft have themselves migrated to WebKit; so the WebKit monoculture looks likely regardless. For consistency I guess that's even another tick in DeskGap's corner, although it'd be nice if on Linux (for example) it could use Firefox when present.
Carlo is interesting for a similar reason, but perpetuates the WebKit monoculture.
https://github.com/Boscop/web-view
Made on top of that is Tauri, a cross-platform webview-based app just like WebWindow. The key differentiator being that they are actually committed to continuous development as they’re trying to get established as an open source company.
Please let this be it.
.NET is such a good runtime.
As for IE11, I don't know of any Window 10 user that still uses it instead of Edge.
At the fundamental level such an approach works, but it brings several issues that are not addressed with it (in contrast to, e.g., Electron). The most pressing one being "I don't want any browser - I want a browser that I know is capable of doing what I want".
Edit: Also check out devicePixelRatio, that might be causing the issue as well.
If you don't want to add an external library to do this, or your source is already platform dependent, just use the default web view component of each operating system (WebBrowser for Windows, WKWebView for macOS and WebKitGTK+2 for Linux) like this library does.
To work around some of the ugliness of the old IE rendering engine used in the current WebBrowser control on Windows, just add this meta tag to the HTML file to ensure it uses the new versions of IE to render the UI: <meta http-equiv="x-ua-compatible" content="ie=edge">
You can disable most non-native app behavior in JS (like scrolling or the default right click context menu using javascript). You're then free to use whatever front end framework you want and pass data between the web-app and native code using JSON.
EdgeHTML can be embedded, but only using the WinRT API, not the ActiveX WebBrowser control.
Either go native or go Web, hybrid apps always always feel worse than middleware frameworks.
To make sure I understand how viable this solution is...
> On Windows, WebWindow uses the new Chromium-based Edge via webview2, assuming you have that browser installed (it could fall back on older Edge if you don’t, but I haven’t implemented that)
So this will currently only work for those running the absolutely newest version of Windows 10?
(But if the user does, you get a reasonably up to date and capable web-engine, which sounds good)
> On Mac, it uses the OS’s built-in WKWebView, which is the same technology behind Safari
Sounds decent, I guess?
> On Linux, it uses WebKitGTK+2, which is yet again a WebKit-based technology
Isn't WebKitGTK horribly outdated, or have things improved recently? Couldn't that be a source of issues down the road?
I have been tinkering around with some enterprise solutions for delivering desktop native experience for web based apps.