-
Notifications
You must be signed in to change notification settings - Fork 72
Uno Platform Support #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Uno Platform Support #121
Conversation
|
@Happypig375 Does not build properly yet, need to resolve some WASM issues, plus add some samples :-) |
|
I read through the list of changed files.
This is definitely a valuable spike if only to test that CSharpMath works with Uno. Main issue with merging IMO is
The aim of this PR, as clarified in the linked issue, is to allow usage from CSharpMath in a way that doesn't require writing the 10 lines of code needed to interface with CSharpMath.SkiaSharp. Adding 3400 lines to the repo in order to save perhaps 1-3 end-users having to write 10 lines of code each doesn't seem like good arithmetic to me. If there were hundreds of projects dependent on CSharpMath it would be a different story. An ultra-clean extreme would be: it's SkiaSharp's responsibility to show people how to install a SkiaSharp view in any .net platform, and CSharpMath's responsibility to inject manage latex rendering in this view: then we'd only need to maintain one example project. |
|
@charlesroddie Most of it is for an example project. It is a |
|
Understood that it is example projects but example projects still take maintenance (e.g. having to make updates, and adding to build times for the solution). As mentioned the my paragraph it doesn't need to be CSharpMath's responsibility to maintain a lot of example projects and have them build and work. |
|
@charlesroddie so the suggestion would be to remove the example project or to create a completely separate repository for Uno support? Most of the added code are the samples, which are helpful, but I can provide them separately in my own repo if they do not fit here well. The goal of the SkiaSharp.Wasm going forward is to be the official first-party solution for WebAssembly (not just Uno specific) |
|
@charlesroddie Not really. Each platform make minimal breaking changes and maintenance is low-cost. Build times of one front end do not affect other front ends. |
|
@MartinZikmund I don't like separating repos after what I saw with https://github.com/oxyplot: repos other than the main one get little maintenance. |
First party support is better, but if you preferred not to have here directly, I would create a Uno fork separately (this was my original plan, until I noticed Uno was among the ideas for a future update) |
|
As long as we don't require platform example builds to succeed for PRs, and for @Happypig375 and @MartinZikmund to maintain the additional projects then it's OK for then another examples project can go through. We'll definitely need to tidy up the repo - inlcuding creating a folder structure for examples, platforms, etc.. And creating a solution without the peripheral projects would be a good idea too. My note on CSharpMath.SkiaSharp.Wasm should be addressed as even if
, it's not at the moment as is clear from the naming, and when it becomes official it would probably be merged into SkiaSharp anyway so that part of this PR would be deleted at that point. |
Why? The whole solution should be buildable, updates should come in via PRs. |
|
It could hold back PRs. Currently you are fast at fixing issues so not a problem if you are happy to fix PRs where any online builds are failing. But contributors shouldn't have to have all the build tooling needed to build all the example platforms, so should not be expected to confirm that the entire solution builds if it contains all of these. |
|
If they can't build all the platforms, then PR checks will do it for them. The errors are publicly visible. |
|
@MartinZikmund at this point, building on GitHub actions or Azure Devops using a WebAssembly dependencies (Uno.SkiaSharp being one) is not supported. The only way to create a valid binary in CI is to use this docker image I've made a change in the bootstrapper to provide the ability to get non-failing windows builds (unoplatform/Uno.Wasm.Bootstrap#216), but the resulting binary will be invalid, as the WebAssembly static linking step will be disabled. In your case, once the bootstrapper PR will be published, you'll need to add the following: <WasmShellForceDisableWSL Condition="'$(CI)'=='true'">true</WasmShellForceDisableWSL>using the GitHub actions default variables. This will allow you to make your Windows build pass, and add another job that will run on Linux to have a proper application. |
|
@charlesroddie Indeed, |
|
@jeromelaban I am getting the issue I mentioned when building locally as well, is there something I am missing to get it working there? Thanks :-) |
If you're getting this error locally, it means you have not setup WSL. You can set it up using this. |
|
Would support for just UWP (not tested on Uno Platform) be helpful? |
Uno runs on UWP just fine. What's the problem? |
|
What I mean to ask is if |
|
There was never a |
|
I know, I've just started working on it. |
|
You can probably just reference |
|
Sorry for the delay on commits, I am currently slowed down with several other commitments, but I will definitely get back to this :-) |
2185c89 to
ca1dbdd
Compare
|
@Happypig375 @charlesroddie What about putting the sample projects in a separate solution (under |
4a4a40d to
114bfce
Compare
|
@charlesroddie Let's also get this in with #240. |
|
With the introduction of single projects, this probably needs a redo. I'll take an attempt at it. |
charlesroddie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title of this is "Uno Platform Support" but CSharpMath already supports Uno via SkiaSharp. Perhaps the title should be "A Second Way to Support Uno via Skiasharp", in which case what this second way is and the benefit of introducing it should be articulated.
The costs are real. Something Avalonia-specific got merged despite Avalonia being similarly already supported (also via SkiaSharp), and that made updating the repo over the last 2 months annoying. It wasn't clear who the Avalonia maintainer was (turned out to be @Happypig375 in the end).
What if CI build or release breaks? What if tests fail? What if things become obsolete?
|
@charlesroddie The feature at hand should be one UI control that invokes CSharpMath.SkiaSharp behind the scenes. It can reuse the Xaml definitions shared across Avalonia and Maui. I think Maui, Avalonia and Uno make up the big 3 UI frameworks for C#. It doesn't really make sense to not support one out of three here. |
See above comment, in particular
|
|
So I have attempted to add a Uno front end using the latest templates which replace the separate platform projects with a single project under the Uno SDK. I have now hit a roadblock:
All other frameworks, including MAUI and Avalonia and even native WinUI, do not exhibit this behavior - they supply a fixed available width even when nested inside a scroll element with horizontal scrolling disabled.
This results in a TextView that can't automatically break at available page width (note that the text box above also renders out of bounds): This is a pretty serious bug that happens specifically on Uno. I am unsure how to work around this, so it makes me unsure if we should even support this at all. There is also a question on which control to use - It may be better to leave this explicit choice to the user instead of maintaining potentially two controls that can't nicely fit into the existing View-defining file that uses #ifdef across frameworks. Side note: The original PR attempted to support UWP and Uno together. I suppose this extends to combining WinUI and Uno now, but making the example projects exhibit the same behavior across WinUI and Uno is also a bit annoying with different Binding behaviors as shown in the latest commit on TryPage. This is less serious of a concern though. |
|
@MartinZikmund Can you confirm the above? Thanks. |
|
@charlesroddie The benefit would be a super easy and straightforward way to display LaTeX in an existing application - just embed a MathView or TextView instead of having to go through a custom rendering process in code-behind. The relevant properties also become bindable XAML properties which means that all the XAML tooling for C# UI applications automatically work. The code that supports this is as minimal as it gets with overlaying on top of existing Avalonia and MAUI view definitions. Most of the added code is for the Example project which can be updated out-of-sync when needed. That is - if they work, but my investigation revealed two serious questions that may block direct support of Uno here. |
OK so maybe it becomes clearer what this addition is. Certianly not "Uno Platform Support" but "Support for xaml-only usage in Uno" for people using Uno who want to avoid writing dotnet code. A microscopic benefit in my opinion. There were problems when I updated the repo. Builds and tests started to fail because of something similar that had been added around Avalonia. Someone could contribute a feature or a maintenance fix and have to work on Avalonia/MAUI/Uno for no reason. So if something like this goes in, can any builds/tests related to Avalonia/MAUI/Uno become not required for merging PRs? |
|
@charlesroddie You did a whole repo package update. Of course it would touch the Avalonia projects and need update work done over there. Someone who contributes a feature or a maintenance fix and didn't touch the Avalonia/MAUI projects, nor the exposed APIs of painter objects, wouldn't need to work over there. Also, this isn't specifically "XAML-only usage" but "a UI control that wraps around a Painter object" (i.e. also applies to C# definitions of UI controls) rather than needing to delegate to a painter. The delegation to painter is done inside the UI control. |




Support for Uno Platform/non-XF UWP
Draft for #120
TODOs:
float->doubledependency properties