Comment by wg0
2 years ago
This is amazing... I am much away from .NET world so can someone elaborate how does it get from C# to browser?
All I see is this main.js[0] and everything is drawn on a canvas! (probably explains why text is not as sharp as I remember back in the day)
There's a bootstrap loader at https://bandysc.github.io/AvaloniaVisualBasic6/_framework/do... which downloads the application, which has been compiled to WASM, and the dotnet runtime. Which is why it takes so many seconds to first page view.
The Avalonia framework is a third party UI toolkit.
> Which is why it takes so many seconds to first page view
I'm seeing a long load time in Firefox but in Chromium, loading takes maybe a second. Loading the entire .NET runtime isn't exactly lightweight, but it seems there's also some kind of browser engine problem in my Firefox setup that slows this page down artificially.
I must say I'm impressed that this approach even works with only 16MiB of data transferred over the line (though that 16MiB decompresses to about 50MiB).
They seem to be using this framework: https://github.com/AvaloniaUI/Avalonia
Avalonia aims at compatibility with Windows Presentation Framework (WPF) XAML. The web platform is explicitly supported: https://avaloniaui.net/platforms#wasm. The VB Form model must be implemented on top of this. This is for the UI part.
Now for the code part, the dotnet toolchain has supported WebAssembly (wasm) generation for some time: https://devblogs.microsoft.com/dotnet/extending-web-assembly... I suppose the C# code is translated to MSIL then wasm.
> text is not as sharp as I remember
Something interesting is that the top bar text (File, Edit, etc.) is a little bit blurry, but when I click on one of them (e.g. File), the drop down text (e.g. New Project) is completely crisp with no antialiasing.