Create complex navigation at RSC demo #307
Draft
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Description
This PR adds a more complex RSC navigation to the RSC demo.
Todos
RSC Routing
Description
Understand how we can improve the routing for our RSC.
How
@david.sancho already started a Router, we can continue from there
Notes
*
Todos
How to create nested routing?
It can be achieved in different ways. The path that I took was more similar to the react-router where we can control the nested routing by context. ()
Screen.Recording.2025-10-02.at.10.13.59.mov
We can also use this context to hide the
<Outlet />
and treat it as children for layout.Route type:
What is the difference between layout and routing?
/about
" and "/
" to create the/about
page. We instead create the about.layout, as the wrapper, and the "/" will be considered theabout.page
. As soon as we navigate to "/about/me
" we will keep theabout.layout
but the final page will be composed byme.layout
+me.page.
layout(~children=page)
Why does React Router use Outlet?
How to create dynamic routing?
/:
for dream it.Handle the loading state between navigation
Nextjs does not shows the loading state of
loading
as soon as it can:Screen.Recording.2025-10-03.at.16.26.12.mov
Improve the route declaration.
/demo/router/**
Can we instead have all the routes already pre-declared?
Sample
[get("/demo/router/home"),get("/demo/router/about"), ...]
How to have the route info working across the app?
Add control over the browser back and forth buttons