diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c01cb7efb3..913c95399b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,7 @@ We are open to, and grateful for, any contributions made by the community. By co ## Reporting Issues and Asking Questions -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. +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. ### Bugs and Improvements @@ -12,11 +12,11 @@ We use the issue tracker to keep track of bugs and improvements to Redux itself, ### Getting Help -**For support or usage questions like “how do I do X with Redux” and “my code doesn’t work”, please search and ask on [StackOverflow with a Redux tag](http://stackoverflow.com/questions/tagged/redux?sort=votes&pageSize=50) first.** +**For support or usage questions like “how do I do X with Redux” and “my code doesn't work”, please search and ask on [StackOverflow with a Redux tag](http://stackoverflow.com/questions/tagged/redux?sort=votes&pageSize=50) first.** We ask you to do this because StackOverflow has a much better job at keeping popular questions visible. Unfortunately good answers get lost and outdated on GitHub. -Some questions take a long time to get an answer. **If your question gets closed or you don’t get a reply on StackOverflow for longer than a few days,** we encourage you to post an issue linking to your question. We will close your issue but this will give people watching the repo an opportunity to see your question and reply to it on StackOverflow if they know the answer. +Some questions take a long time to get an answer. **If your question gets closed or you don't get a reply on StackOverflow for longer than a few days,** we encourage you to post an issue linking to your question. We will close your issue but this will give people watching the repo an opportunity to see your question and reply to it on StackOverflow if they know the answer. Please be considerate when doing this as this is not the primary purpose of the issue tracker. @@ -89,7 +89,7 @@ npm run test:watch ### Docs -Improvements to the documentation are always welcome. In the docs we abide by typographic rules, so instead of ' you should use ’. Same goes for “ ” and dashes (—) where appropriate. These rules only apply to the text, not to code blocks. +Improvements to the documentation are always welcome. In the docs we abide by typographic rules, so instead of ' you should use '. Same goes for “ ” and dashes (—) where appropriate. These rules only apply to the text, not to code blocks. #### Installing Gitbook @@ -152,7 +152,7 @@ Please visit the [Examples page](http://redux.js.org/docs/introduction/Examples. ### Sending a Pull Request -For non-trivial changes, 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. +For non-trivial changes, 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. On the other hand, sometimes the best way to start a conversation *is* to send a pull request. Use your best judgement! @@ -166,6 +166,6 @@ In general, the contribution workflow looks like this: Please try to keep your pull request focused in scope and avoid including unrelated commits. -After you have submitted your pull request, we’ll try to get back to you as soon as possible. We may suggest some changes or improvements. +After you have submitted your pull request, we'll try to get back to you as soon as possible. We may suggest some changes or improvements. Thank you for contributing! diff --git a/README.md b/README.md index b3d56378ce..a4593fbdf8 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Redux is a predictable state container for JavaScript apps. -(If you’re looking for a WordPress framework, check out [Redux Framework](https://reduxframework.com/).) +(If you're looking for a WordPress framework, check out [Redux Framework](https://reduxframework.com/).) It helps you write applications that behave consistently, run in different environments (client, server, and native), and are easy to test. On top of that, it provides a great developer experience, such as [live code editing combined with a time traveling debugger](https://github.com/gaearon/redux-devtools). @@ -20,7 +20,7 @@ It is tiny (2kB, including dependencies). ### Testimonials ->[“Love what you’re doing with Redux”](https://twitter.com/jingc/status/616608251463909376) +>[“Love what you're doing with Redux”](https://twitter.com/jingc/status/616608251463909376) >Jing Chen, creator of Flux >[“I asked for comments on Redux in FB's internal JS discussion group, and it was universally praised. Really awesome work.”](https://twitter.com/fisherwebdev/status/616286955693682688) @@ -47,24 +47,24 @@ npm install --save redux ``` This assumes you are using [npm](https://www.npmjs.com/) as your package manager. -If you don’t, you can [access these files on npmcdn](https://npmcdn.com/redux/), download them, or point your package manager to them. +If you don't, you can [access these files on npmcdn](https://npmcdn.com/redux/), download them, or point your package manager to them. Most commonly people consume Redux as a collection of [CommonJS](http://webpack.github.io/docs/commonjs.html) modules. These modules are what you get when you import `redux` in a [Webpack](http://webpack.github.io), [Browserify](http://browserify.org/), or a Node environment. If you like to live on the edge and use [Rollup](http://rollupjs.org), we support that as well. -If you don’t use a module bundler, it’s also fine. The `redux` npm package includes precompiled production and development [UMD](https://github.com/umdjs/umd) builds in the [`dist` folder](https://npmcdn.com/redux/dist/). They can be used directly without a bundler and are thus compatible with many popular JavaScript module loaders and environments. For example, you can drop a UMD build as a [`` -For our simplistic example, coercing our input into a number is sufficiently secure. If you’re handling more complex input, such as freeform text, then you should run that input through an appropriate sanitization function, such as [validator.js](https://www.npmjs.com/package/validator). +For our simplistic example, coercing our input into a number is sufficiently secure. If you're handling more complex input, such as freeform text, then you should run that input through an appropriate sanitization function, such as [validator.js](https://www.npmjs.com/package/validator). Furthermore, you can add additional layers of security by sanitizing your state output. `JSON.stringify` can be subject to script injections. To counter this, you can scrub the JSON string of HTML tags and other dangerous characters. This can be done with either a simple text replacement on the string or via more sophisticated libraries such as [serialize-javascript](https://github.com/yahoo/serialize-javascript). diff --git a/docs/recipes/UsingObjectSpreadOperator.md b/docs/recipes/UsingObjectSpreadOperator.md index 6c8954f510..494c2cd5ae 100644 --- a/docs/recipes/UsingObjectSpreadOperator.md +++ b/docs/recipes/UsingObjectSpreadOperator.md @@ -1,6 +1,6 @@ # Using Object Spread Operator -Since one of the core tenets of Redux is to never mutate state, you’ll often find yourself using [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) to create +Since one of the core tenets of Redux is to never mutate state, you'll often find yourself using [`Object.assign()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) to create copies of objects with new or updated values. For example, in the `todoApp` below `Object.assign()` is used to return a new `state` object with an updated `visibilityFilter` property: @@ -33,7 +33,7 @@ function todoApp(state = initialState, action) { } ``` -The advantage of using the object spread syntax becomes more apparent when you’re composing complex objects. Below `getAddedIds` maps an array of `id` values to an array of objects with values returned from `getProduct` and `getQuantity`. +The advantage of using the object spread syntax becomes more apparent when you're composing complex objects. Below `getAddedIds` maps an array of `id` values to an array of objects with values returned from `getProduct` and `getQuantity`. ```js return getAddedIds(state.cart).map(id => Object.assign( @@ -54,7 +54,7 @@ return getAddedIds(state.cart).map(id => ({ })) ``` -Since the object spread syntax is still a Stage 2 proposal for ECMAScript you’ll need to use a transpiler such as [Babel](http://babeljs.io/) to use it in production. You can use your existing `es2015` preset, install [`babel-plugin-transform-object-rest-spread`](http://babeljs.io/docs/plugins/transform-object-rest-spread/) and add it individually to the `plugins` array in your `.babelrc`. +Since the object spread syntax is still a Stage 2 proposal for ECMAScript you'll need to use a transpiler such as [Babel](http://babeljs.io/) to use it in production. You can use your existing `es2015` preset, install [`babel-plugin-transform-object-rest-spread`](http://babeljs.io/docs/plugins/transform-object-rest-spread/) and add it individually to the `plugins` array in your `.babelrc`. ```js { diff --git a/docs/recipes/WritingTests.md b/docs/recipes/WritingTests.md index 9e0c8dd2bd..e4fda3ab48 100644 --- a/docs/recipes/WritingTests.md +++ b/docs/recipes/WritingTests.md @@ -5,7 +5,7 @@ Because most of the Redux code you write are functions, and many of them are pur ### Setting Up We recommend [Mocha](http://mochajs.org/) as the testing engine. -Note that it runs in a Node environment, so you won’t have access to the DOM. +Note that it runs in a Node environment, so you won't have access to the DOM. ``` npm install --save-dev mocha @@ -76,7 +76,7 @@ describe('actions', () => { ### Async Action Creators -For async action creators using [Redux Thunk](https://github.com/gaearon/redux-thunk) or other middleware, it’s best to completely mock the Redux store for tests. You can apply the middleware to a mock store using [redux-mock-store](https://github.com/arnaudbenard/redux-mock-store). You can also use [nock](https://github.com/pgte/nock) to mock the HTTP requests. +For async action creators using [Redux Thunk](https://github.com/gaearon/redux-thunk) or other middleware, it's best to completely mock the Redux store for tests. You can apply the middleware to a mock store using [redux-mock-store](https://github.com/arnaudbenard/redux-mock-store). You can also use [nock](https://github.com/pgte/nock) to mock the HTTP requests. #### Example @@ -151,7 +151,7 @@ describe('async actions', () => { ### Reducers -A reducer should return the new state after applying the action to the previous state, and that’s the behavior tested below. +A reducer should return the new state after applying the action to the previous state, and that's the behavior tested below. #### Example @@ -363,7 +363,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/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. +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: @@ -377,7 +377,7 @@ export class App extends Component { /* ... */ } export default connect(mapStateToProps)(App) ``` -Since the default export is still the decorated component, the import statement pictured above will work as before so you won’t have to change your application code. However, you can now import the undecorated `App` components in your test file like this: +Since the default export is still the decorated component, the import statement pictured above will work as before so you won't have to change your application code. However, you can now import the undecorated `App` components in your test file like this: ```js // Note the curly braces: grab the named export instead of default export @@ -457,4 +457,4 @@ describe('middleware', () => { - [React Test Utils](http://facebook.github.io/react/docs/test-utils.html): Test Utilities for React. Used by Enzyme. -- [Shallow rendering](http://airbnb.io/enzyme/docs/api/shallow.html): Shallow rendering lets you instantiate a component and effectively get the result of its `render` method just a single level deep instead of rendering components recursively to a DOM. Shallow rendering is useful for unit tests, where you test a particular component only, and importantly not its children. This also means that changing a child component won’t affect the tests for the parent component. Testing a component and all its children can be accomplished with [Enzyme's `mount()` method](http://airbnb.io/enzyme/docs/api/mount.html), aka full DOM rendering. +- [Shallow rendering](http://airbnb.io/enzyme/docs/api/shallow.html): Shallow rendering lets you instantiate a component and effectively get the result of its `render` method just a single level deep instead of rendering components recursively to a DOM. Shallow rendering is useful for unit tests, where you test a particular component only, and importantly not its children. This also means that changing a child component won't affect the tests for the parent component. Testing a component and all its children can be accomplished with [Enzyme's `mount()` method](http://airbnb.io/enzyme/docs/api/mount.html), aka full DOM rendering. diff --git a/examples/real-world/actions/index.js b/examples/real-world/actions/index.js index 2692fcb069..96680788f5 100644 --- a/examples/real-world/actions/index.js +++ b/examples/real-world/actions/index.js @@ -76,7 +76,7 @@ function fetchStarred(login, nextPageUrl) { } // Fetches a page of starred repos by a particular user. -// Bails out if page is cached and user didn’t specifically request next page. +// Bails out if page is cached and user didn't specifically request next page. // Relies on Redux Thunk middleware. export function loadStarred(login, nextPage) { return (dispatch, getState) => { @@ -111,7 +111,7 @@ function fetchStargazers(fullName, nextPageUrl) { } // Fetches a page of stargazers for a particular repo. -// Bails out if page is cached and user didn’t specifically request next page. +// Bails out if page is cached and user didn't specifically request next page. // Relies on Redux Thunk middleware. export function loadStargazers(fullName, nextPage) { return (dispatch, getState) => { diff --git a/examples/real-world/containers/UserPage.js b/examples/real-world/containers/UserPage.js index 2b5bd9b0fa..d29fa015cc 100644 --- a/examples/real-world/containers/UserPage.js +++ b/examples/real-world/containers/UserPage.js @@ -44,7 +44,7 @@ class UserPage extends Component { render() { const { user, login } = this.props if (!user) { - return

Loading {login}’s profile...

+ return

Loading {login}'s profile...

} const { starredRepos, starredRepoOwners, starredPagination } = this.props @@ -55,7 +55,7 @@ class UserPage extends Component { ) diff --git a/index.d.ts b/index.d.ts index 03c29ffd5d..b043c71dae 100644 --- a/index.d.ts +++ b/index.d.ts @@ -6,11 +6,11 @@ * * Actions must have a `type` field that indicates the type of action being * performed. Types can be defined as constants and imported from another - * module. It’s better to use strings for `type` than Symbols because strings + * module. It's better to use strings for `type` than Symbols because strings * are serializable. * * Other than `type`, the structure of an action object is really up to you. - * If you’re interested, check out Flux Standard Action for recommendations on + * If you're interested, check out Flux Standard Action for recommendations on * how actions should be constructed. */ export interface Action { @@ -84,7 +84,7 @@ export function combineReducers(reducers: ReducersMapObject): Reducer; * `dispatch` function provided by the store instance without any middleware. * * The base dispatch function *always* synchronously sends an action to the - * store’s reducer, along with the previous state returned by the store, to + * store's reducer, along with the previous state returned by the store, to * calculate a new state. It expects actions to be plain objects ready to be * consumed by the reducer. * @@ -105,7 +105,7 @@ export interface Unsubscribe { } /** - * A store is an object that holds the application’s state tree. + * A store is an object that holds the application's state tree. * There should only be a single store in a Redux app, as the composition * happens on the reducer level. * @@ -211,7 +211,7 @@ export interface StoreCreator { * original store. There is an example in `compose` documentation * demonstrating that. * - * Most likely you’ll never write a store enhancer, but you may use the one + * Most likely you'll never write a store enhancer, but you may use the one * provided by the developer tools. It is what makes time travel possible * without the app being aware it is happening. Amusingly, the Redux * middleware implementation is itself a store enhancer. @@ -299,7 +299,7 @@ export function applyMiddleware(...middlewares: Middleware[]): GenericStoreEnhan * an action creator is a factory that creates an action. * * Calling an action creator only produces an action, but does not dispatch - * it. You need to call the store’s `dispatch` function to actually cause the + * it. You need to call the store's `dispatch` function to actually cause the * mutation. Sometimes we say *bound action creators* to mean functions that * call an action creator and immediately dispatch its result to a specific * store instance. diff --git a/logo/README.md b/logo/README.md index 7aed001ee2..b6f6dc7476 100644 --- a/logo/README.md +++ b/logo/README.md @@ -1,7 +1,7 @@ # The Redux Logo This is the only official Redux logo. -Don’t use any other logos to represent Redux. +Don't use any other logos to represent Redux. It comes in several flavors. @@ -21,7 +21,7 @@ Download as [PNG](https://raw.githubusercontent.com/reactjs/redux/master/logo/lo Redux Logo with Light Title -*(You can’t see the text but it’s there, in white.)* +*(You can't see the text but it's there, in white.)* Download as [PNG](https://raw.githubusercontent.com/reactjs/redux/master/logo/logo-title-light.png). @@ -29,7 +29,7 @@ Download as [PNG](https://raw.githubusercontent.com/reactjs/redux/master/logo/lo Whenever possible, we ask you to use the originals provided on this page. -If for some reason you must change how the title is rendered and can’t use the prerendered version we provide, we ask that you use the free [Lato Black](http://www.latofonts.com/lato-free-fonts/) font and ensure there is enough space between the logo and the title. +If for some reason you must change how the title is rendered and can't use the prerendered version we provide, we ask that you use the free [Lato Black](http://www.latofonts.com/lato-free-fonts/) font and ensure there is enough space between the logo and the title. When in doubt, use the original logos.