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

[universal-redux] Upgrading to react-router 4.x #195

Merged
merged 12 commits into from
Apr 21, 2017

Conversation

kybarg
Copy link
Collaborator

@kybarg kybarg commented Mar 28, 2017

closes #161

@kybarg kybarg changed the title Upgrading ot react-router 4.x Upgrading to react-router 4.x Mar 28, 2017
@codecov-io
Copy link

codecov-io commented Mar 28, 2017

Codecov Report

Merging #195 into universal-redux will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           universal-redux   #195    +/-   ##
===============================================
  Coverage              100%   100%            
===============================================
  Files                    9     75    +66     
  Lines                  308    732   +424     
  Branches                92    171    +79     
===============================================
+ Hits                   308    732   +424
Impacted Files Coverage Δ
src/components/atoms/Button/index.js 100% <ø> (ø)
...rc/components/molecules/PrimaryNavigation/index.js 100% <ø> (ø)
src/components/atoms/Link/index.js 100% <ø> (ø)
src-clean/store/selectors.js
.storybook/config.js
src-clean/store/sagas.js
src-clean/store/reducer.js
src-clean/store/actions.js
src-clean/components/index.js
src/components/atoms/Atom/index.js 100% <0%> (ø)
... and 71 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 667c030...ae42549. Read the comment docs.

@diegohaz
Copy link
Owner

Awesome, @kybarg

Will review that asap

@diegohaz diegohaz changed the title Upgrading to react-router 4.x [universal-redux] Upgrading to react-router 4.x Mar 28, 2017
package.json Outdated
@@ -49,11 +49,11 @@
"nodemon": "^1.11.0",
"opn-cli": "^3.1.0",
"react-addons-test-utils": "^15.4.1",
"react-hot-loader": "^3.0.0-beta.6",
Copy link
Owner

Choose a reason for hiding this comment

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

react-hot-loader needs to be a production dependency. The library itself handles production/development properly.

package.json Outdated
"cross-env": "^3.1.4",
"csurf": "^1.9.0",
"express": "^4.14.0",
"express-force-ssl": "^0.3.2",
"file-loader": "^0.10.0",
"history": "3.0.0",
"history": "^4.6.1",
"isomorphic-fetch": "^2.2.1",
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please make that change (replacing axios by isomorphic-fetch) on another PR? It's actually a bug we missed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@diegohaz done

const baseHistory = useRouterHistory(createHistory)({ basename })
const store = configureStore(initialState, baseHistory)
const history = syncHistoryWithStore(baseHistory, store)
const history = createHistory()
Copy link
Owner

Choose a reason for hiding this comment

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

What about basename?

component &&
component[method] &&
promises.push(component[method]({ req, res, params, location, store }))
const fetchData = () => new Promise((resolve, reject) => {
Copy link
Owner

Choose a reason for hiding this comment

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

How does fetchData work now? Is that still asynchronous?

Copy link
Contributor

Choose a reason for hiding this comment

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

@diegohaz @kybarg I'm testing this out right now. Everything looks A ok 👍 When I make a post, I get this error Encountered two children with the same key, 1:$101``

Is that expected?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@protoEvangelion Can't reproduce on test environment. Could you please provide more details?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@diegohaz Sure, nothing changed in general. Only react-router match logic has changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@kybarg Sorry for the delay! This was not an issue with the upgrade. The problem existed before the upgrade. It has to do with the front end adding identical keys when creating a new post. I will address this after React-Router-4 is merged :)

@protoEvangelion protoEvangelion mentioned this pull request Mar 31, 2017
@diegohaz
Copy link
Owner

diegohaz commented Apr 1, 2017

Thank you, @kybarg ❤️

Will review that this weekend.

@Geczy Geczy mentioned this pull request Apr 1, 2017
@Geczy
Copy link

Geczy commented Apr 4, 2017

How'd the review go @diegohaz

@kybarg
Copy link
Collaborator Author

kybarg commented Apr 8, 2017

@diegohaz Any updates or your are closing this branch in favor for redux-ssr?

@diegohaz
Copy link
Owner

diegohaz commented Apr 8, 2017

I still didn't find time to proper review that. Will do as soon as possible.

@Geczy
Copy link

Geczy commented Apr 11, 2017

Can you delegate anyone else to review this? Seems like you don't have much time to, would prefer quicker updates

@diegohaz
Copy link
Owner

@Geczy It's open for anyone who wants to test it. The boilerplate itself doesn't need to be updated for people update their projects. Please, try @kybarg's branch and give your feedback.

@Geczy
Copy link

Geczy commented Apr 13, 2017

Thanks for keeping this branch up to date @kybarg

@kybarg
Copy link
Collaborator Author

kybarg commented Apr 14, 2017

@Geczy You are welcome 😄

@Geczy
Copy link

Geczy commented Apr 17, 2017

@kybarg can you merge the latest redux branch?
Edit: noticed you're on the universal branch, so maybe you can't

@Geczy
Copy link

Geczy commented Apr 17, 2017

Running yarn storybook I get this error on all the Page books:

Cannot read property 'route' of undefined
TypeError: Cannot read property 'route' of undefined
    at Route.computeMatch (webpack:///./~/react-router/Route.js?:68:22)
    at new Route (webpack:///./~/react-router/Route.js?:47:20)
    at eval (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:295:18)
    at measureLifeCyclePerf (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:75:12)
    at ReactCompositeComponentWrapper._constructComponentWithoutOwner (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:294:16)
    at ReactCompositeComponentWrapper._constructComponent (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:280:21)
    at ReactCompositeComponentWrapper.mountComponent (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:188:21)
    at Object.mountComponent (webpack:///./~/react-dom/lib/ReactReconciler.js?:46:35)
    at ReactCompositeComponentWrapper.performInitialMount (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:371:34)
    at ReactCompositeComponentWrapper.mountComponent (webpack:///./~/react-dom/lib/ReactCompositeComponent.js?:258:21)

@kybarg
Copy link
Collaborator Author

kybarg commented Apr 17, 2017

@Geczy redux or redux-ssr?

@Geczy
Copy link

Geczy commented Apr 18, 2017

kybarg:univeral-redux-rr4

@Geczy
Copy link

Geczy commented Apr 20, 2017

what's the word @kybarg

@protoEvangelion
Copy link
Contributor

@kybarg @Geczy Shouldn't we merge this into the redux-ssr branch because universal-redux is phasing out?

@diegohaz
Copy link
Owner

I'm looking into this right now. Brace yourselves, merge is coming.

@diegohaz diegohaz merged commit ae42549 into diegohaz:universal-redux Apr 21, 2017
@diegohaz
Copy link
Owner

diegohaz commented Apr 21, 2017

Sorry for the delay and thank you very much, @kybarg and everyone. I fixed the problem with pages in storybook.

The current redux-ssr is experimental (it's actually broken right now). universal-redux is still the official branch. I just need to take a moment to get it up to date with master/redux. Any help is welcome.

@kybarg kybarg deleted the univeral-redux-rr4 branch January 6, 2019 18:20
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