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

Transition to .NET 8 for Improved Performance, Stability, and Feature Integration #554

Merged
merged 13 commits into from
Dec 6, 2023

Conversation

Bram1903
Copy link
Collaborator

@Bram1903 Bram1903 commented Nov 16, 2023

Description

This PR addresses the upgrade of the project and its dependencies from .NET 7 to .NET 8. The migration aims to improve overall performance, and stability, and incorporate new features available in .NET 8.

Changes Made

  • Updated project files to target .NET 8.
  • Updated and resolved dependencies to their latest versions compatible with .NET 8.
  • Ensured compatibility with new language features and enhancements introduced in .NET 8.

Motivation and Context

.NET 8 brings significant improvements and features, including many optimizations. This upgrade is essential to stay current with the latest advancements in the .NET ecosystem and leverage the benefits of the new version.

Checklist

  • The code builds successfully.
  • Updated dependencies are properly resolved.
  • Incorporate ServerRenderMode and WAS

…8 for enhanced performance, stability, and access to new features.
@Bram1903 Bram1903 added the Enhancement New feature or request label Nov 16, 2023
@Bram1903 Bram1903 requested a review from neozhu November 16, 2023 15:17
@Bram1903 Bram1903 self-assigned this Nov 16, 2023
… in the dotnet.yml task. This has now been updated to .NET 8
@Bram1903
Copy link
Collaborator Author

Bram1903 commented Nov 16, 2023

@neozhu,

I fixed the check which failed upon building the project by modifying the used .NET version in the task, however, the CodeQL check doesn't seem to use .NET 8 as of now. I'll see if I can find anything about forcing it to use .NET 8.

EDIT: As of now it doesn't seem like CodeQL already supports it out of the box, however, I did find this Reddit post where someone said they got it to work, by manually setting up the build process which can be found here!

Bram

@neozhu
Copy link
Owner

neozhu commented Nov 17, 2023

@Bram1903
I think now that we've upgraded to .NET 8, we should optimize this project to leverage the new features of Blazor .NET 8, supporting both ServerRenderMode and WAS. This requires some refactoring of Program.cs and App.razor. We need to remove unnecessary files like _host.cshtml and _layout.cshtml, replacing them with Routes.razor. However, I'm encountering some issues. Do you have knowledge in this area that could help resolve them?

@Bram1903
Copy link
Collaborator Author

Hey @neozhu,

I must admit that I have barely had time to look into the new ASP.NET 8 features, so I don't know what the new options are. Nevertheless, things like ServerRenderMode and WAS sound promising, and I definitely agree with making use of the latest features and possibilities. I, unfortunately, have been flooded with work recently both because of university and my company, therefore I don't have much time to help you out at the moment :-(

@neozhu
Copy link
Owner

neozhu commented Nov 17, 2023

No worries at all! I understand how demanding both university and work commitments can be. When time allows, I plan to undertake the task of restructuring the project using the new ASP.NET 8 features, including exploring options like ServerRenderMode and WAS. I'm excited about this challenge as it promises to be a meaningful and rewarding endeavor. Your insights on these new features are greatly appreciated, and they will be a valuable guide as I navigate through this process. Looking forward to delving into it!

@Bram1903 Bram1903 marked this pull request as draft November 18, 2023 20:48
@neozhu
Copy link
Owner

neozhu commented Nov 19, 2023

No worries at all! I understand how demanding both university and work commitments can be. When time allows, I plan to undertake the task of restructuring the project using the new ASP.NET 8 features, including exploring options like ServerRenderMode and WAS. I'm excited about this challenge as it promises to be a meaningful and rewarding endeavor. Your insights on these new features are greatly appreciated, and they will be a valuable guide as I navigate through this process. Looking forward to delving into it!

I have tried many methods but all failed. It might be due to the original ManLayout design being unreasonable, which causes errors during migration. 😞

Copy link
Owner

@neozhu neozhu left a comment

Choose a reason for hiding this comment

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

Although it can run now, it's not perfect and is unable to implement the switching of page modes (RenderMode).

@neozhu neozhu marked this pull request as ready for review December 6, 2023 13:22
@neozhu neozhu merged commit 6eedc78 into neozhu:main Dec 6, 2023
3 checks passed
@Alywan
Copy link

Alywan commented Dec 7, 2023

Any updates here ?
I have upgraded to .Net8 succesfully, but I don't know how to change the structure to use the new rendering modes.

@neozhu
Copy link
Owner

neozhu commented Dec 7, 2023

Any updates here ? I have upgraded to .Net8 succesfully, but I don't know how to change the structure to use the new rendering modes.

Hi Alywan,

I've merged your PR. However, due to the structure of your project, it can only use the InteractiveServer mode. It is not possible to support mixed modes or switching between different modes.

@rwxzig
Copy link

rwxzig commented Dec 12, 2023

@neozhu Theoretically, what changes would it require so that it would support interactive mode? I am new to blazor, but I would like to support the project,

cc: @Bram1903

@neozhu
Copy link
Owner

neozhu commented Dec 12, 2023

Unfortunately, what you're asking for is nearly impossible due to limitations with EF Core and DbContext, as they do not support WebAssembly. In a WebAssembly environment, it's not feasible to directly reference EF Core or access databases. In simpler terms, while Blazor WebAssembly projects can easily switch to RenderModeInteractiveServer, the reverse is not true. This fundamental limitation makes the kind of interactive mode you're interested in supporting quite challenging, if not unfeasible, under the current technological constraints.

@neozhu
Copy link
Owner

neozhu commented Dec 12, 2023

However, I must add that what I've just stated might be incorrect. I have experimented with the Blazor Web App standard template and found that it can seamlessly switch between different modes. This indicates that more extensive refactoring of the code might be required to achieve what you're looking for.

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

Successfully merging this pull request may close these issues.

None yet

4 participants