Closed DustinCampbell closed 1 day ago
It's not entirely clear to me why we need such a broad opt-out for tag helper caching, when there is also a boolean parameter to control it
The reason is that the boolean parameter controls a code path that uses types that aren't available to the compiler, namely TagHelperCache
. In fact, the vast majority of code that includes the JSON serialization does not use the flag. The only place that the caching is actually used is in JSON serialization is MS.VS.LanguageServices.Razor, specifically for Live Share. It didn't seem helpful to include this functionality for everything given the narrow scenario that it's actually used.
cc @chsienki, @jjonescz, @333fred and @jaredpar for compiler reviews
The Razor compiler was carrying an old copy of
TagHelperDescriptorJsonConverter
, though it was only used in benchmarks. Since it doesn't make sense to have two JSON formats for tag helpers, this change updates Microsoft.AspNetCore.Razor.Serialization.JSON so that it can be referenced by the compiler benchmarks and removesTagHelperDescriptorJsonConverter
. With this done, it will be easier to slim down theTagHelperDescriptor
API, which I'm planning to do to speed tag helpers up a bit. (Although, that'll still require updates to https://github.com/dotnet/sdk/tree/main/src/RazorSdk/Tool.)I recommend reviewing commit-by-commit.