diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ed39edfe..875486870 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,7 +49,7 @@ forked repo, check that it meets these guidelines: * [Squash](http://stackoverflow.com/questions/5189560/squash-my-last-x-commits-together-using-git) your commits into one for each PR. * Run `npm test` to make sure that your code style is OK and there are no any regression bugs. -* If you contributing to opt-in feature, prefix your PR title with `[feature/...]` tag. +* When contributing to an opt-in feature, apply the `[feature/...]` tag as a prefix to your PR title #### Style Guide diff --git a/README.md b/README.md index 1c898d910..84997d4ab 100644 --- a/README.md +++ b/README.md @@ -54,9 +54,11 @@ expenses via [OpenCollective](https://opencollective.com/react-starter-kit) or ### Feature branches -There are feature branches. -You can just merge and it will give you desired functionality. -These branches should be in sync with master and themselves so there should not be merging conflicts. If not, please report it. +Some features aren't provided by default, but you can optionally add them. +To do so, simply merge the corresponding feature branch. +These branches should be in sync with master and all other features branches +so there should not be any merging conflicts. +If conflicts occure, please open an issue and report to us. * [feature/redux](https://github.com/kriasoft/react-starter-kit/tree/feature/redux) – isomorphic redux support. Use [`connect()`](https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options) diff --git a/docs/recipes/feature-react-intl.md b/docs/recipes/feature-react-intl.md index d561d17b6..0d0f7879f 100644 --- a/docs/recipes/feature-react-intl.md +++ b/docs/recipes/feature-react-intl.md @@ -1,13 +1,13 @@ ## Integrating [React-Intl](https://github.com/yahoo/react-intl#react-intl) 1. Merge `feature/react-intl` branch with git. - You will get `feature/redux` too because this is based on top of it. + Because react-intl integration is built on top of `feature/redux`, you'll also get all the features. 2. Adjust `INTL_REQUIRE_DESCRIPTIONS` constant in `tools/webpack.config.js` around line 17: ```js const INTL_REQUIRE_DESCRIPTIONS = true; ``` - It's boolean. When enabled, build will fail if `description` is not provided. + When this boolean is set to true, the build will only succeed if a `description` is set for every message descriptor. 3. Adjust `locales` settings in `src/config.js`: ```js @@ -38,12 +38,12 @@ ## How to write localizable components -Just import appropriate [component](https://github.com/yahoo/react-intl/wiki#the-react-intl-module) from `react-intl` +Just import the appropriate [component](https://github.com/yahoo/react-intl/wiki#the-react-intl-module) from `react-intl` - For localizable text use [``](https://github.com/yahoo/react-intl/wiki/Components#formattedmessage). - You can also use it with -[`defineMessages()`](https://github.com/yahoo/react-intl/wiki/API#definemessages) helper. +the [`defineMessages()`](https://github.com/yahoo/react-intl/wiki/API#definemessages) helper. - For date and time: [``](https://github.com/yahoo/react-intl/wiki/Components#formatteddate) @@ -57,7 +57,7 @@ Just import appropriate [component](https://github.com/yahoo/react-intl/wiki#the - Do not use `` if possible, see how to use *Rich Text Formatting* with [``](https://github.com/yahoo/react-intl/wiki/Components#formattedmessage) -- When you need imperative formatting API, use [`injectIntl`](https://github.com/yahoo/react-intl/wiki/API#injectintl) High-Order Component. +- When you need an imperative formatting API, use the [`injectIntl`](https://github.com/yahoo/react-intl/wiki/API#injectintl) High-Order Component. ### Example @@ -106,15 +106,15 @@ export default injectIntl(Example); ## Updating translations -When developing, every source file is watched and parsed for messages on change. +When running the development server, every source file is watched and parsed for changed messages. Messages files are updated on the fly. If new definition is found, this definition is added at the end of every used `src/messages/xx-XX.json` file so when commiting, new translations are at the tail of file. When untranslated message is removed and if it's `message` field is empty too, message is deleted from all translation files. This is reason why `files` array is present. -When developing and you edit translation file, it should be copied to `build/messages/` directory. +When editiong a translation file, it should be copied to `build/messages/` directory. -## Other references +## Other References * [`Intl documentation on MDN`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl) * [express-request-language](https://github.com/tinganho/express-request-language#readme) diff --git a/docs/recipes/feature-redux.md b/docs/recipes/feature-redux.md index ed81f0e91..56545299d 100644 --- a/docs/recipes/feature-redux.md +++ b/docs/recipes/feature-redux.md @@ -2,8 +2,7 @@ Merge `feature/redux` branch with git. If you are interrested into `feature/react-intl`, -merge that branch instead. -It contains this implementation of redux +merge that branch instead as it also includes Redux. **If you don't know redux well, you should [read about it first](http://redux.js.org/docs/basics/index.html).** @@ -15,12 +14,11 @@ It contains this implementation of redux 2. Go to `src/actions/` and create file with appropriate name. You can copy `src/actions/runtime.js` as a template. - 3. If you need async action, [`redux-thunk`](https://github.com/gaearon/redux-thunk#readme) - is there for you. + 3. If you need async actions, use [`redux-thunk`](https://github.com/gaearon/redux-thunk#readme). For inspiration how to create async actions you can look at [`setLocale`](https://github.com/kriasoft/react-starter-kit/blob/feature/react-intl/src/actions/intl.js) action from `feature/react-intl`. - See [Async Flow](http://redux.js.org/docs/advanced/AsyncFlow.html) for more on this topic + See [Async Flow](http://redux.js.org/docs/advanced/AsyncFlow.html) for more information on this topic. ## Creating Reducer (aka Store) @@ -36,7 +34,7 @@ It contains this implementation of redux You can use this construct: `{ ...state, updatedKey: action.payload.value, }` - Keep in mind that store state *must* be repeatable by replaying actions on it. For example, when you store timestamp, pass it into *action payload*. - If you call REST API, do it in action. Never do this things in reducer! + If you call REST API, do it in action. *Never do this in reducer!* 2. Edit [`src/reducers/index.js`](https://github.com/kriasoft/react-starter-kit/tree/feature/redux/src/reducers/index.js), import your reducer and add it to root reducer created by [`combineReducers`](http://redux.js.org/docs/api/combineReducers.html) @@ -50,7 +48,7 @@ See [Usage With React](http://redux.js.org/docs/basics/UsageWithReact.html) on r For example you can look at [``](https://github.com/kriasoft/react-starter-kit/blob/feature/react-intl/src/components/LanguageSwitcher/LanguageSwitcher.js) -component from `feature/react-intl` branch. It demonstrates both, subscribing to store and dispathing actions. +component from `feature/react-intl` branch. It demonstrates both, subscribing to store and dispatching actions. ## Dispatching Actions On Server