question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFR >=2.0.0 routesMap and RFRL

See original GitHub issue

Just updated to Redux First Router 2.0.1 and got some weird errors. Looks like the location obtained thanks to state.locationis not the same as before. Not same state.location.routesMap.

Before, I got the routesMap defined as I pass it to the connecRoutes method:

import {NOT_FOUND} from 'redux-first-router';

export default {
    HOME: {path: '/'},
    [NOT_FOUND]: {path: '/404'},
};
import {connectRoutes} from 'redux-first-router';
import routes from '../../app/routesMap';
import history from '../../app/history';

connectRoutes(history, routes, {
        initialDispatch: false, // I'm using redux-sagas
    });

But now, If I look into the routesMap of the state.location, I have something like:

{
action: "POP",
block: ƒ block(),
createHref: ƒ createHref(location),
go: ƒ go(n),
goBack: ƒ goBack(),
goForward: ƒ goForward(),
length: 29,
listen: ƒ listen(listener),
location: {pathname: "/", search: "", hash: "", state: undefined},
push: ƒ push(path, state),
replace: ƒ replace(path, state),
}

Furthermore, I use Redux First Router Link too, and I cannot now create my routes, I get an error like:

toUrl.js:35 [redux-first-router-link] could not create path from action: {type: "HOME", meta: {…}} For reference, here are your current routes: {length: 29, action: "POP", location: {…}, createHref: ƒ, push: ƒ, …}

Looks like the routesMap is not correctly mapped. Do I have to change my initialization?

Will stick with version 1.9.15 for now

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:17 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ScriptedAlchemycommented, Oct 14, 2018

On the surface, it looks like RFR 2.0… Well thats because RFR2 is actually redux-first-router@rudy

Its an ancient version - from a year ago.

Rudy, is something was built for respond, its significantly different, more powerful - but our initial ideas can be seen in RFR2.

Rudy has goodies like caching built in, universal will be no more, even though we have it in here for the time being, I plan to use React 17 in its place, Reacts monorepo, in some way depends on RUC (at least according to github?). Anyways, I intend to use React 17 to base the new demos off, seeing as ill be able to rely on Suspense to handle async.

So what Rudy is, is a Rails-like application controller for Redux Applications, what im still hammering out, is nested routing - where like in rails, you can have additional routes added lower down in other controllers - like how you do it in React Router, nesting routing logic in child views.

The idea is, with our new createScene functionality (Just one file of Rudy) we can initialize sub-controllers or scenes where these viewControllers can operate. This would alleviate needing to pack everything into RoutesMap right from the start, with other work - we will have async redux reducers dynamically added along with new route controllers on the fly. Itll let you pack on and preload routing logic, views and date - dynamically.

RFR is a router, Rudy is an application controller. Rudy aligns closer with Respond than RFR. It was built for Respond, and make sense to move it to a new home, under its new name.

I released RFR2 because, RFR needed an update - i had no idea what version master was or what all the branches were for. So, I released the Rudy branch - one that i was more familiar with. The idea being, to give the users a much needed update and kick everything into a renewed support cycle for RFR, on an api that ill have a better time supporting.

The repos are also all under faceyspacey, to which i have limited access to - adding maintainers is just easier, moving forward is easier if ive got more flexibility with the repo 😛

Rudy needed a home, and everything just moved in that direction

0reactions
ScriptedAlchemycommented, Nov 5, 2018

Okay to close this out>?

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFR Pedals Flat SLT 2.0 - CUBE Bikes
High-end CNC-machined flat pedal with an aggressive flat design. Superior grip and outstanding safety come courtesy of the replaceable pins and large…
Read more >
RFR SLT 2.0 Flat Platform Pedals - Bike-Discount
The high-end CNC-machined RFR SLT 2.0 Flat Platform pedals with an aggressive flat design and low weight of only 298 g / pair.....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found