Closed ryansolid closed 9 months ago
One higher-level thing I'm curious about: This shifts things like <Outlet>
away from using context, allowing you to render nested routes on the server without rendering the whole page etc., but <A>
still relies on context for its resolved path/active route matching, useNavigate()
and other hooks rely on context, etc. I'm curious how these work or don't with islands: i.e., if you useNavigate()
in an island does it throw, or is the plan to have an island router context provider in the future, or something else?
@gbj
One higher-level thing I'm curious about: This shifts things like
<Outlet>
away from using context, allowing you to render nested routes on the server without rendering the whole page etc., but<A>
still relies on context for its resolved path/active route matching,useNavigate()
and other hooks rely on context, etc. I'm curious how these work or don't with islands: i.e., if youuseNavigate()
in an island does it throw, or is the plan to have an island router context provider in the future, or something else?
Islands can still have context.. like the client part. The server part doesn't want it. Context can exist on the server on initial render because we render the whole thing. After the fact we never render the Islands. So capital A can only be used in Islands. Or rather is an Island itself. All the use
hooks only work in Islands. When we are ready to explore Hybrid routing again in that mode when we are in the noHydrate scope calls to useContext
will throw. I just haven't done that yet because the router isn't Islands safe yet. But it will be in the future. For now we only do the initial render, as we don't have hybrid routing so this restriction doesn't matter yet.
please update the doc i dont get it how to use the new route
This PR implements the RFC I posted a few weeks back: https://github.com/solidjs/solid-router/discussions/306
See the updated Readme: https://github.com/solidjs/solid-router/blob/next/README.md
I believe I've implemented the RFC plus some learnings and incorporated the feedback.
Just doing some final testing/finishing touches.