Uno Ports Code to Multiple Platforms, Including WebAssembly
More tools are coming online to support porting one code base to multiple platforms. Last week, The New Stack shared the newest: .NET MAUI.
But .NET MAUI is new, with all the potential problems that implies, and it doesn’t support Linux or WebAssembly. Developers impatient for those issues have another option: Uno, an open source UI platform for .NET.
“Fom a single codebase, using C#, we’re able to create a native app for all platforms where .NET runs today,” said Francois Tanguay, CEO of Uno. “Some of our biggest differentiators on the UI side is the fact that we’re able to run on web with WebAssembly, but also run on Linux, for example, on IoT (internet of things) devices.”
Native Apps from One Code Base
Uno works by sitting on top of the native frameworks for each individual platform, Tanguay explained. It bridges the Windows UI as an API to all the native platforms, he said. But it still uses the .NET runtime.
“We’re leveraging all of the runtime work they’re doing, including on a running .NET on WebAssembly for their web browser,” Tanguay said. “We’re leveraging all of the tooling that they’re building. So we’re really just another alternative that takes a different approach to cross-platform UI frameworks.”
It also runs on the same IDE as Microsoft, so developers can use Visual Studio.
One advantage to Uno’s approach is that the apps are deployed to each platform as a native app. That allows developers to bring in specific native components from third-party vendors into the native app for each platform, he added.
“If there’s something you’re really needed that doesn’t fit the model of being cross-platform, you can bring it into your cross-platform solution for that specific platform; because you are, after all, a native app,” he said. “You can bring in specific native components from third-party vendors or whatever into your native apps on a per-platform basis.”
That isn’t possible with HTML-based conversion tools that wrap the code into a shell and run the UI on a web browser, he said.
Another advantage of a native app, as opposed to a single-page framework app, is that native apps can be deployed through the app stores, Sam Basu, a senior developer advocate at Progress Software and host of .NET Dev Show on Twitch, told TNS.
Uno also offers “pixel perfect” results, he added. That’s another difference between Uno and .NET MAUI, he said.
“Instead of trying to create a pixel-perfect experience that would look the same everywhere, like Flutter does, they took a different spin, where they’re saying, ‘Let’s keep everything native and let’s try to abstract what’s common to iOS to Android, to Windows and to Mac OS,’ and let’s try to abstract that into a single concept,’” he said. “We’ve implemented it so it would look pixel perfect, and look and behave exactly the same on each native platform.”
.NET can run on top of WebAssembly, Tanguay said. Then Uno can sit as the UI framework and render to the browser using .NET for WebAssembly, he explained. Basically, it works just as it does with the other platforms.
That’s a big change, added Sasha Krsmanovic, Uno chief marketing officer.
Support for Figma
Uno also offers support for the popular Figma designer tool. Uno Figma helps developers and designers collaborate, by producing the XAML UI code, Krsmanovic said.
“To a developer, as long as the button is there, it’s good enough. For a designer, it really matters if it’s two pixels to the left and one pixel to the right, because a lot of thought went into that exact position of that button,” Krsmanovic said. With the code produced by Uno, “there’s no fiddling [and] there’s no negotiating, it becomes a single source of truth of where that button [will] be,” he said.
That’s a time saver for teams deploying apps, added Tanguay.
“The average mobile app would take 2500 hours to level up, and now we’re able to bring it down to 250, 260 hourly rate,” he said. “We don’t need 10 times the developers when we can have 10 times the tooling.”