Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to react router v4. #1746

Merged
merged 51 commits into from Jul 21, 2017
Merged

Conversation

anuraaga
Copy link

@anuraaga anuraaga commented May 8, 2017

React router v4 is a big change in paradigm, resulting in big changes in routing-related generators and templates. I'm hoping that future PRs can re-enable true hot-reloading after this is in.

Routes have been migrated to a component, and loading logic has been moved to separate modules instead of inlining to make it easier to define child routes.

App has been made a connected component to ensure it always has the location as a prop to ensure route rerendering even if its changed to a PureComponent or redux component.

Fixes #1033

React Boilerplate

Thank you for contributing! Please take a moment to review our contributing guidelines
to make the process easy and effective for everyone involved.

Please open an issue before embarking on any significant pull request, especially those that
add a new library or change existing tests, otherwise you risk spending a lot of time working
on something that might not end up being merged into the project.

Before opening a pull request, please ensure:

  • You have followed our contributing guidelines
  • double-check your branch is based on dev and targets dev
  • Pull request has tests (we are going for 100% coverage!)
  • Code is well-commented, linted and follows project conventions
  • Documentation is updated (if necessary)
  • Internal code generators and templates are updated (if necessary)
  • Description explains the issue/use-case resolved and auto-closes related issues

Be kind to code reviewers, please try to keep pull requests as small and focused as possible :)

IMPORTANT: By submitting a patch, you agree to allow the project
owners to license your work under the terms of the MIT License.

@anuraaga anuraaga mentioned this pull request May 8, 2017
@anuraaga anuraaga force-pushed the dev_rag branch 2 times, most recently from 7a0946a to 3be5a26 Compare May 8, 2017 05:41
@coveralls
Copy link

coveralls commented May 8, 2017

Coverage Status

Coverage increased (+0.06%) to 99.298% when pulling 3be5a26 on anuraaga:dev_rag into cfe0c7c on react-boilerplate:dev.

@blling
Copy link

blling commented May 8, 2017

Could you give a suggestion to manage saga lifecycle like #1420 ?

@anuraaga
Copy link
Author

anuraaga commented May 8, 2017

@VicBell react router callbacks are replaced by just using react component lifecycle. I think it'll be easy to achieve the same effect by updating AsyncRoute

  • Split loader and injector logic of components
  • In AsyncRoute, add componentWillMount which injects the sagas and stores a reference on this, and componentWillUnmount which cancels them.

Given how big this PR is with the minimum to add react router v4, I'd like to work on the saga lifecycle in a subsequent one if that makes sense.

@blling
Copy link

blling commented May 8, 2017

Great work. Thanks !

@blling
Copy link

blling commented May 8, 2017

There is a warning message when start up dev_rag branch

npm run start

react-boilerplate@3.4.0 start /home/bfan/git/react-boilerplate
cross-env NODE_ENV=development node server

Server started ! ✓

Access URLs:
Localhost: http://localhost:3000
LAN: http://172.26.3.83:3000

Press CTRL-C to stop

(node:5299) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.

webpack built 1435bb44a8547abe98d8 in 3697ms

@anuraaga
Copy link
Author

anuraaga commented May 8, 2017

@VicBell I can't reproduce any warning on my Macbook. Did you make sure to run yarn to have the same dependencies?

This has no warning

$ git clone git@github.com:anuraaga/react-boilerplate.git react-boilerplate-test
$ cd react-boilerplate-test
$ git fetch
$ git checkout dev_rag
$ yarn
$ npm run start

@blling
Copy link

blling commented May 8, 2017

I get a network trouble if i use yarn..., Mybe it is my mistake at somewhere.

[1/4] Resolving packages...
[2/4] Fetching packages...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
warning There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/compression/-/compression-1.6.2.tgz: tunneling socket could not be established, cause=connect EINVAL 0.0.31.144:80 - Local (0.0.0.0:0)".

Finally I delete proxy and restart my computer these issue go away and after yarn and i start dev_rag branch the DeprecationWarning also go away.

@anuraaga
Copy link
Author

anuraaga commented May 9, 2017

Any maintainer able to take a look at this? @KarandikarMihir maybe?

FWIW, in an app where I'm using this code, I've also gone ahead and migrated to react-hot-loader v3 and have perfect live reload with async routes - we can get back to the happier days of react-boilerplate :)

@blasterpistol
Copy link

Create some child route and you have got a not found page.

