-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Make page load async when using endpoint routing #7938
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
Conversation
This is D O P E |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What problem is changing the type to be async solving? In some places it is moving GetResult from one place to another.
src/Mvc/Mvc.RazorPages/src/Infrastructure/PageLoaderMatcherPolicy.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.RazorPages/src/Infrastructure/PageActionInvokerProvider.cs
Outdated
Show resolved
Hide resolved
src/Mvc/Mvc.RazorPages/src/Infrastructure/PageLoaderMatcherPolicy.cs
Outdated
Show resolved
Hide resolved
Can you please link the issue this addresses? |
} | ||
} | ||
|
||
public virtual ValueTask<CompiledPageActionDescriptor> GetOrAddAsync(PageActionDescriptor actionDescriptor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really a good usage of ValueTask
? I don't think ValueTask
can be awaited multiple times. Also the usual pattern for this is to cache Task<T>
instead of caching T
src/Mvc/Mvc.RazorPages/src/Infrastructure/CompiledPageActionDescriptorCache.cs
Outdated
Show resolved
Hide resolved
Does this really need the breaking change label? Is the breaking change that we're not calling an old API anymore? |
a34f5ee
to
eb9c04c
Compare
* Use ActionDescriptorCollection.Version to invalidate PageLoader cache * Add tests, changes per PR
eb9c04c
to
919eb51
Compare
Not any longer. I wasn't registering the |
🆙 📅 |
public abstract class PageLoader : IPageLoader | ||
#pragma warning restore CS0618 // Type or member is obsolete | ||
{ | ||
public abstract Task<CompiledPageActionDescriptor> LoadAsync(PageActionDescriptor actionDescriptor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOCS YO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes #8016