Skip to content
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

[WIP] Upgrade to Avalonia 11.0 + add Browser project #645

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

maxkatz6
Copy link

@maxkatz6 maxkatz6 commented Dec 20, 2022

Opening this PR as I thought it should be pretty easy to migrate, but also opens some nice possibilities.
I will push changes to this branch once in a while, updating it with newer Avalonia builds.

What I want to do in this PR

  • Upgrade to Avalonia 11.0
  • Browser support
  • Replace legacy file pickers with sandbox-friendly API (also required updating shared code to use Stream instead of file paths where possible)
  • "Recently opened" links should use bookmarks API instead of saving file paths (for browser support and possibly sandboxed macos or mobile)
  • Replace TreeView with virtualized TreeDataGrid and see how better it is for this application
  • Update Welcome Screen UI to hide features not available on the browser (opening the Project)
  • NET 7 AOT should work with zero changes and configuration, but yet to be tested with this application.
  • Do some codebase research and see if any missing features can be ported from WPF version (like, something that needs TextBlock.Inlines support)
  • Dark mode

Out of scope, but could be done

  • Upgrade to Fluent theme (separated PR?)
  • Mobile support is possible now, but I don't think this apps needs to have a mobile version (am I wrong?), also needs interface rewritting to be more adaptive

@maxkatz6
Copy link
Author

maxkatz6 commented Dec 20, 2022

Sneak peek of browser support. Anybody can checkout and run browser project. Keep in mind you need .NET 7.0 and "warm-tools" and "wasm-experimental" workloads installed.

image

@@ -0,0 +1,711 @@
using System;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this PR has lots of changes as I had to rename this file, so it can be reused in environments without windows (browser).

public static void WriteToXml(Build build, Stream stream)
{
var writer = new XmlLogWriter();
writer.Write(build, stream);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally these APIs should use async stream reads and writes. As Browser doesn't support sync IO access.
I was able to work around this by coping files content from and to MemoryStream, but it potentially can be a problem with huge binlog files.

@KirillOsenkov
Copy link
Owner

I didn't have time to maintain the Avalonia part, so thanks a lot of giving it a refresh! Much appreciated. Don't worry about the changes to the Avalonia version, and let me know if you need to change something in Core or the logger projects.

The Windows (WPF) half has more features that I didn't have time to add to Avalonia and was hoping someone would come along and keep the Avalonia version in sync. Sorry about that. Nothing easier than "walk both versions line by line and see what is missing from Avalonia" comes to mind.

Mention me here if you need my help or have questions.

@KirillOsenkov
Copy link
Owner

Oh, and whenever you're happy with the browser version, we can start publishing it at https://avalonia.msbuildlog.com or something (let me know if you can think of a better URL). https://live.msbuildlog.com is already taken by the Blazor version that lives in the live branch. It also desperately needs some UX improvements.

@kant2002
Copy link
Contributor

@maxkatz6 maybe you can wrap this up? I think this is good progress for MsBuildogViewer on Avalonia.

@maxkatz6
Copy link
Author

@kant2002 I am primarily waiting for preview5 to be released + some spare time. There are some breaking changes comparing to preview4, so I want to handle it as early.

@maxkatz6
Copy link
Author

maxkatz6 commented Feb 9, 2023

@KirillOsenkov I have done minimal changes what I had planned. Remaining improvements can be done independently later.
The only problem left is to get CI working. I will come back on the weekends, but if you have idea, how to fix it - please let me know.

@slang25
Copy link
Contributor

slang25 commented Jul 14, 2023

The wasm app is so damn cool! I'd really like to see this make its way to a hosted public site, like a fancier version of https://live.msbuildlog.com/
Are you planning on picking this up again @maxkatz6 now that Avalonia 11 is out of preview?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants