-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Defer link interception until Router is initialized #10062
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
src/Components/Blazor/Blazor/src/Hosting/WebAssemblyHostBuilder.cs
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Blazor/src/Services/WebAssemblyUriHelper.cs
Outdated
Show resolved
Hide resolved
src/Components/test/testassets/ComponentsApp.Server/Pages/Index.cshtml
Outdated
Show resolved
Hide resolved
src/Components/test/testassets/ComponentsApp.Server/Pages/RegularRazor.cshtml
Outdated
Show resolved
Hide resolved
27b891c
to
454bab0
Compare
🆙 📅 |
Thanks for the update! Sorry I didn't get to review this today, but will make a priority of doing so tomorrow. |
@@ -28,7 +28,7 @@ internal WebAssemblyUriHelper() | |||
protected override void EnsureInitialized() | |||
{ | |||
WebAssemblyJSRuntime.Instance.Invoke<object>( | |||
Interop.EnableNavigationInterception, | |||
Interop.ListenForNavigationEvents, |
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.
Conceptually, this is so much clearer! 👍
src/Components/Components/src/Microsoft.AspNetCore.Components.csproj
Outdated
Show resolved
Hide resolved
This looks really great! One other E2E test that would be excellent to have would be showing that a component can observe the URL via |
91e7b5d
to
87c0deb
Compare
🈹 📅 |
@@ -59,6 +60,7 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env) | |||
|
|||
subdirApp.UseEndpoints(endpoints => | |||
{ | |||
endpoints.Map("NotAComponent.html", context => context.Response.WriteAsync("<div id=\"test-info\">Not a component!</div>")); |
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 line still needed, consider that you added src/Components/test/testassets/BasicTestApp/wwwroot/NotAComponent.html
?
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.
This is great, @pranavkm! Thanks for the updates. It all looks perfect now. I added one further comment about whether a certain line of code is strictly needed - please deal with or ignore this however you wish.
I think the client side router's behavior will make a lot more sense to people now. Allowing links to non-client-side URLs independently of <base href>
concerns is extremely valuable.
fc6fbd9
to
4fb3819
Compare
Fixes #9834