Giter VIP home page Giter VIP logo

Comments (3)

ryansolid avatar ryansolid commented on August 19, 2024

I think this is reasonable. Especially now that I've hoisted it and router levels are no more than index used to resolve nested Routes. I had different behavior since I constructed params differently. And now that I've hoisted it above as you say you can't access that context. Which is an interesting point on it's own as it means the router needs to be the lowest global context, if you want to be able to read from context above it. It also mean data functions are outside of the tree so they can't leverage any nested contexts. I realized this while implementing and I'm not sure there is much to do for it since to parallelize nested we need to do this. With this setup we can navigate to..
users/123/settings and load both the user page and the user settings sub page in parallel while loading the data for both in parallel as well.

It does leave some questions on cascading data loads. Like what if the settings doesn't have enough from the url to know what data it needs, and needs to wait for the parents data to load first. In that case though I guess you wouldn't bother with a nested data component since you can't fetch in parallel anyway. Basically the view hierarchy can communicate to each other through props on the Route component or Context, but the data hierarchy has no similar way to communicate now that i've hoisted it. And in fact outside of a global store or props cannot communicate its results (nested contexts aren't available). These restrictions seem mostly fine but I feel like we can do better.

The answer might be related to this suggestion. Anything stored on the router itself would form a singleton context of sorts. But cleanup might be obvious. Anyway this is the sort of thing I'm thinking about.

from solid-router.

ryansolid avatar ryansolid commented on August 19, 2024

Ok done in 0.0.33. Also add NavLink and isActive

from solid-router.

amoutonbrady avatar amoutonbrady commented on August 19, 2024

Aweesome! Thank you Ryan, that'll be really helpful!

from solid-router.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.