Skip to content

ASP.NET Core Roadmap for .NET 9 #51834

Closed
Closed

Description

@mkArtakMSFT

This issue represents the list of major investments our team will focus on during the .NET 9 timeframe. It doesn't include all the features and bug fixes we'll be tackling during this time.

Note that this is an aspirational list of what we hope to get to. Many of these items will require thorough investigation and design, which can result in changes to our plans. We'll end up cutting some things and making changes as we go, but we'll try to keep this issue up to date to reflect on our progress and learnings.

There's a lot to discuss in the ASP.NET Core roadmap, and GitHub issue comments aren't great for multi-topic conversations, so we've set up the ASP.NET Core Roadmap for .NET 9 discussion to better handle these threaded conversations.

You can best express your support for specific GitHub issues by giving a 👍 reaction on the original post in the issue and by commenting with details about your scenarios and requirements. We try our best to prioritize work based on broad community support and feedback.

Servers/Scalability

Minimal APIs

Blazor

Static Web Assets improvements

Blazor Web improvements

Blazor Server improvements

Blazor WebAssembly improvements

General Blazor dev experience improvements

Activity

  1. ghost added
    needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
    on Nov 2, 2023
  2. removed
    needs-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically
    on Nov 2, 2023
  3. ghd258 commented on Nov 17, 2023

    @ghd258

    Ability to run multiple Blazor server / Web assembly apps in the same document (micro-frontends)
    #38128

  4. thisisnabi commented on Nov 20, 2023

    @thisisnabi

    Add validator for Minimal APIs can be great!

    Something like this:
    https://github.com/thisisnabi/Endpoints.FluentValidation

  5. gabephudson commented on Dec 2, 2023

    @gabephudson

    I would love to see the ASP.NET session state provider work with InteractiveServer components in Blazor Web so we can share session state across RenderMode boundaries.

  6. gabephudson commented on Dec 2, 2023

    @gabephudson

    I would like to be able to specify a "Static" RenderMode for a Blazor component/page. This is usefull when a global (higher level) RenderMode has been set to InteractiveServer.

  7. marinasundstrom commented on Dec 2, 2023

    @marinasundstrom

    @gabephudson

    I would like to be able to specify a "Static" RenderMode for a Blazor component/page. This is usefull when a global (higher level) RenderMode has been set to InteractiveServer.

    Do you mean that you don't want any interactivity for that specific component in an otherwise interactive component tree?

    What benefits or value would that bring to you?

  8. marinasundstrom commented on Dec 2, 2023

    @marinasundstrom

    @ghd258

    Ability to run multiple Blazor server / Web assembly apps in the same document (micro-frontends)

    That would require to load multiple .NET runtimes within the browser or on the server. The server scenario seems more realistic.

    I just can't see how you could even make this a great developer experience.

    You are already able to host multiple components on a page, provided that they are in the same app.

  9. davidfowl commented on Dec 2, 2023

    @davidfowl
    Member

    @thisisnabi We're discussing adding data annotations validation support to minimal APIs (via filters): #46349.

    For fluent validation, there are much better implementations (e.g.):

    1. https://github.com/Carl-Hugo/FluentValidation.AspNetCore.Http
    2. https://github.com/lucasteles/ValidatedModel.FluentValidation
  10. gabephudson commented on Dec 2, 2023

    @gabephudson

    @gabephudson

    I would like to be able to specify a "Static" RenderMode for a Blazor component/page. This is usefull when a global (higher level) RenderMode has been set to InteractiveServer.

    Do you mean that you don't want any interactivity for that specific component in an otherwise interactive component tree?

    What benefits or value would that bring to you?

    Fair question; let me elaborate. This need has been requested frequently in the community as we are upgrading "classic" Blazor apps to the dotnet 8 "Blazor Web" model.

    There are several reasons one would want to do this, but the most pervasive today is when one has a Blazor Web application that is primarily an SPA, so one sets "global" interactivity (typically on the Routes component, as in the MS templates), but needs certain pages to render statically.

    A good example of this would be the authentication pages, which require access to the HttpContext, need to be static. This cannot currently be achieved (in a "global" interactive app) without having to intercept a path from the HttpContext in app.razor and setting the RenderMode based on the path. In fact, this "hack" is what is being used to force the authentication pages to render statically in the MS Blazor Web Global Interactive Sever template. There are many other scenarios where one would need to "overwrite" a "global RenderMode" to static.

    This is important now, because most UI libraries are currently incompatible with the SSR Blazor modes, and porting applications to the Blazor Web model typically requires one to set a global interactive RenderMode for them to continue to function. We would, however, like an easier way to set pages to uses the static mode in these scenarios.

    To your point, I think this is much more useful on a per page level component.

    Please see this GitHub issue from Daniel Roth...
    #51046

    Hopefully this makes it into 9 (or sooner). I think it will really help porting applications and was surprised to find it wasn't included currently. :)

  11. marinasundstrom commented on Dec 2, 2023

    @marinasundstrom

    @gabephudson Thanks for clarifying. I agree with you on the problems expressed.

    Static rendering did break a lot for me. I have been using MudBlazor, and this library is relying on interactivity, and doesn't work well with SSR. It is OK when you understand the problem and how to solve it. But I think that devs who are not into the mechanics of Blazor would get frustrated.

    The SSR story needs to be finished. And it in involves giving guidance to component library authors.

  12. andrew-vdb commented on Dec 3, 2023

    @andrew-vdb

    Give us crystal clear answer if mvc will support aot or not

  13. sanamhub commented on Dec 4, 2023

    @sanamhub

    Removal of jQuery (maybe bootstrap as well) and revamp of default templates for ASP.NET Core MVC

  14. sajjadarashhh commented on Dec 5, 2023

    @sajjadarashhh

    Make full support for native aot would be nice

  15. 19 remaining items

  16. sajjadarashhh commented on Jan 28, 2024

    @sajjadarashhh

    In this issue i described a simpler way to communicate with js in blazor projects
    This can be useful and developer friendly
    Please check that and give me a feedback about that

  17. Johnhersh commented on Jan 28, 2024

    @Johnhersh

    Another issue is that the SignalR connection is simply not that reliable.

    @Johnhersh We are tracking a number of issues related to this problem with interactive server rendering connectivity management that you can express your support for:

    Thanks for this, I upvoted those issues.

    I'm not sure if I'm maybe not asking the correct question. But I'm confused about why this is an issue at all. Making a web app in something like React you rely on http requests. Those have high reliability. From what I read though SignalR has an http request and long polling fallback. So I guess what I'm asking is for access to that, and I don't see a ticket that mentions this. But I'm probably misunderstanding this whole situation as I'm not too familiar with SignalR's internals, or why that mechanism was picked for Blazor instead of regular http calls.

  18. captainsafia commented on Jan 29, 2024

    @captainsafia
    Contributor

    We need a standardized way to group endpoints, similar to that of controllers.

    @marinasundstrom +1 to your proposal about analyzers/codefixers to aid with the migration process. Out of curiosity, with regard to grouping, do you find that route groups in minimal APIs are an insufficient alternative?

  19. gabephudson commented on Jan 29, 2024

    @gabephudson

    I'm not sure if I'm maybe not asking the correct question. But I'm confused about why this is an issue at all. Making a web app in something like React you rely on http requests. Those have high reliability. From what I read though SignalR has an http request and long polling fallback. So I guess what I'm asking is for access to that, and I don't see a ticket that mentions this. But I'm probably misunderstanding this whole situation as I'm not too familiar with SignalR's internals, or why that mechanism was picked for Blazor instead of regular http calls.

    @Johnhersh, this SignalR (websockets) connection only occurs in components that are configured as "InteractiveServer". In this mode, the shadow DOM is represented on the server, and changes are communicated in real-time to the browser. This requires a high-speed, low latency communication channel and uses websockets for this. While having some down sides (primary are the app must have a consistent internet connection and additional server resources), it is a dream for developers who can have all the interactivity of a SPA without the overhead of multiple sets of states and the need to create APIs for all server access. There is a fall-back mode that uses HTTPRequest (long polling), but it is extremely slow due to the amount of communication that occurs with the server (creates a lot of latency due to the multiple requests).

    The also have a server side render mode (which is kind of like Next.js) and InterActiveWebAssembly, which keeps the DOM on the browser. It allows one to code in C# instead of JS and it is the most similar to React.js. In WASM mode, you would use APIs and HTTPRequest in a very similar way to React to modify server state (DB).

    https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0

    The good news is with Blazor 8, we can choose the mode that works best for you and your situation on a per page and per component level. IMHO, it is a fantastic framework for building web apps. My client facing applications typically only have concurrent user counts in the thousands, so InteractiveServer mode in Blazor allows our team to be extremely productive.

    We don't see many issues with SignalR. Unlike a traditional web app, however, if you lose internet connection momentarily, there is a pop-up (connecting...) that will display (where a tradition web app would only show if the user was actively communicating to the sever at the time). If the user loses connection for more than a minute or so, then the websocket circuit will drop and they will (typically) be forced to re-login once they regain their connection. This is typically only an issue for mobile users. If you have an extremely high volume user count or primarily mobile users, this rendermode may not be the best choice for your application.

  20. gabephudson commented on Jan 29, 2024

    @gabephudson

    My above comment got me thinking of an idea for Blazor 9 InteractiveServer. Perhaps if the user loses their internet connection momentarily, (less than 10-15 secs) or so, we can have the option to NOT display the "attempting connection" pop-up unless they actually try to interact? This might be a slightly better experience for users with a spotty connection. Obviously after a certain amount of time, the circuit will drop, and then the dialog can be displayed).

    So if connection drops and...

    1. User is not interacting, no pop-up.
    2. User attempts to interact, and circuit timeout has not been reached, only then display reconnecting pop-up.
    3. If circuit timeout elapses, continue to display the connection dropped message as usual.

    This may already be custom behavior we can code. I haven't looked in to it.

  21. Johnhersh commented on Jan 30, 2024

    @Johnhersh

    @gabephudson Thank you for this thoughtful response!

    this mode, the shadow DOM is represented on the server, and changes are communicated in real-time to the browser. This requires a high-speed, low latency communication channel and uses websockets for this. While having some down sides (primary are the app must have a consistent internet connection and additional server resources)

    This is a huge problem for my team. We've compared it to NextJS and the fact that all interactions there happen via regular http requests mean the consistent connection requirement is a non-issue. In addition users are already used to having wait times when pressing buttons, so this flow feels natural.

    But the entire site shutting down is extremely odd. From a DX perspective when the team saw that this is a layer we'll have to manage somehow it became a major point against it. There are other tickets here for this, but the web socket connection gets dropped on mobile and in chrome in the background. The entire site is not usable unless there's a connection.

    From a UX perspective the entire site not working until a reconnect happens is just really bad. And if they've been away long enough it's a complete page refresh which could also mean losing unsaved work in our case.

    it is a dream for developers who can have all the interactivity of a SPA without the overhead of multiple sets of states and the need to create APIs for all server access.

    This is very true and why I was advocating for it. Plus the extra advantage of not having to manage endpoints (though Next does this via tRPC).

    The also have a server side render mode (which is kind of like Next.js) and InterActiveWebAssembly, which keeps the DOM on the browser. It allows one to code in C# instead of JS and it is the most similar to React.js. In WASM mode, you would use APIs and HTTPRequest in a very similar way to React to modify server state (DB).

    The WASM stuff is also problematic. If a component on a page needs interactivity then the page needs to be interactive. This means if I have a page where one button calls some function on the server, and another button just opens a dialog on the frontend, both of those require a server roundtrip. I couldn't find a way to have a WASM page, but with a server-interactive button for example.

    So this means if connectivity is dropped, then even stuff that only happens on the frontend still requires a server roundtrip and is therefore blocked.

    We don't see many issues with SignalR. Unlike a traditional web app, however, if you lose internet connection momentarily, there is a pop-up (connecting...) that will display (where a tradition web app would only show if the user was actively communicating to the sever at the time).

    This is a huge problem for us. Blocking the entire web app is not something any other framework forces on you.

    What I'm still very unclear on is why can't interactivity happen via regular http requests? I don't quite get why web sockets have to be the only transport. I'm not talking about http long polling. I mean whatever message is sent via SignalR to the backend is surely also able to be sent via a regular http request?

    If we had that feature then all these problems go away.

    If the user loses connection for more than a minute or so, then the websocket circuit will drop and they will (typically) be forced to re-login once they regain their connection. This is typically only an issue for mobile users. If you have an extremely high volume user count or primarily mobile users, this rendermode may not be the best choice for your application.

    We do have a lot of mobile users. We can try making the entire app in pure WASM. But then we lose all of the advantages of Blazor as you've outlined above, and they're great advantages.

    In the end building it in Next meant the same architecture works across the board, and with tRPC (the t3 stack) we get similar advantages.

    I do think Blazor come out ahead in theory, but this websocket topic kills the whole thing for us unfortunately.

  22. Johnhersh commented on Jan 30, 2024

    @Johnhersh

    My above comment got me thinking of an idea for Blazor 9 InteractiveServer. Perhaps if the user loses their internet connection momentarily, (less than 10-15 secs) or so, we can have the option to NOT display the "attempting connection" pop-up unless they actually try to interact? This might be a slightly better experience for users with a spotty connection. Obviously after a certain amount of time, the circuit will drop, and then the dialog can be displayed).

    So if connection drops and...

    1. User is not interacting, no pop-up.
    2. User attempts to interact, and circuit timeout has not been reached, only then display reconnecting pop-up.
    3. If circuit timeout elapses, continue to display the connection dropped message as usual.

    This may already be custom behavior we can code. I haven't looked in to it.

    This would indeed be a major step forward. I would like it per-component even so I could disable and grey out buttons while interactivity is down.

    However, what I think will solve this entirely is if there's no connectivity then it should be able to send the exact same message just via an http request instead.

  23. gabephudson commented on Jan 30, 2024

    @gabephudson

    However, what I think will solve this entirely is if there's no connectivity then it should be able to send the exact same message just via an http request instead.

    If there is no connectivity, the HTTPRequest will fail as well. :) As far as Chrome shutting down websockets, I have heard about this behavior, but haven't seen this issue on our InteractiveServer application. Perhaps Blazor/Signal R has enough traffic (even when not interacting) that the browser will keep it open? (Again, can't speak for what may happen if your phone goes to sleep and you re-awaken it).

    I think there are tradeoffs with any framework, but Blazor currently offers 3 different modes you can mix and match (typically at a page level, but also per component) depending on your needs. Maybe stating the obvious, but you have the following...

    Server Side
    Server Side Render - This allows you to use a component model to create your pages on the server and render them to the client. No need to build APIs. This replaces MVC/ASP.NET Webforms on the MS stack with a component model templating system. For components that you want to be highly interactive, you can use another render mode or JS. For example, to do a pop-up, you would likely use some JS in your UI framework and not do a post. JS frameworks like HTMX can also be utilized to great affect.

    Interactive Server - This is the mode we use. It allows full interactivity while also not needing APIs. It requires a persistent internet connection while app is in use and, while I don't work for MS and the engineering team, I don't believe an HTTPRequest model would be performant enough for the server-side shadow DOM model it uses. Perhaps in the future we would see an HTMX like mode added to compliment SSR mode above?

    Client Side
    WASM - This, like React, has the interactivity/DOM reside on the client side. It also allows your team to code the interactivity in C# instead of JS. Like other client-side frameworks, because it does not operate on the server, it does require you to setup APIs so that you can read/write data to the DBs on the server side. That said, it's agnostic to which technology you want to use to do this.

  24. Johnhersh commented on Jan 30, 2024

    @Johnhersh

    I don't disagree with most of what you say 🙂 I love Blazor and think it has the potential to really streamline my workflow.

    But some things are not quite accurate.

    If there is no connectivity, the HTTPRequest will fail as well

    This is not true. You're taking it as if the device doesn't have access to the internet. But that's not the issue, the issue is the browser terminating the web socket connection. On mobile you're guaranteed to have this happen if the screen is turned off or someone minimizes the browser. On Chrome there are tons of thread on stackoverflow (regardless of SignalR, just websockets in general) where it shuts down websocket connection after the tab being in the background for X amount of time. In our app we open multiple tabs so this is extremely likely.

    In both of those situations, if the websocket connection would have closed from being in the background, a regular http request would have worked just fine. The device hasn't lost connectivity.

    This is not mentioning how chatty web sockets are. If my app opens multiple tabs (which we do) that's a websocket connection for each tab. Eventually the browser will cleverly shut the connection. But then a full refresh is needed. This is also wasted bandwidth.

    And the final issue is that when these disconnects inevitably happen, it's also likely the server will terminate the circuit. So then you have a situation where our customer will return to the tab, find a screen saying there's no connection (because Chrome shut it down), try and reconnect for X seconds just to find that the server shut the circuit, then force the user to refresh the page anyway. This is terrible UX I'm afraid.

    Perhaps in the future we would see an HTMX like mode added to compliment SSR mode above?

    I would absolutely love this 🙂 All the advantages

  25. gabephudson commented on Jan 30, 2024

    @gabephudson

    @Johnhersh

    No worries. I hear you. Certainly, the fact that mobile devices close a websocket connection is very problematic. Short term fix is to increase the circuit timeout in your app (which will consume more server resources). It will be interesting to see if the team can come up with some new ways of communication to mitigate this.

    Interestingly enough, I did test this on my Android phone. If I power off the screen on my phone, as long as I'm back in a minute or two, the app just works. Did a 6-minute test and the app did the "reconnecting" but then worked fine after a few seconds. After 15 minutes, I lost the circuit and had to refresh the page. YMMV.

  26. mkArtakMSFT commented on Jan 30, 2024

    @mkArtakMSFT
    ContributorAuthor

    Thanks for all the feedback here, everyone. We're finalizing our plans for .NET 9 already, so I'm going to lock this issue. Feel free to continue the discussion at #53665

  27. locked and limited conversation to collaborators on Jan 30, 2024
  28. ghost added
    area-blazorIncludes: Blazor, Razor Components
    on Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions