Skip to content

Use net8.0 for Maui tests until Maui is ready for net9.0#3437

Merged
LoopedBard3 merged 7 commits into
dotnet:mainfrom
LoopedBard3:FixMauiBuilds
Oct 25, 2023
Merged

Use net8.0 for Maui tests until Maui is ready for net9.0#3437
LoopedBard3 merged 7 commits into
dotnet:mainfrom
LoopedBard3:FixMauiBuilds

Conversation

@LoopedBard3
Copy link
Copy Markdown
Member

@LoopedBard3 LoopedBard3 commented Oct 23, 2023

Use 8.0 channel and net8.0 dotnet version link for Maui tests until Maui is ready for net9.0. This fixes the ci_setup.py error: RuntimeError: Unable to determine the .NET SDK used for net9.0

Test run: https://dev.azure.com/dnceng/internal/_build/results?buildId=2299328&view=results

Note: The default maui blazor app has also updated, breaking those builds. Will fix in another PR, this PR fixes the ci_setup issue.
@kotlarmilos @jonathanpeppers, do either of you know the current best contact for the performance of the maui-blazor app? The new default is going to impact the results of the performance testing and require a new insertion point for when we call activity.ReportFullyDrawn(), etc.

@kotlarmilos
Copy link
Copy Markdown
Member

kotlarmilos commented Oct 24, 2023

In the App.cs file, the main page is created, which may be useful for measuring startup performance.

public App()
{
	InitializeComponent();

	MainPage = new MainPage();

	// Startup event
	var activity = MainActivity.Context as Activity;
	activity.ReportFullyDrawn();
}

kotlarmilos
kotlarmilos previously approved these changes Oct 24, 2023
@jonathanpeppers
Copy link
Copy Markdown
Member

If you want to all ReportFullyDrawn(), you could call it from the Android activity class:

https://github.com/dotnet/maui/blob/main/src/Templates/src/templates/maui-blazor/Platforms/Android/MainActivity.cs

Something like OnResume() would be a decent place to call it for a plain MAUI app.

But for a MAUI+Blazor app, you want to call it after all HTML content has fully loaded?

@LoopedBard3
Copy link
Copy Markdown
Member Author

Yea, after the html is all loaded is the goal. Before we were calling the report fully drawn in "protected override void OnAfterRender(bool firstRender)", is there a good way to figure out if this is still available? It used to be put in the file "app/Pages/Index.razor.cs".

@LoopedBard3 LoopedBard3 marked this pull request as draft October 24, 2023 16:34
@jonathanpeppers
Copy link
Copy Markdown
Member

@Eilon @mkArtakMSFT did the OnAfterRender() method for MAUI+Blazor go away in .NET 8? Is there an alternate now?

@LoopedBard3
Copy link
Copy Markdown
Member Author

I did some testing and think I found where to move the OnAfterRender(). I am working on trying to fix some other pipeline things before pushing here.

@LoopedBard3
Copy link
Copy Markdown
Member Author

@LoopedBard3 LoopedBard3 marked this pull request as ready for review October 24, 2023 22:30
@Eilon
Copy link
Copy Markdown

Eilon commented Oct 25, 2023

@Eilon @mkArtakMSFT did the OnAfterRender() method for MAUI+Blazor go away in .NET 8? Is there an alternate now?

Still there: https://github.com/dotnet/aspnetcore/blob/main/src/Components/Components/src/ComponentBase.cs#L144-L146

Comment on lines -26 to +27
with open(f"{const.APPDIR}/Pages/Index.razor.cs", "w") as indexCSFile:
indexCSFile.write('''
using Microsoft.AspNetCore.Components;
#if ANDROID
using Android.App;
#endif\n\n'''
+ f" namespace {EXENAME}.Pages" +
# Update the home.razor file with the code
with open(f"{const.APPDIR}/Components/Pages/Home.razor", "a") as homeRazorFile:
homeRazorFile.write(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, this broke because we reworked the template?

dotnet/maui#17946

@Eilon do you think these files would move around often?

@LoopedBard3 could this error immediately if this file goes missing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, the template app changed along with the file structure. If there is another major change, we should see a similar build error if the Home.razor file is removed or renamed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@Eilon do you think these files would move around often?

No, this was the big template update for .NET 8, and no plans to make any significant changes until GA.

@LoopedBard3 LoopedBard3 enabled auto-merge (squash) October 25, 2023 21:36
@LoopedBard3 LoopedBard3 disabled auto-merge October 25, 2023 21:37
@LoopedBard3 LoopedBard3 merged commit bc0b657 into dotnet:main Oct 25, 2023
@LoopedBard3 LoopedBard3 deleted the FixMauiBuilds branch October 25, 2023 21:37
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