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

Fix router #949

Merged
Merged

Conversation

anthonyraymond
Copy link

Since ConnectedRouter has been introduced, history.push history.goBack and any otherhistory function has no effect on the rendering process (but dispatch actions properly ).

This probably happens because there are two router nested HashRouter from app/routes.js is nested into ConnectedRouter from app/containers/Root.js

How to reproduce:
app/Home.js

// @flow
import React, { Component } from 'react';
import styles from './Home.css';
import { history } from '../store/configureStore';

export default class Home extends Component {
  render() {
    return (
      <div>
        <div className={styles.container} data-tid="container">
          <h2>Home</h2>

          <button onClick={() => { history.push('/counter'); }}>
            test
          </button>
        </div>
      </div>
    );
  }
}

amilajack and others added 3 commits April 23, 2017 09:40
* [WIP] Route-based code splitting (electron-react-boilerplate#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (electron-react-boilerplate#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (electron-react-boilerplate#916)

* Fixed HMR (disabled multiStep) (electron-react-boilerplate#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (electron-react-boilerplate#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (electron-react-boilerplate#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (electron-react-boilerplate#928)

* Updated CHANGELOG date [ci skip]

s

* Revert "Added HtmlWebpackPlugin (electron-react-boilerplate#916)"

This reverts commit f36e9d2.

* Second attempt fix of script race condition

* Fixed flow-typed Overwrite (electron-react-boilerplate#940)

* Release 0.11.0 (electron-react-boilerplate#921)

* [WIP] Route-based code splitting (electron-react-boilerplate#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (electron-react-boilerplate#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (electron-react-boilerplate#916)

* Fixed HMR (disabled multiStep) (electron-react-boilerplate#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (electron-react-boilerplate#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (electron-react-boilerplate#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (electron-react-boilerplate#928)

* Updated CHANGELOG date [ci skip]

s

* Update package.json

* Added temporary hack to fix flow-typed

* Updated repo badge to reflect github releases

* Fixed unexpected merge override of changes

* Added support for debugging prod build, fixed prod styles, updated deps

* Updated CHANGELOG [ci skip]

* Used hash history instead of html5 router to fix route resolution
If this setting is not present then flow extension suggests to install
flow globally which should is not necessary at all because locally
flow-bin is already available.
@amilajack amilajack changed the base branch from master to dev-master April 24, 2017 14:03
@amilajack
Copy link
Member

@anthonyraymond changed the base of the PR to release v0.11.2. Would be great if you could resolve the merge conflicts

@anthonyraymond
Copy link
Author

anthonyraymond commented Apr 24, 2017

Should be ok. I used the online user-friendly "Resolve conficts" button. Didn't knew that ever exists x)
I hope this will work. Otherwise i'll do a manual commit tonight

@amilajack
Copy link
Member

@slapbox Would really appreciate if you could test this out before merging into v0.11.2

@amilajack amilajack self-requested a review April 25, 2017 05:36
@Nantris
Copy link
Contributor

Nantris commented Apr 25, 2017

I implemented it without issue in my app, but I'm not actively using the router. I am 100% single paged, so my test case is very weak, just loading my main page and then not routing again.

@Nantris
Copy link
Contributor

Nantris commented Apr 25, 2017

By the way, since it's related to router, worth mentioning it has no effect on #935 for me.

@amilajack
Copy link
Member

This is the most annoying thing about the JS ecosystem (and probably other language ecosystems). You change on upgrade some dependency and you find out later that something broke (and you have no idea why).

@Nantris
Copy link
Contributor

Nantris commented Apr 25, 2017

Much truth. Dependency hell has been made a lot less terrible by Yarn, but it still exists in its own way.

@amilajack amilajack merged commit 1014df0 into electron-react-boilerplate:dev-master Apr 26, 2017
@amilajack
Copy link
Member

Sorry for the delay on this. Wanted to take the time to do some testing myself

@anthonyraymond
Copy link
Author

No problem :)
Thabks for the merge

amilajack added a commit that referenced this pull request May 1, 2017
* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Revert "Added HtmlWebpackPlugin (#916)"

This reverts commit f36e9d2.

* Second attempt fix of script race condition

* Fixed flow-typed Overwrite (#940)

* Release 0.11.0 (#921)

* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Update package.json

* Added temporary hack to fix flow-typed

* Updated repo badge to reflect github releases

* Fixed unexpected merge override of changes

* Added support for debugging prod build, fixed prod styles, updated deps

* Updated CHANGELOG [ci skip]

* Used hash history instead of html5 router to fix route resolution

* Added snapshots to version control

* Fix router (#949)

* v0.11.1 (#941)

* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Revert "Added HtmlWebpackPlugin (#916)"

This reverts commit f36e9d2.

* Second attempt fix of script race condition

* Fixed flow-typed Overwrite (#940)

* Release 0.11.0 (#921)

* [WIP] Route-based code splitting (#884)

* Upgrading to React Router v4, using react-router-redux@next

Refactoring routes.js to use Switch

store now export history

renamed router reducer

switch to react-router-dom

* Adding code-splitting at route level

* Fix flow warnings

* Fix Typo during eslint no-shadow fix

* More flow fixes...

* Even more Flow checking

* Switching to babel preset dynamic import webpack

* Fixing CounterPage spec

* Route-based code splitting

* Updated all deps

* Updated flow types

* Fix npm start and npm run dev (#901)

* should fix npm start and npm run dev

* change back to warn about the global requires

* makes flow happy

* flow again use Children, passes npm run lint locally

* flow again use any so we only get a warning

* flow disable children

* Updated deps

* Cleaned up code style, removed unnecessary eslint supressions

* Removed flow children disabled line

* Added HtmlWebpackPlugin (#916)

* Fixed HMR (disabled multiStep) (#920)

* Fixed HMR

* Commented multiPass instead of removing

* Updated CHANGELOG (#923)

* Updated changelog

* Added more notable changes [ci skip]

* Added support for Webpack Bundle Analyzer (#922)

* Added webpack bundle analyzer to CHANGELOG [ci skip]

* Bump package.json version [ci skip]

* Bump flow-bin [ci skip]

* Fixed hot-reload refresh url

* Bumped electron

* Added Initial Jest Snapshot Testing Support (#928)

* Updated CHANGELOG date [ci skip]

s

* Update package.json

* Added temporary hack to fix flow-typed

* Updated repo badge to reflect github releases

* Fixed unexpected merge override of changes

* Added support for debugging prod build, fixed prod styles, updated deps

* Updated CHANGELOG [ci skip]

* Used hash history instead of html5 router to fix route resolution

* Use local flow-bin package (#945)

If this setting is not present then flow extension suggests to install
flow globally which should is not necessary at all because locally
flow-bin is already available.

* Fix router

* Updated all deps to latest semver

* Switch from BrowserHistory to HashHistory (#958)

* Fixed yarn package semver lock

* Renamed `./app/main.development.js` => `./app/main.{dev,prod}.js` (#963)

* Renamed `./app/main.js` => `./app/main.{dev,prod}.js`

* Renamed configStore files to keep filenames consistent

* Removed ./app/main.prod.* files from version control

* Updated CHANGELOG

* Migrated all tests to jest snapshot tests

* Added erb-sqlite-example to README [ci skip]

* Updated deps to latest semver

* Updated CHANGELOG release date [ci skip]
Copy link

@HungBay HungBay left a comment

Choose a reason for hiding this comment

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

sdadsa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants