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

Commit

Permalink
Rename things to react-router-redux! Exciting!
Browse files Browse the repository at this point in the history
  • Loading branch information
timdorr committed Jan 24, 2016
1 parent 0574e4d commit eecf670
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 39 deletions.
20 changes: 10 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## [HEAD](https://github.com/rackt/redux-simple-router/compare/2.0.4...master)
## [HEAD](https://github.com/rackt/react-router-redux/compare/2.0.4...master)

- Export action creators as individual functions. [#225](https://github.com/rackt/redux-simple-router/pull/225)
- Export action creators as individual functions. [#225](https://github.com/rackt/react-router-redux/pull/225)

## [2.0.4](https://github.com/rackt/redux-simple-router/compare/2.0.2...2.0.4)
## [2.0.4](https://github.com/rackt/react-router-redux/compare/2.0.2...2.0.4)

- Remove `history` module published within the tarball. [#133](https://github.com/rackt/redux-simple-router/issues/133)
- Make actions conform to [Flux Standard Action](https://github.com/acdlite/flux-standard-action). [#208](https://github.com/rackt/redux-simple-router/pull/208)
- Remove `history` module published within the tarball. [#133](https://github.com/rackt/react-router-redux/issues/133)
- Make actions conform to [Flux Standard Action](https://github.com/acdlite/flux-standard-action). [#208](https://github.com/rackt/react-router-redux/pull/208)

## [2.0.2](https://github.com/rackt/redux-simple-router/compare/1.0.2...2.0.2)
## [2.0.2](https://github.com/rackt/react-router-redux/compare/1.0.2...2.0.2)

Versions 2.0.0 and 2.0.1 were test releases for the 2.* series. 2.0.2 is the first public release.

Expand All @@ -19,18 +19,18 @@ Versions 2.0.0 and 2.0.1 were test releases for the 2.* series. 2.0.2 is the fir
* `UPDATE_PATH` is now `UPDATE_LOCATION`.
* The fully parsed [location object](https://github.com/rackt/history/blob/master/docs/Location.md) is now stored in the state instead of a URL string. To access the path, use `state.routing.location.pathname` instead of `state.routing.path`.

[View the new docs](https://github.com/rackt/redux-simple-router#api)
[View the new docs](https://github.com/rackt/react-router-redux#api)

## [1.0.2](https://github.com/rackt/redux-simple-router/compare/1.0.1...1.0.2)
## [1.0.2](https://github.com/rackt/react-router-redux/compare/1.0.1...1.0.2)

* Only publish relevant files to npm

## [1.0.1](https://github.com/rackt/redux-simple-router/compare/1.0.0...1.0.1)
## [1.0.1](https://github.com/rackt/react-router-redux/compare/1.0.0...1.0.1)

* Solve problem with `basename` causing infinite redirects (#103)
* Switched to ES6 imports/exports internally, but should not affect outside users

## [1.0.0](https://github.com/rackt/redux-simple-router/compare/0.0.10...1.0.0)
## [1.0.0](https://github.com/rackt/react-router-redux/compare/0.0.10...1.0.0)
> 2015-12-09
This release changes quite a bit so you'll have to update your code.
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# redux-simple-router
# react-router-redux

[![npm version](https://img.shields.io/npm/v/redux-simple-router.svg?style=flat-square)](https://www.npmjs.com/package/redux-simple-router) [![npm downloads](https://img.shields.io/npm/dm/redux-simple-router.svg?style=flat-square)](https://www.npmjs.com/package/redux-simple-router) [![build status](https://img.shields.io/travis/rackt/redux-simple-router/master.svg?style=flat-square)](https://travis-ci.org/rackt/redux-simple-router)
[![npm version](https://img.shields.io/npm/v/react-router-redux.svg?style=flat-square)](https://www.npmjs.com/package/react-router-redux) [![npm downloads](https://img.shields.io/npm/dm/react-router-redux.svg?style=flat-square)](https://www.npmjs.com/package/react-router-redux) [![build status](https://img.shields.io/travis/rackt/react-router-redux/master.svg?style=flat-square)](https://travis-ci.org/rackt/react-router-redux)

**Let react-router do all the work** :sparkles:

Expand All @@ -11,18 +11,18 @@ react-router does a great job of mapping the current URL to a component tree, an
The entire state that we are interested in boils down to one thing: the URL. This is an extremely simple library that just puts the URL in redux state and keeps it in sync with any react-router changes. Additionally, you can change the URL via redux and react-router will change accordingly.

```
npm install redux-simple-router
npm install react-router-redux
```

If you want to install the next major version, use `redux-simple-router@next`. Run `npm dist-tag ls redux-simple-router` to see what `next` is aliased to.
If you want to install the next major version, use `react-router-redux@next`. Run `npm dist-tag ls react-router-redux` to see what `next` is aliased to.

View the [CHANGELOG](https://github.com/rackt/redux-simple-router/blob/master/CHANGELOG.md) for recent changes.
View the [CHANGELOG](https://github.com/rackt/react-router-redux/blob/master/CHANGELOG.md) for recent changes.

Read the [API docs](#api) farther down this page.

##### _What about redux-router?_

[redux-router](https://github.com/rackt/redux-router) is another project which solves the same problem. However, it's far more complex. Take a quick look at [the code for this library](https://github.com/rackt/redux-simple-router/blob/master/src/index.js)—it's extremely minimal. redux-router is much bigger and more complex.
[redux-router](https://github.com/rackt/redux-router) is another project which solves the same problem. However, it's far more complex. Take a quick look at [the code for this library](https://github.com/rackt/react-router-redux/blob/master/src/index.js)—it's extremely minimal. redux-router is much bigger and more complex.

That said, redux-router is a fine project and has features this doesn't provide. Use it if you like it better.

Expand All @@ -36,7 +36,7 @@ That said, redux-router is a fine project and has features this doesn't provide.

The idea of this library is to use react-router's functionality exactly like its documentation tells you to. You can access all of its APIs in routing components. Additionally, you can use redux like you normally would, with a single app state.

[redux](https://github.com/rackt/redux) (`store.routing`)  ↔  [**redux-simple-router**](https://github.com/rackt/redux-simple-router)  ↔  [history](https://github.com/rackt/history) (`history.location`)  ↔  [react-router](https://github.com/rackt/react-router)
[redux](https://github.com/rackt/redux) (`store.routing`)  ↔  [**react-router-redux**](https://github.com/rackt/react-router-redux)  ↔  [history](https://github.com/rackt/history) (`history.location`)  ↔  [react-router](https://github.com/rackt/react-router)

We only store current URL and state, whereas redux-router stores the entire location object from react-router. You can read it, and also change it with an action.

Expand All @@ -52,7 +52,7 @@ import ReactDOM from 'react-dom'
import { createStore, combineReducers, applyMiddleware } from 'redux'
import { Provider } from 'react-redux'
import { Router, Route, browserHistory } from 'react-router'
import { syncHistory, routeReducer } from 'redux-simple-router'
import { syncHistory, routeReducer } from 'react-router-redux'
import reducers from '<project-path>/reducers'

const reducer = combineReducers(Object.assign({}, reducers, {
Expand Down Expand Up @@ -84,7 +84,7 @@ ReactDOM.render(
Now you can read from `state.routing.location.pathname` to get the URL. It's far more likely that you want to change the URL more often, however. You can use the `push` action creator that we provide:

```js
import { routeActions } from 'redux-simple-router'
import { routeActions } from 'react-router-redux'

function MyComponent({ dispatch }) {
return <Button onClick={() => dispatch(routeActions.push('/foo'))}/>;
Expand All @@ -94,7 +94,7 @@ function MyComponent({ dispatch }) {
This will change the state, which will trigger a change in react-router. Additionally, if you want to respond to the path update action, just handle the `UPDATE_LOCATION` constant that we provide:

```js
import { UPDATE_LOCATION } from 'redux-simple-router'
import { UPDATE_LOCATION } from 'react-router-redux'

function update(state, action) {
switch(action.type) {
Expand All @@ -106,7 +106,7 @@ function update(state, action) {

### Examples

* [examples/basic](https://github.com/rackt/redux-simple-router/blob/master/examples/basic) - basic reference implementation
* [examples/basic](https://github.com/rackt/react-router-redux/blob/master/examples/basic) - basic reference implementation

Examples from the community:

Expand All @@ -121,7 +121,7 @@ Examples from the community:
* [StevenIseki/redux-simple-router-example](https://github.com/StevenIseki/redux-simple-router-example)
* [mattkrick/meatier](https://github.com/mattkrick/meatier) - SSR, dual dev/prod client builds
* [mxstbr/react-boilerplate](https://github.com/mxstbr/react-boilerplate/tree/v3.0.0) - :fire: Quick setup for performance orientated, offline first React.js applications
* **Tip**: Upgrading from react-router w/o redux-simple-router? Use [this PR](https://github.com/mxstbr/react-boilerplate/pull/98/files) as a reference!
* **Tip**: Upgrading from react-router w/o react-router-redux? Use [this PR](https://github.com/mxstbr/react-boilerplate/pull/98/files) as a reference!

_Have an example to add? Send us a PR!_

Expand Down
17 changes: 8 additions & 9 deletions examples/basic/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
redux-simple-router basic example
react-router-redux basic example
=================================

This is a basic example that demonstrates rendering components based
on URLs with `react-router` as well as connecting them to Redux state.
It uses both <Link> elements as well as the `push` action creator
provided by redux-simple-router.
It uses both <Link> elements as well as the `push` action creator
provided by react-router-redux.

This example also demonstrates integration with
This example also demonstrates integration with
**[redux-devtools](https://github.com/gaearon/redux-devtools) ^3.0.0**

**To run, follow these steps:**

1. Install dependencies with `npm install` in this directory (make sure it creates a local node_modules)
2. By default, it uses the local version from `src` of redux-simple-router, so you need to run `npm install` from there first. If you want to use a version straight from npm, remove the lines in `webpack.config.js` at the bottom.
2. By default, it uses the local version from `src` of react-router-redux, so you need to run `npm install` from there first. If you want to use a version straight from npm, remove the lines in `webpack.config.js` at the bottom.
3. Build with `webpack --watch`
4. Open `index.html`

-

If you want to run the example from the npm published version of
**redux-simple-router**, remove the alias in `webpack.config`
If you want to run the example from the npm published version of
**react-router-redux**, remove the alias in `webpack.config`
to the source from line 21.

This example uses the latest version, switch to a specific tag to use a stable version:

e.g. [redux-simple-router tag 1.0.2](https://github.com/rackt/redux-simple-router/tree/1.0.2/examples/basic)

e.g. [react-router-redux tag 1.0.2](https://github.com/rackt/react-router-redux/tree/1.0.2/examples/basic)
2 changes: 1 addition & 1 deletion examples/basic/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { applyMiddleware, compose, createStore, combineReducers } from 'redux'
import { Provider } from 'react-redux'
import { Router, Route, IndexRoute } from 'react-router'
import createHistory from 'history/lib/createHashHistory'
import { syncHistory, routeReducer } from 'redux-simple-router'
import { syncHistory, routeReducer } from 'react-router-redux'

import * as reducers from './reducers'
import { App, Home, Foo, Bar } from './components'
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/components/App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { Link } from 'react-router'
import { connect } from 'react-redux'
import { routeActions } from 'redux-simple-router'
import { routeActions } from 'react-router-redux'

function App({ push, children }) {
return (
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>redux-simple-router basic example</title>
<title>react-router-redux basic example</title>
<meta charset="utf8"/>
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "rsr-basic-example",
"version": "0.0.0",
"repository": "rackt/redux-simple-router",
"repository": "rackt/react-router-redux",
"license": "MIT",
"dependencies": {
"history": "^1.14.0",
Expand All @@ -10,7 +10,7 @@
"react-redux": "^4.0.0",
"react-router": "^1.0.0",
"redux": "^3.0.4",
"redux-simple-router": "^2.0.3"
"react-router-redux": "^2.1.0"
},
"devDependencies": {
"babel-core": "^6.1.21",
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var src = path.join(__dirname, '..', '..', 'src')
var fs = require('fs')
if (fs.existsSync(src)) {
// Use the latest src
module.exports.resolve = { alias: { 'redux-simple-router': src } }
module.exports.resolve = { alias: { 'react-router-redux': src } }
module.exports.module.loaders.push({
test: /\.js$/,
loaders: ['babel'],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "redux-simple-router",
"name": "react-router-redux",
"version": "2.0.4",
"description": "Ruthlessly simple bindings to keep react-router and redux in sync",
"main": "lib/index",
Expand All @@ -9,7 +9,7 @@
"lib",
"src"
],
"repository": "rackt/redux-simple-router",
"repository": "rackt/react-router-redux",
"authors": [
"James Long"
],
Expand Down

0 comments on commit eecf670

Please sign in to comment.