-
Notifications
You must be signed in to change notification settings - Fork 31
Consolidate routers #193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consolidate routers #193
Conversation
Co-authored-by: Liam Ma <liam.q.ma@gmail.com>
09e5023 to
8fded4d
Compare
| if (!isServerEnvironment()) { | ||
| dispatch(actions.listen()); | ||
| } | ||
| dispatch(actions.listen()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to prevent this from being called on server?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I think this was ported incorrectly in your original changes 😂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed now in the latest commits
|
|
||
| bootstrapStore({ | ||
| ...bootstrapProps, | ||
| history: history || createMemoryHistory({ initialEntries: [location] }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If history is now required as prop, should we mandate it here too? Wonder if this might cause problem if we pass a history v4 and consumer is using history v5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a peer dependency, so it shouldn't matter. But I can change it if you like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We said we wanna deprecate this API later on anyway, so fine to leave as is
src/controllers/router/index.tsx
Outdated
|
|
||
| return ( | ||
| return ( | ||
| <ResourceContainer isGlobal={isGlobal}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on our earlier discussion, wonder if isGlobal here is really doing what we think. As if false, would getResourceStore() actually work??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well the integration tests do fail when isGlobal is false on the ResourceContainer and that is using the public API (i.e. nothing is mocked). Shall I hardcode the resource container isGlobal to true?
A continutation of #145 with the following additions:
historyprop required onRouteras it being optional previously created no reason to useMemoryRouterfor testingRouterwith a memory history passed into itcreateLocationfunctionlocationintobootstrapStoreandbootstrapStoreUniversalrespectivelylocationis always set tohistory.locationand thus goes unused in bootstrapStore and bootstrapStoreUniversalprops.locationfromRouterand preferhistory