Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Prepare README for 2.0 #180

Merged
merged 1 commit into from
Jan 12, 2016
Merged

Prepare README for 2.0 #180

merged 1 commit into from
Jan 12, 2016

Conversation

Furizaa
Copy link
Contributor

@Furizaa Furizaa commented Jan 9, 2016

This PR updates the readme.md to reflect the API changes introduced mostly in #141 by @taion.

It also adds a little section for server-side usage - explaining that the memoryHistory has to be hydrated with the current location from the server for redux-simple-router to determine the correct initialState.

import { createHistory } from 'history'

// Creates a memoryHistory with a necessary initial pathname.
const history = createHistory({ entries: [ req.url ] });
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this section? I don't think this is the right way to do server-rendering. Why do you have a history object at all? You should be using the lower-level match API directly.

@jlongster
Copy link
Member

Thanks a lot for this! I'll merge one you remove that section. That's not the right place for an implementation detail; for server-rendering I'd rather link to proper example once we get there.

Fix typo

Clearify LocationDescriptor

Added API entry for syncHistoryToStore

Simplify Server-side example

Removed Server-side example
@Furizaa
Copy link
Contributor Author

Furizaa commented Jan 12, 2016

Removed, rebased, squashed :)

Server rendering works pretty neat for me once I figured out that I have to hydrate a memoryHistory and pass that to match for redux-simple-router to determine a non-empty initial state. But you are right - perhaps I'm able to create a failing test for this in the following days.

@jlongster
Copy link
Member

Personally I update the state after creating the server-side store with a routeActions.push action. We should have better docs about all this but let's get 2.0.0 out first. Thanks!

jlongster added a commit that referenced this pull request Jan 12, 2016
@jlongster jlongster merged commit a2b7a6b into reactjs:master Jan 12, 2016
@ericdfields
Copy link

@jlongster routeActions is undefined in the current npm package. happy to file a separate issue…

@jlongster
Copy link
Member

Nope, I'm about to release 2.0.0 so we updated the readme in preparation for it.

@ericdfields
Copy link

I sorta figured that out as the day went on :). Using 2.0 on dev right now in anticipation of the release, so I should be all ready.

@georgesboris
Copy link

Is the 2.0.0. release scheduled for today?
The lack of routeActions on the npm release was a really unexpected hold up on my development.
Should I wait for 2.0.0. (as in a few hours) or must I use an older version?

(I know this question would be better off in a separate issue, but since it has been brought up here and @jlongster said it should not be dealt with since 2.0.0 is about to be released, i figured i'd should just post it here)

@jlongster
Copy link
Member

Yes it will be released today.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants