diff --git a/CHANGELOG.md b/CHANGELOG.md index 536fbaa63a..7988926791 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ # Change Log This project adheres to [Semantic Versioning](http://semver.org/). -Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/rackt/redux/releases) page. \ No newline at end of file +Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/reactjs/redux/releases) page. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bacb43be04..f867ca1aec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,14 +1,14 @@ # Contributing -We are open to, and grateful for, any contributions made by the community. By contributing to Redux, you agree to abide by the [code of conduct](https://github.com/rackt/redux/blob/master/CODE_OF_CONDUCT.md). +We are open to, and grateful for, any contributions made by the community. By contributing to Redux, you agree to abide by the [code of conduct](https://github.com/reactjs/redux/blob/master/CODE_OF_CONDUCT.md). ## Reporting Issues and Asking Questions -Before opening an issue, please search the [issue tracker](https://github.com/rackt/redux/issues) to make sure your issue hasn't already been reported. +Before opening an issue, please search the [issue tracker](https://github.com/reactjs/redux/issues) to make sure your issue hasn't already been reported. Please ask any general and implementation specific questions on [Stack Overflow with a Redux tag](http://stackoverflow.com/questions/tagged/redux?sort=votes&pageSize=50) for support. ## Development -Visit the [Issue tracker](https://github.com/rackt/redux/issues) to find a list of open issues that need attention. +Visit the [Issue tracker](https://github.com/reactjs/redux/issues) to find a list of open issues that need attention. Fork, then clone the repo: ``` @@ -90,9 +90,9 @@ npm run docs:clean ``` ### Examples -Redux comes with [official examples](http://rackt.github.io/redux/docs/introduction/Examples.html) to demonstrate various concepts and best practices. +Redux comes with [official examples](http://redux.js.org/docs/introduction/Examples.html) to demonstrate various concepts and best practices. -When adding a new example, please adhere to the style and format of the existing examples, and try to reuse as much code as possible. For example, `index.html`, `server.js`, and `webpack.config.js` can typically be reused. +When adding a new example, please adhere to the style and format of the existing examples, and try to reuse as much code as possible. For example, `index.html`, `server.js`, and `webpack.config.js` can typically be reused. >For ease of development, the webpack configs for the examples are set up so that the `redux` module is aliased to the project `src` folder when inside of the Redux folder. If an example is moved out of the Redux folder, they will instead use the version of Redux from `node_modules`. @@ -103,16 +103,16 @@ npm run build:examples npm run test:examples ``` -Please visit the [Examples page](http://rackt.github.io/redux/docs/introduction/Examples.html) for information on running an individual example. +Please visit the [Examples page](http://redux.js.org/docs/introduction/Examples.html) for information on running an individual example. ###New Features Please open an issue with a proposal for a new feature or refactoring before starting on the work. We don't want you to waste your efforts on a pull request that we won't want to accept. ###Style -[rackt](https://github.com/rackt) is trying to keep a standard style across its various projects, which can be found over in [eslint-config-rackt](https://github.com/rackt/eslint-config-rackt). If you have a style change proposal, it should first be proposed there. If accepted, we will be happy to accept a PR to implement it here. +The [reactjs](https://github.com/reactjs) GitHub org is trying to keep a standard style across its various projects, which can be found over in [eslint-config-reactjs](https://github.com/reactjs/eslint-config-reactjs). If you have a style change proposal, it should first be proposed there. If accepted, we will be happy to accept a PR to implement it here. ## Submitting Changes -* Open a new issue in the [Issue tracker](https://github.com/rackt/redux/issues). +* Open a new issue in the [Issue tracker](https://github.com/reactjs/redux/issues). * Fork the repo. * Create a new feature branch based off the `master` branch. * Make sure all tests pass and there are no linting errors. diff --git a/README.md b/README.md index 902027d3f2..0dd4b8915e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [Redux](http://rackt.github.io/redux) +# [Redux](http://redux.js.org) Redux is a predictable state container for JavaScript apps. @@ -7,7 +7,7 @@ It helps you write applications that behave consistently, run in different envir You can use Redux together with [React](https://facebook.github.io/react/), or with any other view library. It is tiny (2kB, including dependencies). -[![build status](https://img.shields.io/travis/rackt/redux/master.svg?style=flat-square)](https://travis-ci.org/rackt/redux) +[![build status](https://img.shields.io/travis/reactjs/redux/master.svg?style=flat-square)](https://travis-ci.org/reactjs/redux) [![npm version](https://img.shields.io/npm/v/redux.svg?style=flat-square)](https://www.npmjs.com/package/redux) [![npm downloads](https://img.shields.io/npm/dm/redux.svg?style=flat-square)](https://www.npmjs.com/package/redux) [![redux channel on discord](https://img.shields.io/badge/discord-%23redux%20%40%20reactiflux-61dafb.svg?style=flat-square)](https://discord.gg/0ZcbPKXt5bZ6au5t) @@ -45,7 +45,7 @@ To install the stable version: npm install --save redux ``` -Most likely, you’ll also need [the React bindings](https://github.com/rackt/react-redux) and [the developer tools](https://github.com/gaearon/redux-devtools). +Most likely, you’ll also need [the React bindings](https://github.com/reactjs/react-redux) and [the developer tools](https://github.com/gaearon/redux-devtools). ``` npm install --save react-redux @@ -141,28 +141,28 @@ If you enjoyed my course, consider supporting Egghead by [buying a subscription] ### Documentation -* [Introduction](http://rackt.github.io/redux/docs/introduction/index.html) -* [Basics](http://rackt.github.io/redux/docs/basics/index.html) -* [Advanced](http://rackt.github.io/redux/docs/advanced/index.html) -* [Recipes](http://rackt.github.io/redux/docs/recipes/index.html) -* [Troubleshooting](http://rackt.github.io/redux/docs/Troubleshooting.html) -* [Glossary](http://rackt.github.io/redux/docs/Glossary.html) -* [API Reference](http://rackt.github.io/redux/docs/api/index.html) +* [Introduction](http://redux.js.org/docs/introduction/index.html) +* [Basics](http://redux.js.org/docs/basics/index.html) +* [Advanced](http://redux.js.org/docs/advanced/index.html) +* [Recipes](http://redux.js.org/docs/recipes/index.html) +* [Troubleshooting](http://redux.js.org/docs/Troubleshooting.html) +* [Glossary](http://redux.js.org/docs/Glossary.html) +* [API Reference](http://redux.js.org/docs/api/index.html) For PDF, ePub, and MOBI exports for offline reading, and instructions on how to create them, please see: [paulkogel/redux-offline-docs](https://github.com/paulkogel/redux-offline-docs). ### Examples -* [Counter Vanilla](http://rackt.github.io/redux/docs/introduction/Examples.html#counter-vanilla) ([source](https://github.com/rackt/redux/tree/master/examples/counter-vanilla)) -* [Counter](http://rackt.github.io/redux/docs/introduction/Examples.html#counter) ([source](https://github.com/rackt/redux/tree/master/examples/counter)) -* [Todos](http://rackt.github.io/redux/docs/introduction/Examples.html#todos) ([source](https://github.com/rackt/redux/tree/master/examples/todos)) -* [Todos with Undo](http://rackt.github.io/redux/docs/introduction/Examples.html#todos-with-undo) ([source](https://github.com/rackt/redux/tree/master/examples/todos-with-undo)) -* [TodoMVC](http://rackt.github.io/redux/docs/introduction/Examples.html#todomvc) ([source](https://github.com/rackt/redux/tree/master/examples/todomvc)) -* [Shopping Cart](http://rackt.github.io/redux/docs/introduction/Examples.html#shopping-cart) ([source](https://github.com/rackt/redux/tree/master/examples/shopping-cart)) -* [Tree View](http://rackt.github.io/redux/docs/introduction/Examples.html#tree-view) ([source](https://github.com/rackt/redux/tree/master/examples/tree-view)) -* [Async](http://rackt.github.io/redux/docs/introduction/Examples.html#async) ([source](https://github.com/rackt/redux/tree/master/examples/async)) -* [Universal](http://rackt.github.io/redux/docs/introduction/Examples.html#universal) ([source](https://github.com/rackt/redux/tree/master/examples/universal)) -* [Real World](http://rackt.github.io/redux/docs/introduction/Examples.html#real-world) ([source](https://github.com/rackt/redux/tree/master/examples/real-world)) +* [Counter Vanilla](http://redux.js.org/docs/introduction/Examples.html#counter-vanilla) ([source](https://github.com/reactjs/redux/tree/master/examples/counter-vanilla)) +* [Counter](http://redux.js.org/docs/introduction/Examples.html#counter) ([source](https://github.com/reactjs/redux/tree/master/examples/counter)) +* [Todos](http://redux.js.org/docs/introduction/Examples.html#todos) ([source](https://github.com/reactjs/redux/tree/master/examples/todos)) +* [Todos with Undo](http://redux.js.org/docs/introduction/Examples.html#todos-with-undo) ([source](https://github.com/reactjs/redux/tree/master/examples/todos-with-undo)) +* [TodoMVC](http://redux.js.org/docs/introduction/Examples.html#todomvc) ([source](https://github.com/reactjs/redux/tree/master/examples/todomvc)) +* [Shopping Cart](http://redux.js.org/docs/introduction/Examples.html#shopping-cart) ([source](https://github.com/reactjs/redux/tree/master/examples/shopping-cart)) +* [Tree View](http://redux.js.org/docs/introduction/Examples.html#tree-view) ([source](https://github.com/reactjs/redux/tree/master/examples/tree-view)) +* [Async](http://redux.js.org/docs/introduction/Examples.html#async) ([source](https://github.com/reactjs/redux/tree/master/examples/async)) +* [Universal](http://redux.js.org/docs/introduction/Examples.html#universal) ([source](https://github.com/reactjs/redux/tree/master/examples/universal)) +* [Real World](http://redux.js.org/docs/introduction/Examples.html#real-world) ([source](https://github.com/reactjs/redux/tree/master/examples/real-world)) If you’re new to the NPM ecosystem and have troubles getting a project up and running, or aren’t sure where to paste the gist above, check out [simplest-redux-example](https://github.com/jackielii/simplest-redux-example) that uses Redux together with React and Browserify. @@ -188,7 +188,7 @@ Special thanks to [Jamie Paton](http://jdpaton.github.io) for handing over the ` ### Change Log This project adheres to [Semantic Versioning](http://semver.org/). -Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/rackt/redux/releases) page. +Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/reactjs/redux/releases) page. ### Patrons diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index a4061ad398..1cbced562f 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -193,5 +193,5 @@ You can then pass `dispatch` down to other components manually, if you want to. ## Something else doesn’t work -Ask around on the **#redux** [Reactiflux](http://reactiflux.com/) Discord channel, or [create an issue](https://github.com/rackt/redux/issues). -If you figure it out, [edit this document](https://github.com/rackt/redux/edit/master/docs/Troubleshooting.md) as a courtesy to the next person having the same problem. +Ask around on the **#redux** [Reactiflux](http://reactiflux.com/) Discord channel, or [create an issue](https://github.com/reactjs/redux/issues). +If you figure it out, [edit this document](https://github.com/reactjs/redux/edit/master/docs/Troubleshooting.md) as a courtesy to the next person having the same problem. diff --git a/docs/api/Store.md b/docs/api/Store.md index 52c12ae073..aa7e72e857 100644 --- a/docs/api/Store.md +++ b/docs/api/Store.md @@ -88,7 +88,7 @@ You may call [`dispatch()`](#dispatch) from a change listener, with the followin 2. The listener should not expect to see all states changes, as the state might have been updated multiple times during a nested [`dispatch()`](#dispatch) before the listener is called. It is, however, guaranteed that all subscribers registered before the [`dispatch()`](#dispatch) started will be called with the latest state by the time it exits. -It is a low-level API. Most likely, instead of using it directly, you’ll use React (or other) bindings. If you feel that the callback needs to be invoked with the current state, you might want to [convert the store to an Observable or write a custom `observeStore` utility instead](https://github.com/rackt/redux/issues/303#issuecomment-125184409). +It is a low-level API. Most likely, instead of using it directly, you’ll use React (or other) bindings. If you feel that the callback needs to be invoked with the current state, you might want to [convert the store to an Observable or write a custom `observeStore` utility instead](https://github.com/reactjs/redux/issues/303#issuecomment-125184409). To unsubscribe the change listener, invoke the function returned by `subscribe`. diff --git a/docs/basics/Reducers.md b/docs/basics/Reducers.md index 2614dff6a0..15101c8fe2 100644 --- a/docs/basics/Reducers.md +++ b/docs/basics/Reducers.md @@ -345,7 +345,7 @@ function reducer(state, action) { } ``` -All [`combineReducers()`](../api/combineReducers.md) does is generate a function that calls your reducers **with the slices of state selected according to their keys**, and combining their results into a single object again. [It’s not magic.](https://github.com/rackt/redux/issues/428#issuecomment-129223274) +All [`combineReducers()`](../api/combineReducers.md) does is generate a function that calls your reducers **with the slices of state selected according to their keys**, and combining their results into a single object again. [It’s not magic.](https://github.com/reactjs/redux/issues/428#issuecomment-129223274) >##### Note for ES6 Savvy Users @@ -358,7 +358,7 @@ All [`combineReducers()`](../api/combineReducers.md) does is generate a function >const todoApp = combineReducers(reducers) >``` > ->Because `import *` is still new syntax, we don’t use it anymore in the documentation to avoid [confusion](https://github.com/rackt/redux/issues/428#issuecomment-129223274), but you may encounter it in some community examples. +>Because `import *` is still new syntax, we don’t use it anymore in the documentation to avoid [confusion](https://github.com/reactjs/redux/issues/428#issuecomment-129223274), but you may encounter it in some community examples. ## Source Code diff --git a/docs/basics/UsageWithReact.md b/docs/basics/UsageWithReact.md index 64d0a6a1bf..4ef00768dd 100644 --- a/docs/basics/UsageWithReact.md +++ b/docs/basics/UsageWithReact.md @@ -61,7 +61,7 @@ Finished reading the article? Let’s recount their differences: Most of the components we’ll write will be presentational, but we’ll need to generate a few container components to connect them to the Redux store. -Technically you could write the container components by hand using [`store.subscribe()`](../api/Store.md#subscribe). We don’t advise you to do this because React Redux makes many performance optimizations that are hard to do by hand. For this reason, rather than write container components, we will generate them using the [`connect()`](https://github.com/rackt/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) function provided by React Redux, as you will see below. +Technically you could write the container components by hand using [`store.subscribe()`](../api/Store.md#subscribe). We don’t advise you to do this because React Redux makes many performance optimizations that are hard to do by hand. For this reason, rather than write container components, we will generate them using the [`connect()`](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) function provided by React Redux, as you will see below. ## Designing Component Hierarchy @@ -245,7 +245,7 @@ export default App ### Container Components -Now it’s time to hook up those presentational components to Redux by creating some containers. Technically, a container component is just a React component that uses [`store.subscribe()`](../api/Store.md#subscribe) to read a part of the Redux state tree and supply props to a presentational component it renders. You could write a container component by hand but React Redux includes many useful optimizations so we suggest to generate container components with [`connect()`](https://github.com/rackt/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) function from the React Redux library. +Now it’s time to hook up those presentational components to Redux by creating some containers. Technically, a container component is just a React component that uses [`store.subscribe()`](../api/Store.md#subscribe) to read a part of the Redux state tree and supply props to a presentational component it renders. You could write a container component by hand but React Redux includes many useful optimizations so we suggest to generate container components with [`connect()`](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) function from the React Redux library. To use `connect()`, you need to define a special function called `mapStateToProps` that tells how to transform the current Redux store state into the props you want to pass to a presentational component you are wrapping. For example, `VisibleTodoList` needs to calculate `todos` to pass to the `TodoList`, so we define a function that filters the `state.todos` according to the `state.visibilityFilter`, and use it in its `mapStateToProps`: @@ -293,7 +293,7 @@ const VisibleTodoList = connect( export default VisibleTodoList ``` -These are the basics of the React Redux API, but there are a few shortcuts and power options so we encourage you to check out [its documentation](https://github.com/rackt/react-redux) in detail. In case you are worried about `mapStateToProps` creating new objects too often, you might want to learn about [computing derived data](../recipes/ComputingDerivedData.md) with [reselect](https://github.com/rackt/reselect). +These are the basics of the React Redux API, but there are a few shortcuts and power options so we encourage you to check out [its documentation](https://github.com/reactjs/react-redux) in detail. In case you are worried about `mapStateToProps` creating new objects too often, you might want to learn about [computing derived data](../recipes/ComputingDerivedData.md) with [reselect](https://github.com/rackt/reselect). Find the rest of the container components defined below: @@ -401,7 +401,7 @@ export default AddTodo All container components need access to the Redux store so they can subscribe to it. One option would be to pass it as a prop to every container component. However it gets tedious, as you have to wire `store` even through presentational components just because they happen to render a container deep in the component tree. -The option we recommend is to use a special React Redux component called [``](https://github.com/rackt/react-redux/blob/master/docs/api.md#provider-store) to [magically](https://facebook.github.io/react/docs/context.html) make the store available to all container components in the application without passing it explicitly. You only need to use it once when you render the root component: +The option we recommend is to use a special React Redux component called [``](https://github.com/reactjs/react-redux/blob/master/docs/api.md#provider-store) to [magically](https://facebook.github.io/react/docs/context.html) make the store available to all container components in the application without passing it explicitly. You only need to use it once when you render the root component: #### `index.js` diff --git a/docs/introduction/Ecosystem.md b/docs/introduction/Ecosystem.md index cd25a04e42..0a2b3a746f 100644 --- a/docs/introduction/Ecosystem.md +++ b/docs/introduction/Ecosystem.md @@ -59,7 +59,7 @@ On this page we will only feature a few of them that the Redux maintainers have ### Routing -* [react-router-redux](https://github.com/rackt/react-router-redux) — Ruthlessly simple bindings to keep React Router and Redux in sync +* [react-router-redux](https://github.com/reactjs/react-router-redux) — Ruthlessly simple bindings to keep React Router and Redux in sync * [redux-router](https://github.com/acdlite/redux-router) — Redux bindings for React Router ### Components diff --git a/docs/introduction/Examples.md b/docs/introduction/Examples.md index 7d2311579d..4f1d58c542 100644 --- a/docs/introduction/Examples.md +++ b/docs/introduction/Examples.md @@ -1,16 +1,16 @@ # Examples -Redux is distributed with a few examples in its [source code](https://github.com/rackt/redux/tree/master/examples). +Redux is distributed with a few examples in its [source code](https://github.com/reactjs/redux/tree/master/examples). >##### Note on Copying >If you copy Redux examples outside their folders, you can delete some lines at the end of their `webpack.config.js` files. They follow a “You can safely delete these lines in your project.” comment. ## Counter Vanilla -Run the [Counter Vanilla](https://github.com/rackt/redux/tree/master/examples/counter-vanilla) example: +Run the [Counter Vanilla](https://github.com/reactjs/redux/tree/master/examples/counter-vanilla) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/counter-vanilla open index.html @@ -20,10 +20,10 @@ It does not require a build system or a view framework and exists to show the ra ## Counter -Run the [Counter](https://github.com/rackt/redux/tree/master/examples/counter) example: +Run the [Counter](https://github.com/reactjs/redux/tree/master/examples/counter) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/counter npm install @@ -32,16 +32,16 @@ npm start open http://localhost:3000/ ``` -This is the most basic example of using Redux together with React. For simplicity, it re-renders the React component manually when the store changes. In real projects, you will likely want to use the highly performant [React Redux](https://github.com/rackt/react-redux) bindings instead. +This is the most basic example of using Redux together with React. For simplicity, it re-renders the React component manually when the store changes. In real projects, you will likely want to use the highly performant [React Redux](https://github.com/reactjs/react-redux) bindings instead. This example includes tests. ## Todos -Run the [Todos](https://github.com/rackt/redux/tree/master/examples/todos) example: +Run the [Todos](https://github.com/reactjs/redux/tree/master/examples/todos) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/todos npm install @@ -50,16 +50,16 @@ npm start open http://localhost:3000/ ``` -This is the best example to get a deeper understanding of how the state updates work together with components in Redux. It shows how reducers can delegate handling actions to other reducers, and how you can use [React Redux](https://github.com/rackt/react-redux) to generate container components from your presentational components. +This is the best example to get a deeper understanding of how the state updates work together with components in Redux. It shows how reducers can delegate handling actions to other reducers, and how you can use [React Redux](https://github.com/reactjs/react-redux) to generate container components from your presentational components. This example includes tests. ## Todos with Undo -Run the [Todos with Undo](https://github.com/rackt/redux/tree/master/examples/todos-with-undo) example: +Run the [Todos with Undo](https://github.com/reactjs/redux/tree/master/examples/todos-with-undo) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/todos-with-undo npm install @@ -72,10 +72,10 @@ This is a variation on the previous example. It is almost identical, but additio ## TodoMVC -Run the [TodoMVC](https://github.com/rackt/redux/tree/master/examples/todomvc) example: +Run the [TodoMVC](https://github.com/reactjs/redux/tree/master/examples/todomvc) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/todomvc npm install @@ -90,10 +90,10 @@ This example includes tests. ## Shopping Cart -Run the [Shopping Cart](https://github.com/rackt/redux/tree/master/examples/shopping-cart) example: +Run the [Shopping Cart](https://github.com/reactjs/redux/tree/master/examples/shopping-cart) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/shopping-cart npm install @@ -106,10 +106,10 @@ This example shows important idiomatic Redux patterns that become important as y ## Tree View -Run the [Tree View](https://github.com/rackt/redux/tree/master/examples/tree-view) example: +Run the [Tree View](https://github.com/reactjs/redux/tree/master/examples/tree-view) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/tree-view npm install @@ -124,10 +124,10 @@ This example includes tests. ## Async -Run the [Async](https://github.com/rackt/redux/tree/master/examples/async) example: +Run the [Async](https://github.com/reactjs/redux/tree/master/examples/async) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/async npm install @@ -140,10 +140,10 @@ This example includes reading from an asynchronous API, fetching data in respons ## Universal -Run the [Universal](https://github.com/rackt/redux/tree/master/examples/universal) example: +Run the [Universal](https://github.com/reactjs/redux/tree/master/examples/universal) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/universal npm install @@ -156,10 +156,10 @@ This is a basic demonstration of [server rendering](../recipes/ServerRendering.m ## Real World -Run the [Real World](https://github.com/rackt/redux/tree/master/examples/real-world) example: +Run the [Real World](https://github.com/reactjs/redux/tree/master/examples/real-world) example: ``` -git clone https://github.com/rackt/redux.git +git clone https://github.com/reactjs/redux.git cd redux/examples/real-world npm install diff --git a/docs/introduction/PriorArt.md b/docs/introduction/PriorArt.md index 0abc2f7a5f..16c57518bd 100644 --- a/docs/introduction/PriorArt.md +++ b/docs/introduction/PriorArt.md @@ -15,13 +15,13 @@ Unlike Flux, **Redux does not have the concept of a Dispatcher**. This is becaus Another important difference from Flux is that **Redux assumes you never mutate your data**. You can use plain objects and arrays for your state just fine, but mutating them inside the reducers is strongly discouraged. You should always return a new object, which is easy with the [object spread syntax proposed for ES7](https://github.com/sebmarkbage/ecmascript-rest-spread) and implemented in [Babel](http://babeljs.io), or with a library like [Immutable](https://facebook.github.io/immutable-js). -While it is technically *possible* to [write impure reducers](https://github.com/rackt/redux/issues/328#issuecomment-125035516) that mutate the data for performance corner cases, we actively discourage you from doing this. Development features like time travel, record/replay, or hot reloading will break. Moreover it doesn’t seem like immutability poses performance problems in most real apps, because, as [Om](https://github.com/omcljs/om) demonstrates, even if you lose out on object allocation, you still win by avoiding expensive re-renders and re-calculations, as you know exactly what changed thanks to reducer purity. +While it is technically *possible* to [write impure reducers](https://github.com/reactjs/redux/issues/328#issuecomment-125035516) that mutate the data for performance corner cases, we actively discourage you from doing this. Development features like time travel, record/replay, or hot reloading will break. Moreover it doesn’t seem like immutability poses performance problems in most real apps, because, as [Om](https://github.com/omcljs/om) demonstrates, even if you lose out on object allocation, you still win by avoiding expensive re-renders and re-calculations, as you know exactly what changed thanks to reducer purity. ### Elm [Elm](http://elm-lang.org/) is a functional programming language inspired by Haskell and created by [Evan Czaplicki](https://twitter.com/czaplic). It enforces [a “model view update” architecture](https://github.com/evancz/elm-architecture-tutorial/), where the update has the following signature: `(action, state) => state`. Elm “updaters” serve the same purpose as reducers in Redux. -Unlike Redux, Elm is a language, so it is able to benefit from many things like enforced purity, static typing, out of the box immutability, and pattern matching (using the `case` expression). Even if you don’t plan to use Elm, you should read about the Elm architecture, and play with it. There is an interesting [JavaScript library playground implementing similar ideas](https://github.com/paldepind/noname-functional-frontend-framework). We should look there for inspiration on Redux! One way that we can get closer to the static typing of Elm is by [using a gradual typing solution like Flow](https://github.com/rackt/redux/issues/290). +Unlike Redux, Elm is a language, so it is able to benefit from many things like enforced purity, static typing, out of the box immutability, and pattern matching (using the `case` expression). Even if you don’t plan to use Elm, you should read about the Elm architecture, and play with it. There is an interesting [JavaScript library playground implementing similar ideas](https://github.com/paldepind/noname-functional-frontend-framework). We should look there for inspiration on Redux! One way that we can get closer to the static typing of Elm is by [using a gradual typing solution like Flow](https://github.com/reactjs/redux/issues/290). ### Immutable diff --git a/docs/recipes/ComputingDerivedData.md b/docs/recipes/ComputingDerivedData.md index 27e5f2c3b8..16c4ca16b7 100644 --- a/docs/recipes/ComputingDerivedData.md +++ b/docs/recipes/ComputingDerivedData.md @@ -98,7 +98,7 @@ const getVisibleTodosFilteredByKeyword = createSelector( ### Connecting a Selector to the Redux Store -If you are using [React Redux](https://github.com/rackt/react-redux), you can call selectors as regular functions inside `mapStateToProps()`: +If you are using [React Redux](https://github.com/reactjs/react-redux), you can call selectors as regular functions inside `mapStateToProps()`: #### `containers/VisibleTodoList.js` diff --git a/docs/recipes/ImplementingUndoHistory.md b/docs/recipes/ImplementingUndoHistory.md index c772bce1b0..63fd0800a7 100644 --- a/docs/recipes/ImplementingUndoHistory.md +++ b/docs/recipes/ImplementingUndoHistory.md @@ -364,7 +364,7 @@ You might have heard that Redux was influenced by [Elm Architecture](https://git This was all very informative, but can’t we just drop a library and use it instead of implementing `undoable` ourselves? Sure, we can! Meet [Redux Undo](https://github.com/omnidan/redux-undo), a library that provides simple Undo and Redo functionality for any part of your Redux tree. -In this part of the recipe, you will learn how to make the [Todo List example](http://rackt.github.io/redux/docs/basics/ExampleTodoList.html) undoable. You can find the full source of this recipe in the [`todos-with-undo` example that comes with Redux](https://github.com/rackt/redux/tree/master/examples/todos-with-undo). +In this part of the recipe, you will learn how to make the [Todo List example](http://redux.js.org/docs/basics/ExampleTodoList.html) undoable. You can find the full source of this recipe in the [`todos-with-undo` example that comes with Redux](https://github.com/reactjs/redux/tree/master/examples/todos-with-undo). ### Installation @@ -478,7 +478,7 @@ let UndoRedo = ({ canUndo, canRedo, onUndo, onRedo }) => ( ) ``` -You will use `connect()` from [React Redux](https://github.com/rackt/react-redux) to generate a container component. To determine whether to enable Undo and Redo buttons, you can check `state.todos.past.length` and `state.todos.future.length`. You won’t need to write action creators for performing undo and redo because Redux Undo already provides them: +You will use `connect()` from [React Redux](https://github.com/reactjs/react-redux) to generate a container component. To determine whether to enable Undo and Redo buttons, you can check `state.todos.past.length` and `state.todos.future.length`. You won’t need to write action creators for performing undo and redo because Redux Undo already provides them: #### `containers/UndoRedo.js` @@ -535,4 +535,4 @@ const App = () => ( export default App ``` -This is it! Run `npm install` and `npm start` in the [example folder](https://github.com/rackt/redux/tree/master/examples/todos-with-undo) and try it out! +This is it! Run `npm install` and `npm start` in the [example folder](https://github.com/reactjs/redux/tree/master/examples/todos-with-undo) and try it out! diff --git a/docs/recipes/MigratingToRedux.md b/docs/recipes/MigratingToRedux.md index 80e5d39e0e..e0bd4822f0 100644 --- a/docs/recipes/MigratingToRedux.md +++ b/docs/recipes/MigratingToRedux.md @@ -13,7 +13,7 @@ It is also possible to do the reverse and migrate from Redux to any of these lib Your process will look like this: -* Create a function called `createFluxStore(reducer)` that creates a Flux store compatible with your existing app from a reducer function. Internally it might look similar to [`createStore`](../api/createStore.md) ([source](https://github.com/rackt/redux/blob/master/src/createStore.js)) implementation from Redux. Its dispatch handler should just call the `reducer` for any action, store the next state, and emit change. +* Create a function called `createFluxStore(reducer)` that creates a Flux store compatible with your existing app from a reducer function. Internally it might look similar to [`createStore`](../api/createStore.md) ([source](https://github.com/reactjs/redux/blob/master/src/createStore.js)) implementation from Redux. Its dispatch handler should just call the `reducer` for any action, store the next state, and emit change. * This allows you to gradually rewrite every Flux Store in your app as a reducer, but still export `createFluxStore(reducer)` so the rest of your app is not aware that this is happening and sees the Flux stores. diff --git a/docs/recipes/ServerRendering.md b/docs/recipes/ServerRendering.md index 176b67c531..825b648cd2 100644 --- a/docs/recipes/ServerRendering.md +++ b/docs/recipes/ServerRendering.md @@ -20,7 +20,7 @@ Redux’s **_only_** job on the server side is to provide the **initial state** ## Setting Up -In the following recipe, we are going to look at how to set up server-side rendering. We’ll use the simplistic [Counter app](https://github.com/rackt/redux/tree/master/examples/counter) as a guide and show how the server can render state ahead of time based on the request. +In the following recipe, we are going to look at how to set up server-side rendering. We’ll use the simplistic [Counter app](https://github.com/reactjs/redux/tree/master/examples/counter) as a guide and show how the server can render state ahead of time based on the request. ### Install Packages @@ -168,7 +168,7 @@ Because the client side executes ongoing code, it can start with an empty initia The only input for server side code is the request made when loading up a page in your app in your browser. You may choose to configure the server during its boot (such as when you are running in a development vs. production environment), but that configuration is static. -The request contains information about the URL requested, including any query parameters, which will be useful when using something like [React Router](https://github.com/rackt/react-router). It can also contain headers with inputs like cookies or authorization, or POST body data. Let’s see how we can set the initial counter state based on a query parameter. +The request contains information about the URL requested, including any query parameters, which will be useful when using something like [React Router](https://github.com/reactjs/react-router). It can also contain headers with inputs like cookies or authorization, or POST body data. Let’s see how we can set the initial counter state based on a query parameter. #### `server.js` @@ -282,4 +282,4 @@ Furthermore, you can add additional layers of security by sanitizing your state You may want to read [Async Actions](../advanced/AsyncActions.md) to learn more about expressing asynchronous flow in Redux with async primitives such as Promises and thunks. Keep in mind that anything you learn there can also be applied to universal rendering. -If you use something like [React Router](https://github.com/rackt/react-router), you might also want to express your data fetching dependencies as static `fetchData()` methods on your route handler components. They may return [async actions](../advanced/AsyncActions.md), so that your `handleRender` function can match the route to the route handler component classes, dispatch `fetchData()` result for each of them, and render only after the Promises have resolved. This way the specific API calls required for different routes are colocated with the route handler component definitions. You can also use the same technique on the client side to prevent the router from switching the page until its data has been loaded. +If you use something like [React Router](https://github.com/reactjs/react-router), you might also want to express your data fetching dependencies as static `fetchData()` methods on your route handler components. They may return [async actions](../advanced/AsyncActions.md), so that your `handleRender` function can match the route to the route handler component classes, dispatch `fetchData()` result for each of them, and render only after the Promises have resolved. This way the specific API calls required for different routes are colocated with the route handler component definitions. You can also use the same technique on the client side to prevent the router from switching the page until its data has been loaded. diff --git a/docs/recipes/WritingTests.md b/docs/recipes/WritingTests.md index 6f4c9aa605..2e0d2c3192 100644 --- a/docs/recipes/WritingTests.md +++ b/docs/recipes/WritingTests.md @@ -155,7 +155,7 @@ export default function todos(state = initialState, action) { id: state.reduce((maxId, todo) => Math.max(todo.id, maxId), -1) + 1, completed: false, text: action.text - }, + }, ...state ] @@ -208,7 +208,7 @@ describe('todos reducer', () => { completed: false, id: 0 } - ], + ], { type: types.ADD_TODO, text: 'Run the tests' @@ -220,7 +220,7 @@ describe('todos reducer', () => { text: 'Run the tests', completed: false, id: 1 - }, + }, { text: 'Use Redux', completed: false, @@ -364,7 +364,7 @@ It’s important that this code is evaluated *before* React is imported. To ensu ### Connected Components -If you use a library like [React Redux](https://github.com/rackt/react-redux), you might be using [higher-order components](https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750) like [`connect()`](https://github.com/rackt/react-redux#connectmapstatetoprops-mapdispatchtoprops-mergeprops). This lets you inject Redux state into a regular React component. +If you use a library like [React Redux](https://github.com/reactjs/react-redux), you might be using [higher-order components](https://medium.com/@dan_abramov/mixins-are-dead-long-live-higher-order-components-94a0d2f9e750) like [`connect()`](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options). This lets you inject Redux state into a regular React component. Consider the following `App` component: @@ -382,7 +382,7 @@ In a unit test, you would normally import the `App` component like this: import App from './App' ``` -However, when you import it, you’re actually holding the wrapper component returned by `connect()`, and not the `App` component itself. If you want to test its interaction with Redux, this is good news: you can wrap it in a [``](https://github.com/rackt/react-redux#provider-store) with a store created specifically for this unit test. But sometimes you want to test just the rendering of the component, without a Redux store. +However, when you import it, you’re actually holding the wrapper component returned by `connect()`, and not the `App` component itself. If you want to test its interaction with Redux, this is good news: you can wrap it in a [``](https://github.com/reactjs/react-redux#provider-store) with a store created specifically for this unit test. But sometimes you want to test just the rendering of the component, without a Redux store. In order to be able to test the App component itself without having to deal with the decorator, we recommend you to also export the undecorated component: diff --git a/examples/async/package.json b/examples/async/package.json index 921e320cf6..6c34136b1e 100644 --- a/examples/async/package.json +++ b/examples/async/package.json @@ -7,7 +7,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "keywords": [ "react", @@ -22,9 +22,9 @@ ], "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "isomorphic-fetch": "^2.1.1", diff --git a/examples/counter/package.json b/examples/counter/package.json index bc92d552dd..09f613ae50 100644 --- a/examples/counter/package.json +++ b/examples/counter/package.json @@ -9,13 +9,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "react": "^0.14.7", "react-dom": "^0.14.7", diff --git a/examples/real-world/package.json b/examples/real-world/package.json index c08901d7f5..58c41be120 100644 --- a/examples/real-world/package.json +++ b/examples/real-world/package.json @@ -7,13 +7,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "humps": "^0.6.0", diff --git a/examples/shopping-cart/package.json b/examples/shopping-cart/package.json index a2ff8d54b0..20321a4bdb 100644 --- a/examples/shopping-cart/package.json +++ b/examples/shopping-cart/package.json @@ -7,13 +7,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "react": "^0.14.7", diff --git a/examples/todomvc/package.json b/examples/todomvc/package.json index b5200b3a3a..1f4edcd6cb 100644 --- a/examples/todomvc/package.json +++ b/examples/todomvc/package.json @@ -9,13 +9,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "classnames": "^2.1.2", diff --git a/examples/todos-with-undo/package.json b/examples/todos-with-undo/package.json index 693426436f..4a1fe30494 100644 --- a/examples/todos-with-undo/package.json +++ b/examples/todos-with-undo/package.json @@ -7,13 +7,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "react": "^0.14.7", diff --git a/examples/todos/package.json b/examples/todos/package.json index f52f0de2c8..655adf6440 100644 --- a/examples/todos/package.json +++ b/examples/todos/package.json @@ -9,13 +9,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "react": "^0.14.7", diff --git a/examples/tree-view/package.json b/examples/tree-view/package.json index 17dafc8492..7fa1745a91 100644 --- a/examples/tree-view/package.json +++ b/examples/tree-view/package.json @@ -9,13 +9,13 @@ }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "react": "^0.14.7", diff --git a/examples/universal/package.json b/examples/universal/package.json index 781a91c0aa..93e4eb1b8c 100644 --- a/examples/universal/package.json +++ b/examples/universal/package.json @@ -7,13 +7,13 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/rackt/redux.git" + "url": "git+https://github.com/reactjs/redux.git" }, "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "babel-polyfill": "^6.3.14", "babel-register": "^6.4.3", diff --git a/package.json b/package.json index a776054a1d..0961676f4d 100644 --- a/package.json +++ b/package.json @@ -28,13 +28,13 @@ "prepublish": "npm run clean && npm run check:src && npm run build", "docs:clean": "rimraf _book", "docs:prepare": "gitbook install", - "docs:build": "npm run docs:prepare && gitbook build -g rackt/redux", + "docs:build": "npm run docs:prepare && gitbook build -g reactjs/redux", "docs:watch": "npm run docs:prepare && gitbook serve", - "docs:publish": "npm run docs:clean && npm run docs:build && cp CNAME _book && cd _book && git init && git commit --allow-empty -m 'update book' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update book' && git push git@github.com:rackt/redux gh-pages --force" + "docs:publish": "npm run docs:clean && npm run docs:build && cp CNAME _book && cd _book && git init && git commit --allow-empty -m 'update book' && git checkout -b gh-pages && touch .nojekyll && git add . && git commit -am 'update book' && git push git@github.com:reactjs/redux gh-pages --force" }, "repository": { "type": "git", - "url": "https://github.com/rackt/redux.git" + "url": "https://github.com/reactjs/redux.git" }, "keywords": [ "redux", @@ -55,9 +55,9 @@ ], "license": "MIT", "bugs": { - "url": "https://github.com/rackt/redux/issues" + "url": "https://github.com/reactjs/redux/issues" }, - "homepage": "http://rackt.github.io/redux", + "homepage": "http://redux.js.org", "dependencies": { "lodash": "^4.2.1", "lodash-es": "^4.2.1",