@anuraaga
Copy link
Author

anuraaga commented May 9, 2017

@DenisNeustroev Did you follow the updated instructions in the README?

https://github.com/anuraaga/react-boilerplate/blob/3be5a26a752b93d24581bee3c27fb1fbbca6cbd6/docs/js/routing.md

I'm not having any problem (the trickiest part is probably remembering to remove "exact" from the routes.js route for the parent page.

If you still have problems, please push a branch so I can check it out.

@blasterpistol
Copy link

Yes, my bad, its works like a charm. But there is another problem. I don't use PureComponent, and on route change my parent container re-renders twice, the first is on location change, the second when a child route loads itself, so AsyncRoute try load child route twice.

@blasterpistol
Copy link

Also AsyncRoute can pass store in loader func itself instead of doing it in every container

@blasterpistol
Copy link

ezgif com-video-to-gif

@anuraaga
Copy link
Author

anuraaga commented May 9, 2017

@DenisNeustroev Interesting, that does seem weird. I'd like to repro it, but a simple attempt with parents and children, all Component, with console.log in render() doesn't show anything out of the ordinary. Can you look at ParentPage and ChildPage1/2 in this branch to see what the difference might be with your use case?

https://github.com/anuraaga/react-boilerplate/tree/dev_rag_parent_child
Navigate to http://localhost:3000/parent and click on a child link - in the console, rendering child only shows once.

@NantawatS
Copy link

When I try using histroty.push() inside a async function it doesn't work. The location was changed but still stay on the same page.

<button
    onClick={() => {
        request.get('xxx', ()=> {
            history.push('/afterlogin');
        });
    }}
>link</button>

But if I do some think like this, it's work.

<button
    onClick={() => {
        request.get('xxx', ()=> history.push('/afterlogin'));
    }}
>link</button>

Any ideas?

@NantawatS
Copy link

I solved the issue using this approach. (link) It's not this PR issue.

@leifdalan
Copy link

@anuraaga You said you have react-hot-loader v3 working with this branch? I can't seem to get it to work with stateful components. Do you have a gist of your app/app.js file?

@anuraaga
Copy link
Author

@leifdalan Here's the diff where I added hot-reload to a project.

https://gist.github.com/anuraaga/782b017d493f2cc20af85cd9eb4634d1

The project has Component, PureComponent, and SFC and all seem to update ok - none of them use setState though, if that's what you mean by stateful component, I'm not sure whether that would have a different result. If there's a simple repro, would be happy to take a look.

</div>
);
}
}

