-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Prerendering and interactive/enhanced routing #31353
Conversation
I would say there are two main categories of routing:
Static routing is where the page content gets determined by making an HTTP request to the server and displaying the response HTML on the page. Interactive routing generates page content without requiring the server to render HTML to get displayed on the page. Note: I've personally sometimes used the terms "server-side" and "client-side" rather than "static" and "interactive" because those are the terms that the rest of the industry tends to use. It just happens to be confusing in Blazor's case because a router with Server interactivity has the characteristics of a client-side router, while the routing logic is technically running on the server.
I think of navigation as the act of moving from one page to another. Routing is the act of mapping a URL to page, which is one of the mechanisms required to enable navigation.
"Enhanced" navigation is a variation of "static" navigation. A non-enhanced navigation is just a normal static navigation that clears all JS/DOM state as the navigation occurs. These are the types of navigations you would get in a Razor Pages app, for example. An enhanced navigation works similarly, except it attempts to preserve as much browser-side state as possible when displaying the new HTML returned from the server. So the hierarchy of these terms is:
Hopefully that makes sense! I don't have a very strong opinion about whether "server/client" or "static/interactive" are the right set of terms to use. Maybe @danroth27 has thoughts on this? |
Thanks @MackinnonBuck ... I'll digest that for a round of updates to this PR on Friday morning. Is what's on the PR good thus far? |
If we have a change thus far just for what's on the PR now, it will likely be for the language ...
|
Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
@MackinnonBuck ... I looked over your remarks. I think we have most of that already covered fairly well in the Routing article per our pre-holiday work. It's in two sections ... However, we don't have the cross-cutting list that you provided ...
... because we keep the subjects in two separate sections. I'm not sure if we should add more content to the Enhanced navigation and form handling section or not. One thing came up in my review of the content. I had messaged you about what I perceived to be 👽 behavior of the Persistent Component State service, but it was covered in Routing after all ...
... a bit buried as the last sentence of a paragraph and certainly something that would be easy to forget over the holiday break. This PR will now make it clear in the Prerender article. I'm going to make that a new paragraph there and add a cross-link from that remark in the Routing article to this new Prerender article content. I've also added the remark to the Interactive routing subsection of the Route to components from multiple assemblies section, also with a cross-link to the new Prerender article content. The requested review changes have been made to this PR. Would you give it a final look to see if it's good to go? |
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.
Looks good to me - I have one more piece of feedback but feel free to address it however you like 🙂
Fixes #31351
Mackinnon ...
Even if this is heading in the right direction, we probably have muddled wording for "interactive routing" and "enhanced navigation." Are they the same? ... because we're blending the language in discussion and in articles [e.g., "interactive (enhanced) routing" or "interactive (enhanced) navigation"]. If the following pairs reflect the same concepts, there's more work to do here ...
If possible, I think we should use consistent terminology everywhere. If I'm grouping compatible concepts, which of the following is the best pair to use? ... and should we loop all of the Blazor PU into this discussion?
Additionally, we've introduced "static router" and "interactive router" in just a couple of spots, and I hope to limit the use of those terms to just the few spots we have them.
Internal previews