Coder Social home page Coder Social logo

routex's Introduction

Hi there 👋

I'm Michal Kvasničák a full stack engineer from 🇸🇰. I ❤️ React, GraphQL, Node.js, Typescript...

I know this README is boring, what'd you like to know? Ask me anything!

routex's People

Contributors

malte-wessel avatar michalkvasnicak avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

routex's Issues

Initial state rehydration

Right now createRoutex discards the router state that could be generated server side. Is it because of some race condition with async routes or something else?

My use case for having the server state rehydrated is that I'd like to use the routes onEnter to specify data dependencies for the current route. Ideally this callback would be called only once, since the data the route needs should already be there when the page loads.

Multiple routers

Add possibility to have multiple routes on site

Maybe it should store in query string?

How should stores be defined in redux ?

How to prevent other routers to dispatch NOT FOUND?

And how do we know when routing finished?

[request] Support Custom Route attributes

Currently when the routes are instantiated into Route objects only a subset of the original route object copied across into a Route instance.

I'm not using react so the component attribute is of no use.
I'd like to be able to keep any custom attributes on the route e.g

const routes = [
    {
        path: '/',
        specialSauce: 1
    }
];

These are instead silently discarded.

For a router that claims to not require React the definition of the Route class kind of pushes react.

Async route and component definition

Add possibility to load route in async.

Add prop to Link component to call transitionTo with given path (and parse query params from string).
Link should not generate link for this definition of route.

Always call onEnter handlers

If user is on route for example /, router will store state to history api. But then if user is loading something using AJAX and storing to store and he refreshes the page, onEnter handler is not called because history api already contains state and data don't exist.

Solution:

onEnter handlers should be called always and user should manage caching in them by current state.

Cancel transition / Don't allow to change route in the middle of transition

Example:

User is on route A and wants to go to B, he clicks on link, router calls onLeave on the A route. In A.onLeave callback user shows confirmation dialog (for example bootstrap modal, which is async). And waits for confirmation. But somewhere he clicks on link that is routed to C.

Now, we need mechanism to tell the router that he clicked on C but A.onLeave is not resolved yet so C has to be cancelled.

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.