const mapStateToProps = createStructuredSelector({
location: makeSelectLocation(),
Copy link

Choose a reason for hiding this comment

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

Why do we need location here. the variable is not used.

Copy link
Author

Choose a reason for hiding this comment

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

Without having location in the props, App will not rerender on location change if the component is pure or connected, as react-router-v4 relies on normal react rerendering semantics. Even if location isn't used, I think it's a good default to pass location to App to minimize rerender issues.

Copy link
Member

Choose a reason for hiding this comment

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

That's one of the unfortunate gotchas of new react-router. @anuraaga, please add a comment above each location: ..., I'm thinking about:

Propagate location to every connected or extending React.PureComponent component that needs to be updated on route transition. For more on this, read https://reacttraining.com/react-router/web/guides/dealing-with-update-blocking

@wer32
Copy link

wer32 commented May 20, 2017

I found issue in current pull request.

v4 router issue

The issue in routes.js it is required to add withRoutes as well as containers/App/index.js
For me it makes sence to think about moving routes.js to App/index.js

@blling
Copy link

blling commented May 23, 2017

@wer32 I also have the same issue.
@anuraaga Could you take a look at this problem?

@anuraaga
Copy link
Author

@wer32 @VicBell Fixed the route re-rendering on back button issue, and also switched not-found matching to non-exact (for some reason it was still working with exact for me, though indeed it seems incorrect).

@mihir0x69
Copy link
Member

Oh my god! So much work being done here. Thanks @anuraaga for all your efforts. I'll try it out this weekend! Thanks again.

@wer32
Copy link

wer32 commented May 24, 2017

@anuraaga @KarandikarMihir I totally agree. Great work! loader.js for components are awsome and elegant.

@peter-mouland
Copy link
Contributor

I too love the approach of the loaders...
Is slightly off topic, but out of interest to gauge public opinion...
Do people who do this recommend the approach of making every route async,
or
Do you generally only make less frequented pages async, like admin and or faq's etc?

@justingreenberg
Copy link
Member

this has been a literally been a global effort—on behalf of maintainers and users of RBP i'd like to thank everyone again for their time and contributions!

i'm pulling the trigger and merge into dev now :)

@anuraaga
Copy link
Author

Thanks @justingreenberg this is great! And thanks @Dattaya for basically rewriting my PR to make it much better :)

@mathieumg mathieumg mentioned this pull request Jul 21, 2017
8 tasks
@nclsjstnn
Copy link

i thank you all for this effort. kudos

@donszek
Copy link

donszek commented Aug 20, 2017

@justingreenberg @anuraaga Hello, thanks for this wonderful feature.

I created an issue at #1899

Basically I tried to export array of generator function which is like below. However it does not work anymore like the usual case in 3.4. May I know is this supposed to be like this? How should I then export multipler saga-watchers?

Cheers

export function* watch1() {
  yield takeLatest(CONSTANT1, DO_1);
}
export function* watch2() {
  yield takeLatest(CONSTANT2,DO_2);
}

export default [
  watch1,
  watch2,
];

@blling
Copy link

blling commented Aug 20, 2017

@donszek
I think you should take a look at here, it help me a lot

@donszek
Copy link

donszek commented Aug 20, 2017

@VicBell that is sure very helpful. thanks for the reference. appreciate it.

@williamgranli
Copy link

I'm looking for help regarding the workflow of this project. I'm looking to start up a new react project and I've previously used this boilerplate.

I'd like to get react-router v4 changes into my new project and I'm wondering what the best approach would be. Is the dev branch ready to go and relatively safe to use? I can see that it's a couple of commits behind master.

Or should I simply go for master and fetch the v4 updates as soon as they're merged with master on here.

Thanks!

@anuraaga
Copy link
Author

I have been using dev in a couple of new projects and haven't had any issues - it fixes many issues compared to master related to saga lifecycle so I'd personally recommend forking off of dev.

The model for dev and master are quite different right now due to this router work, so if you were to go with master now the upgrade later will be a good amount of work.

justingreenberg added a commit that referenced this pull request Sep 22, 2017
* Docs Update: sass.md | New webpack version -loader suffix (#1484)

* New webpack version -loader suffix

New webpack version no longer allowed to omit the '-loader' suffix when using loaders.

* Webpack 2 migration module.loaders => module.rules

* Fix Loaders/Rules

* chore(docs): fix link to redux-saga docs

Fix a broken link to redux-saga docs.

* feat(webpack): Support OpenType fonts with .otf file extension (#1471)

* chore(docs): improve testing documentation

* [doc] improve code snippet syntax in unit-testing doc

linted code snippet and removed uneeded import

* [doc] add overview of reducer test in unit testing doc

add the completed reducer test file as overview in unit testing documentation

* [doc] improve component testing doc

linted code snippets, added complete test file as refernce and link to next doc page.

* chore(setup): remove LGTM config files (#1317)

* chore(setup): remove LGTM

* Add collaborating guidelines

* Add @KarandikarMihir

* Remove .react.js extensions (#1469)

* Remove .react.js extensions

* Restore file names in the title comments

* Remove hyphens

* chore(deps): update deps roll-up Jan-21-2017 (#1501)

* fix(tests): Replace sinon restore (#1512)

* Remove sinon.restore()

* Lock down sinon version

* chore(all): move to an organisation on GitHub

* Make webpack build less verbose (#1510)

* removed route names from app/routes (#1509)

* removed route names from app/routes

* removed name prop from internals/templates/routes

* removed name from internals/gens/route/route.hbs and routeWithReducer.hbs

* fix(eslint): Enable rule react/no-array-index-key (#1521)

* enable rule react/no-array-index-key

* fix test of List component

* fix(dependencies.js): clean up console clutter for install scripts (#1532)

Ref #1506

* Fix typo i18n.md (#1541)

* chore(deps): update deps roll-up Jan-28-2017 (#1531)

* chore(deps): update deps roll-up Jan-28-2017

* Update package.json

* Set history@3.2.1

* Using optimised version of the banner (#1560)

Taken from #907

* test(build:clean script): remove test:clean from build:clean - fixes coveralls reporting? (#1563)

* Update docs (README.md, Gotchas.md) (#1534)

* Update README.md

* Update gotchas.md

* Add links to gotchas

* Update docs

* Remove redundant sentence

* Move reinstall steps to gotchas.md

* Update README.md

* Minor corrections

* Add jest cache clean to gotchas.md

* Fix team of devs link (#1566)

* chore(deps): update deps roll-up Feb-04-2017 (#1561)

* Add iOS home screen icon (#1585)

* fix manifest icons (#1568)

* manifest(fix) (#1594)

* Change dev source map style (#1559)

* (fix) ProgressBar state error (#1553)

* Bind listener to the current instance of component

* Bring up coverage

* Reassign listener with newly bound listener

* Minor changes

* Separated dev and prod middlewares (#1556)

* Update FAQ with Styles getting overridden (#1592)

* Improve <List> tests (#1134)

* Fix imported styles (#1599)

* Migrate webpack loaders

* Add comment to CSS loader
This should help clarify and reduce common problems

* Split css rules into two

* Updated docs

* First draft of new styling docs

* Fix Sass heading

* Fix links and wording

* Add LESS and other improvements

* Post test fixes

* Updated headings and added more info section

* fix: Intl polyfill for language generator (#1611)

* fix: Intl polyfill for language generator
* fix: appveyor chrome issue by adding suggested --ignore-checksums

* Fix broken link in documentation. Fixes #1638. (#1643)

* refactor(react-router-scroll): Import only useScroll (#1609)

* chore(package.json): sort ESLint config (#1660)

This PR will sort the ESLint configuration alphabetically in `package.json`.

* Fix iOS home screen icons (#1604)



* Use absolute paths

* AppVeyor install chrome ignoring checksums

* Add Stateless Functions to Container Generator (#1494)

* Add Stateless Functions to Container Generator

* Fix linting test for generators

* Tightened up generator type names

- Also made component and container use similar order and language

* Fix odd node5 issue

* and disable eslint for the var

* Fix missing reference (#1725)

* Moving Contrib documentation to the right place (#1721)

* refactor(react-router): Import only necessary components (#1608)

Instead of importing the entire library, cherry-pick the components we use.
This is [supported and encouraged](https://github.com/ReactTraining/react-router/blob/master/docs/guides/MinimizingBundleSize.md) by react-router.

Reduced the size of the main bundle by 9 KB (709 KB -> 700 KB).

* Fixing links for the contributing.md (#1738)

* a grammatical item (#1740)

* Remove state update in componentWillUpdate (#1769)

* syntatical improvements to progress bar (#1633)

* syntatical improvements to progress bar

* declare propTypes and defaultProps on the class instead of using the static keyword

* Improve the setup to recognize our own repo before clearing it. (#1720)

* Add intelligence to the setup to recognize our own repo, before nuking it. (#760, #1719)

* Cleaning up console messages upon setup

* Adding a prompt for deciding whether to clear the repo or not. Fixed: #760, #1719

* Fixing the scenario where it was not exiting this file after not removing the repository

* Doing minor changes suggested

* Updating quickstart file location (#1712)

* Request utils: handle 204 and 205 HTTP response (#1780)

* feat(core): styled-components v2 update (#1775)

* feat(core): styled-components v2 update

* fix(deps): lock version for styled plugin

* Fix: Use local instance of shelljs (#1782)

* Use local instance of shelljs

* Replace var with const

* Switching deprecated babel-preset-latest to babel-preset-env (#1736)

* adding babel-preset-env package

* replacing deprecated babel-preset-latest with babel-preset-env

to avoid the following npm installation warning:
```
npm WARN deprecated babel-preset-latest@6.24.0:
preset-latest accomplishes the same task as babel-preset-env.
Please install it with 'npm install babel-preset-env --save-dev'.
'{ "presets": ["latest"] }' to '{ "presets": ["env"] }'.
For more info, please check the docs: http://babeljs.io/docs/plugins/preset-env
```

Ref. #1667

* removing deprecated babel-preset-latest package

* Add missing word (#1789)

* Migrating from React.PropTypes to PropTypes (#1787)

* adding prop-types dependency

* migrating from React.PropTypes to PropTypes

* Adding some tests (#1784)

* tests(FeaturePage): testing shouldComponentUpdate function

* tests(HomePage): testing if username prop is missing

* tests(ProgressBar): testing when route is not changing

* tests: removing global-styles.js from coverage collect

* tests(Toggle): adding tests for empty values prop

* tests(store): adding missing tests

* tests(ProgressBar): adding missing tests

* chore(deps): update deps roll-up Jun-01-2017 (#1794)

* chore(deps): update deps roll-up Jun-01-2017

* Add react-test-renderer as dev dependency

* Remove `react-addons-test-utils`

* Use new `react-helmet` API

* Get rid of the warning: 'DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.'
Get rid of the warning: 'DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.'

* Revert line that wasn't meant to be commited

* docs(maintenance): Create dependency update doc (#1790)

* docs(maintenance): Create dependency update doc

* Update dependency.md

* Update dependency.md

* Update dependency.md

* Update dependency.md

* Add link to #598

* Update the 'tagged template literals' link to point to its new home at styled-components.com (#1824)

* feat(core): React Router v4, React-Loadable, asyncInjectors (#1746)

* Migrate to react router v4.

* Make sure Switch renders after redux state change by passing in redux location, propagate computedMatch to Route, and make not-found matcher non-exact.

* Fix route generator.

* Implicitly pass store into loader from AsyncRoute to simplify custom child route components.

* Fix route prop propagation.

* Regen yarn.lock

* Keep track of route loading in redux state and read in progress bar.

* Replace AsyncRoute with react-loadable

* Add `DefaultLoadingComponentProvider`

* Rename `loader.js` to `Loadable.js`

* Revert 9f44f1b

* small chores

* Add tests

* Update generators

* Exclude component/Loadable from coverage

* Update docs

* Make App a class that extends React.Component to enable hot reloading

* Add a link to RR4 API

* Improve generators

* Fix linting errors

* Update react-loadable

* Update yarn.lock

* Propagate InnerLoadable props to the rendered component, for Route props like match.

* Refactor

* rename withMappedState -> withConnect

* rename name to key

* Use constants

* Make 'daemon' a default mode for `injectReducer`

* Simplify `ejectSaga`

* Improve docs

* clean up

* recommend to use `ConnectedSwitch`

* turn `App` into a function like it was before

* Run CI

* Import `memoryHistory` and `browserHistory` from `react-router-dom` instead of `react-router`

* Remove path from a 'not found' route

* Update deps

* Simplify tests

* Remove modes from `injectReducer`

* Make second argument to be a descriptor in `sagaInjectors`

* Change `constants` to have consistent values

* Remove non-daemon saga descriptors in production in `ejectSaga`

* Save an entire descriptor in the saga registry

* Fix `constants` in templates

* fix(hmr): Replace `preset-hmre` with vanilla webpack HMR (#1871)

* Replace react-hmre with bare webpack hmr

* Explicitly unmount the main component

* Prevent recomputing reducers for `replaceReducer`

* Add a link to Wepack HMR to the docs

* Remove `overlay=true`

* Accept an array of modules to hot reload

* Add Debugging section in Docs + VS Code instructions (#1698)

* Add debugging section in README

* Move WebStorm FAQ to debugging section

* Add VS Code to debugging section

* Update VS Code launch config

* Update VS Code config to work in dev branch

* Add VS Code launch.json config

* Update launch.json to be compatible with master

* Update VS Code launch to be compatible with master

* Remove .vscode launch config

* Add notice on source map issue for VS Code.

* move onSubmitForm test into mapDispatchToProps test (#1644)

* Use camelcase for reducer and saga key to match selector. (#1888)

* chore(deps): remove unusable deps sinon (#1882)

* chore(deps): downgrade `sanitize.css` (#1872)

* chore(templates): turn `App` into a functional component (#1892)

Fixes #1884

* fix(generators): use correct selector names in tests and regular selectors should not be nested (#1873)

* Rename store.js to configureStore.js to Prevent conflict with storeJS… (#1904)

* Rename store.js to configureStore.js to Prevent conflict with storeJS npm package

* Fix store -> configureStore

* Bump webpack to 3.0.0 and update related deps (#1823)

* Bump webpack to 3.0.0 and related deps

* Add ModuleConcatenationPlugin to webpack base config

* Check in mysterious change in yarn.lock

* Install latest html-webpack-plugin and resolve incorrect peer dep issue

* Update webpack to 3.5.4

* Bump webpack to 3.5.5

* Move ModuleConcatenationPlugin from base to prod config, add  --display-optimization-bailout flag

* Serve Dlls via add-asset-html-webpack-plugin (#1849)

* Serve Dlls via add-asset-html-webpack-plugin

* Remove duplicate dll script tags and cheerio dependency

* Remove cheerio refs from docs

* Minor whitespace change

* Remove eslint exception in webpack.dll.babel.js

* chore(deps): Upgrade React to v15.6 (#1832)

* chore(deps): regenerate `yarn.lock` (#1931)

* chore(deps): regenerate `yarn.lock`

* Empty commit to restart netlify

* chore(3.5): Update changelog.md
gretzky pushed a commit that referenced this pull request Dec 28, 2017
* Merge v3.5 release (#1929)

* Docs Update: sass.md | New webpack version -loader suffix (#1484)

* New webpack version -loader suffix

New webpack version no longer allowed to omit the '-loader' suffix when using loaders.

* Webpack 2 migration module.loaders => module.rules

* Fix Loaders/Rules

* chore(docs): fix link to redux-saga docs

Fix a broken link to redux-saga docs.

* feat(webpack): Support OpenType fonts with .otf file extension (#1471)

* chore(docs): improve testing documentation

* [doc] improve code snippet syntax in unit-testing doc

linted code snippet and removed uneeded import

* [doc] add overview of reducer test in unit testing doc

add the completed reducer test file as overview in unit testing documentation

* [doc] improve component testing doc

linted code snippets, added complete test file as refernce and link to next doc page.

* chore(setup): remove LGTM config files (#1317)

* chore(setup): remove LGTM

* Add collaborating guidelines

* Add @KarandikarMihir

* Remove .react.js extensions (#1469)

* Remove .react.js extensions

* Restore file names in the title comments

* Remove hyphens

* chore(deps): update deps roll-up Jan-21-2017 (#1501)

* fix(tests): Replace sinon restore (#1512)

* Remove sinon.restore()

* Lock down sinon version

* chore(all): move to an organisation on GitHub

* Make webpack build less verbose (#1510)

* removed route names from app/routes (#1509)

* removed route names from app/routes

* removed name prop from internals/templates/routes

* removed name from internals/gens/route/route.hbs and routeWithReducer.hbs

* fix(eslint): Enable rule react/no-array-index-key (#1521)

* enable rule react/no-array-index-key

* fix test of List component

* fix(dependencies.js): clean up console clutter for install scripts (#1532)

Ref #1506

* Fix typo i18n.md (#1541)

* chore(deps): update deps roll-up Jan-28-2017 (#1531)

* chore(deps): update deps roll-up Jan-28-2017

* Update package.json

* Set history@3.2.1

* Using optimised version of the banner (#1560)

Taken from #907

* test(build:clean script): remove test:clean from build:clean - fixes coveralls reporting? (#1563)

* Update docs (README.md, Gotchas.md) (#1534)

* Update README.md

* Update gotchas.md

* Add links to gotchas

* Update docs

* Remove redundant sentence

* Move reinstall steps to gotchas.md

* Update README.md

* Minor corrections

* Add jest cache clean to gotchas.md

* Fix team of devs link (#1566)

* chore(deps): update deps roll-up Feb-04-2017 (#1561)

* Add iOS home screen icon (#1585)

* fix manifest icons (#1568)

* manifest(fix) (#1594)

* Change dev source map style (#1559)

* (fix) ProgressBar state error (#1553)

* Bind listener to the current instance of component

* Bring up coverage

* Reassign listener with newly bound listener

* Minor changes

* Separated dev and prod middlewares (#1556)

* Update FAQ with Styles getting overridden (#1592)

* Improve <List> tests (#1134)

* Fix imported styles (#1599)

* Migrate webpack loaders

* Add comment to CSS loader
This should help clarify and reduce common problems

* Split css rules into two

* Updated docs

* First draft of new styling docs

* Fix Sass heading

* Fix links and wording

* Add LESS and other improvements

* Post test fixes

* Updated headings and added more info section

* fix: Intl polyfill for language generator (#1611)

* fix: Intl polyfill for language generator
* fix: appveyor chrome issue by adding suggested --ignore-checksums

* Fix broken link in documentation. Fixes #1638. (#1643)

* refactor(react-router-scroll): Import only useScroll (#1609)

* chore(package.json): sort ESLint config (#1660)

This PR will sort the ESLint configuration alphabetically in `package.json`.

* Fix iOS home screen icons (#1604)



* Use absolute paths

* AppVeyor install chrome ignoring checksums

* Add Stateless Functions to Container Generator (#1494)

* Add Stateless Functions to Container Generator

* Fix linting test for generators

* Tightened up generator type names

- Also made component and container use similar order and language

* Fix odd node5 issue

* and disable eslint for the var

* Fix missing reference (#1725)

* Moving Contrib documentation to the right place (#1721)

* refactor(react-router): Import only necessary components (#1608)

Instead of importing the entire library, cherry-pick the components we use.
This is [supported and encouraged](https://github.com/ReactTraining/react-router/blob/master/docs/guides/MinimizingBundleSize.md) by react-router.

Reduced the size of the main bundle by 9 KB (709 KB -> 700 KB).

* Fixing links for the contributing.md (#1738)

* a grammatical item (#1740)

* Remove state update in componentWillUpdate (#1769)

* syntatical improvements to progress bar (#1633)

* syntatical improvements to progress bar

* declare propTypes and defaultProps on the class instead of using the static keyword

* Improve the setup to recognize our own repo before clearing it. (#1720)

* Add intelligence to the setup to recognize our own repo, before nuking it. (#760, #1719)

* Cleaning up console messages upon setup

* Adding a prompt for deciding whether to clear the repo or not. Fixed: #760, #1719

* Fixing the scenario where it was not exiting this file after not removing the repository

* Doing minor changes suggested

* Updating quickstart file location (#1712)

* Request utils: handle 204 and 205 HTTP response (#1780)

* feat(core): styled-components v2 update (#1775)

* feat(core): styled-components v2 update

* fix(deps): lock version for styled plugin

* Fix: Use local instance of shelljs (#1782)

* Use local instance of shelljs

* Replace var with const

* Switching deprecated babel-preset-latest to babel-preset-env (#1736)

* adding babel-preset-env package

* replacing deprecated babel-preset-latest with babel-preset-env

to avoid the following npm installation warning:
```
npm WARN deprecated babel-preset-latest@6.24.0:
preset-latest accomplishes the same task as babel-preset-env.
Please install it with 'npm install babel-preset-env --save-dev'.
'{ "presets": ["latest"] }' to '{ "presets": ["env"] }'.
For more info, please check the docs: http://babeljs.io/docs/plugins/preset-env
```

Ref. #1667

* removing deprecated babel-preset-latest package

* Add missing word (#1789)

* Migrating from React.PropTypes to PropTypes (#1787)

* adding prop-types dependency

* migrating from React.PropTypes to PropTypes

* Adding some tests (#1784)

* tests(FeaturePage): testing shouldComponentUpdate function

* tests(HomePage): testing if username prop is missing

* tests(ProgressBar): testing when route is not changing

* tests: removing global-styles.js from coverage collect

* tests(Toggle): adding tests for empty values prop

* tests(store): adding missing tests

* tests(ProgressBar): adding missing tests

* chore(deps): update deps roll-up Jun-01-2017 (#1794)

* chore(deps): update deps roll-up Jun-01-2017

* Add react-test-renderer as dev dependency

* Remove `react-addons-test-utils`

* Use new `react-helmet` API

* Get rid of the warning: 'DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.'
Get rid of the warning: 'DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56 parseQuery() will be replaced with getOptions() in the next major version of loader-utils.'

* Revert line that wasn't meant to be commited

* docs(maintenance): Create dependency update doc (#1790)

* docs(maintenance): Create dependency update doc

* Update dependency.md

* Update dependency.md

* Update dependency.md

* Update dependency.md

* Add link to #598

* Update the 'tagged template literals' link to point to its new home at styled-components.com (#1824)

* feat(core): React Router v4, React-Loadable, asyncInjectors (#1746)

* Migrate to react router v4.

* Make sure Switch renders after redux state change by passing in redux location, propagate computedMatch to Route, and make not-found matcher non-exact.

* Fix route generator.

* Implicitly pass store into loader from AsyncRoute to simplify custom child route components.

* Fix route prop propagation.

* Regen yarn.lock

* Keep track of route loading in redux state and read in progress bar.

* Replace AsyncRoute with react-loadable

* Add `DefaultLoadingComponentProvider`

* Rename `loader.js` to `Loadable.js`

* Revert 9f44f1b

* small chores

* Add tests

* Update generators

* Exclude component/Loadable from coverage

* Update docs

* Make App a class that extends React.Component to enable hot reloading

* Add a link to RR4 API

* Improve generators

* Fix linting errors

* Update react-loadable

* Update yarn.lock

* Propagate InnerLoadable props to the rendered component, for Route props like match.

* Refactor

* rename withMappedState -> withConnect

* rename name to key

* Use constants

* Make 'daemon' a default mode for `injectReducer`

* Simplify `ejectSaga`

* Improve docs

* clean up

* recommend to use `ConnectedSwitch`

* turn `App` into a function like it was before

* Run CI

* Import `memoryHistory` and `browserHistory` from `react-router-dom` instead of `react-router`

* Remove path from a 'not found' route

* Update deps

* Simplify tests

* Remove modes from `injectReducer`

* Make second argument to be a descriptor in `sagaInjectors`

* Change `constants` to have consistent values

* Remove non-daemon saga descriptors in production in `ejectSaga`

* Save an entire descriptor in the saga registry

* Fix `constants` in templates

* fix(hmr): Replace `preset-hmre` with vanilla webpack HMR (#1871)

* Replace react-hmre with bare webpack hmr

* Explicitly unmount the main component

* Prevent recomputing reducers for `replaceReducer`

* Add a link to Wepack HMR to the docs

* Remove `overlay=true`

* Accept an array of modules to hot reload

* Add Debugging section in Docs + VS Code instructions (#1698)

* Add debugging section in README

* Move WebStorm FAQ to debugging section

* Add VS Code to debugging section

* Update VS Code launch config

* Update VS Code config to work in dev branch

* Add VS Code launch.json config

* Update launch.json to be compatible with master

* Update VS Code launch to be compatible with master

* Remove .vscode launch config

* Add notice on source map issue for VS Code.

* move onSubmitForm test into mapDispatchToProps test (#1644)

* Use camelcase for reducer and saga key to match selector. (#1888)

* chore(deps): remove unusable deps sinon (#1882)

* chore(deps): downgrade `sanitize.css` (#1872)

* chore(templates): turn `App` into a functional component (#1892)

Fixes #1884

* fix(generators): use correct selector names in tests and regular selectors should not be nested (#1873)

* Rename store.js to configureStore.js to Prevent conflict with storeJS… (#1904)

* Rename store.js to configureStore.js to Prevent conflict with storeJS npm package

* Fix store -> configureStore

* Bump webpack to 3.0.0 and update related deps (#1823)

* Bump webpack to 3.0.0 and related deps

* Add ModuleConcatenationPlugin to webpack base config

* Check in mysterious change in yarn.lock

* Install latest html-webpack-plugin and resolve incorrect peer dep issue

* Update webpack to 3.5.4

* Bump webpack to 3.5.5

* Move ModuleConcatenationPlugin from base to prod config, add  --display-optimization-bailout flag

* Serve Dlls via add-asset-html-webpack-plugin (#1849)

* Serve Dlls via add-asset-html-webpack-plugin

* Remove duplicate dll script tags and cheerio dependency

* Remove cheerio refs from docs

* Minor whitespace change

* Remove eslint exception in webpack.dll.babel.js

* chore(deps): Upgrade React to v15.6 (#1832)

* chore(deps): regenerate `yarn.lock` (#1931)

* chore(deps): regenerate `yarn.lock`

* Empty commit to restart netlify

* chore(3.5): Update changelog.md

* chore(deps): Bump version to 3.5.0

* fix(internals): Update RBP version string in internal config (#2002)

closes #2001

* Correct babel plugin order

here is related issue comment:
babel/babel#5325 (comment)

* fix incorrect merge
@shic
Copy link

shic commented Jan 11, 2018

@blling Maybe this part of code should be like this

export default compose(
  injectSaga({ key: 'home', saga: homeSaga });
  injectSaga({ key: 'test', saga: testSaga });
)(MyComponent);

instead of

export default compose(
  injectSaga({ key: 'home', homeSaga });
  injectSaga({ key: 'test', testSaga });
)(MyComponent);

Otherwise it will not work.

You inspired me of including different sagas in the same container. But after experimenting, found that the key should always be saga.

@blling
Copy link

blling commented Jan 12, 2018

@shic Yes, you are right, saga is the param name of injectSaga, should always be saga. If your saga has a different name, you must pass the params like injectSaga({ key: 'yoursagakey', saga: yoursaganame });

@lock
Copy link

lock bot commented May 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 28, 2018
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.

None yet