AspNet.Security.OAuth.Providers icon indicating copy to clipboard operation
AspNet.Security.OAuth.Providers copied to clipboard

Support trimming

Open martincostello opened this issue 3 years ago • 3 comments

I've been playing around with trimming in some applications this afternoon, and thought I'd try it out with the provider assemblies. Going through the documentation this involved:

  • Enabling the trimming analyzer.
  • Marking shipping assemblies as trimmable.
  • Fixing JSON serializer usage that is not supported by trimming.

Thoughts about this @kevinchalet? For the small amount of work involved in getting it to build I thought it was at least worth pushing up a draft to seek an opinion. Note that I haven't tried this out in an actual real trimmed ASP.NET Core application yet.

martincostello avatar May 10 '22 14:05 martincostello

Thoughts about this @kevinchalet? For the small amount of work involved in getting it to build I thought it was at least worth pushing up a draft to seek an opinion.

Given the modular nature of the aspnet-contrib providers, I'd expect the gain to be marginal as pretty much all the plumbing code is needed once you register a provider. That said, since the cost seems absurdly low (it's even too easy to be true 🤣), there's no reason not to do it.

AFAIK, the OAuth 2.0 base handler hasn't been updated yet to be linker-friendly and it's not clear to me whether it's something that will happen in 7.0. Would that affect our trimming story?

kevinchalet avatar May 10 '22 15:05 kevinchalet

/cc @Tratcher

kevinchalet avatar May 10 '22 15:05 kevinchalet

AFAIK, the OAuth 2.0 base handler hasn't been updated yet to be linker-friendly and it's not clear to me whether it's something that will happen in 7.0. Would that affect our trimming story?

It's on the list, we'll see how far we get. I agree that there's not a lot to trim here, you need most of the functionality.

Tratcher avatar May 10 '22 15:05 Tratcher

Will come back to this in the future if there's a need to.

martincostello avatar Aug 17 '22 12:08 martincostello