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

Developers can safely trim ASP.NET apps to reduce their deployment payloads #27384

Closed
Tracked by #43543
mkArtakMSFT opened this issue Oct 30, 2020 · 19 comments
Closed
Tracked by #43543
Assignees
Labels
affected-all This issue impacts all the customers area-blazor Includes: Blazor, Razor Components area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions design-proposal This issue represents a design proposal for a different issue, linked in the description enhancement This issue represents an ask for new feature or an enhancement to an existing one linker-friendliness Tracking linker friendliness Pillar: Complete Blazor Web Priority:2 Work that is important, but not critical for the release severity-major This label is used by an internal tool Theme: meeting developer expectations User Story A single user-facing feature. Can be grouped under an epic.

Comments

@mkArtakMSFT
Copy link
Member

mkArtakMSFT commented Oct 30, 2020

Summary

This is a big effort to help with better trimming of the library with the goal of reducing the size of a published app.
There are some design choices we've made which make it hard to trim unused code (broadly, anything that uses reflection)
As part of this effort those designs should be reviewed to see whether we can find better alternatives.

People with more context

@davidfowl, @halter73, @javiercn, @captainsafia

Motivation and goals

This is part of a bigger plan to make the higher level frameworks trimmable (see dotnet/runtime#43543).

We also want to make sure people can host web servers as part of cloud infrastructure as small single file executables.

Longer term, we want to make sure that ASP.NET Core can work in full AOT mode without reflection and this is the first stage of that journey.

In scope

We want to make sure we can trim ASP.NET Core applications with confidence by default. Our target for .NET 6 is APIs only. This includes:

Out of scope

We're not going to focus on applications with Web Applications at the moment. Web Applications with Razor views won't be explicitly trimmable in .NET 6.

Risks / unknowns

Testing is one of the really hard things to cover when doing linking. To get 100% coverage you need to basically re-run all of the tests with the appropriate code linked.

@mkArtakMSFT mkArtakMSFT added design-proposal This issue represents a design proposal for a different issue, linked in the description Theme: meeting developer expectations labels Oct 30, 2020
@mkArtakMSFT mkArtakMSFT added this to the Next sprint planning milestone Oct 30, 2020
@ghost
Copy link

ghost commented Oct 30, 2020

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@danmoseley
Copy link
Member

Adjusted title to give context in themesof.net

@Pilchie
Copy link
Member

Pilchie commented Nov 9, 2020

👀

@davidfowl davidfowl self-assigned this Nov 10, 2020
@halter73 halter73 added the linker-friendliness Tracking linker friendliness label Nov 11, 2020
@danmoseley danmoseley added the User Story A single user-facing feature. Can be grouped under an epic. label Nov 24, 2020
@danmoseley
Copy link
Member

Making this a user story to parallel the base libraries story.

@marek-safar marek-safar changed the title Annotate ASP.NET framework APIs for trimmability Developers can safely trim ASP.NET apps to reduce their deployment payloads Nov 27, 2020
@mkArtakMSFT mkArtakMSFT added the Priority:1 Work that is critical for the release, but we could probably ship without label Jan 22, 2021
@mkArtakMSFT mkArtakMSFT added area-blazor Includes: Blazor, Razor Components area-servers labels Jan 30, 2021
@mkArtakMSFT
Copy link
Member Author

Marking with both area-labels as this is a cross-cutting effort.

@SteveSandersonMS SteveSandersonMS added affected-all This issue impacts all the customers enhancement This issue represents an ask for new feature or an enhancement to an existing one severity-major This label is used by an internal tool labels Feb 19, 2021 — with ASP.NET Core Issue Ranking
@ghost
Copy link

ghost commented Dec 19, 2023

Thanks for contacting us.

We're moving this issue to the .NET 9 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@mkArtakMSFT
Copy link
Member Author

@JamesNK what is left to be done here? I know for Blazor we still have work to do. Is there anything else related to trimming on your side, or can I file a new Blazor-specific issue and close this?

@JamesNK
Copy link
Member

JamesNK commented Nov 1, 2024

Blazor and razor. @eerhardt youre probably closer to this than I am now. Major gaps in AspNetCore trimming/AOT story?

@davidfowl
Copy link
Member

I think this should be closed and more specific issues can be opened.

@richard-collette-precisely

I think this should be closed and more specific issues can be opened.

But who, that knows the specific issues, is going to file it @davidfowl ?

@davidfowl
Copy link
Member

davidfowl commented Nov 3, 2024

Doesn't matter, this issue no longer serves a purpose. Work was done in both .NET 8 and 9. If there are new specific areas of investment as part of .NET 10 then it should be filed.

@eerhardt
Copy link
Member

eerhardt commented Nov 4, 2024

For Blazor we already have:

For SignalR, the core + JSON protocols have been made trim and AOT compatible in .NET 9. [Trimming] SignalR (dotnet/aspnetcore#41704) is still open to track the remaining 2 protocols: MessagePack and SE.Redis.

For MVC, we have [Trimming] MVC (dotnet/aspnetcore#41767).

The other areas listed under "Not Supported" on https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot?view=aspnetcore-9.0#aspnet-core-and-native-aot-compatibility are:

  • "Other authentication" (besides JWT)
  • Session
  • Spa

@mkArtakMSFT
Copy link
Member Author

Thanks @JamesNK, @davidfowl and @eerhardt. Closing this now. I've created two more issues:

As for the SPA point, we don't think that area needs to support trimming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-all This issue impacts all the customers area-blazor Includes: Blazor, Razor Components area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions design-proposal This issue represents a design proposal for a different issue, linked in the description enhancement This issue represents an ask for new feature or an enhancement to an existing one linker-friendliness Tracking linker friendliness Pillar: Complete Blazor Web Priority:2 Work that is important, but not critical for the release severity-major This label is used by an internal tool Theme: meeting developer expectations User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests