Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Upgrade react-router-dom to v5.0 #237

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Upgrade react-router-dom to v5.0 #237

wants to merge 6 commits into from

Conversation

rtsao
Copy link
Member

@rtsao rtsao commented Feb 28, 2019

react-router 5 switches from the legacy context API to React.createContext, which breaks our usage of reading history from context in our Redirect component.

This PR is a bit of a stopgap, in the future, we should probably reconsider how router context is used and if/how/what we fork/extend/wrap from react-router. Ideally we can avoid using any private APIs and avoid similar problems in the future.

@rtsao rtsao added the bugfix label Feb 28, 2019
@codecov
Copy link

codecov bot commented Feb 28, 2019

Codecov Report

Merging #237 into master will increase coverage by 0.8%.
The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #237     +/-   ##
=========================================
+ Coverage   79.81%   80.61%   +0.8%     
=========================================
  Files          10       10             
  Lines         218      227      +9     
  Branches       48       51      +3     
=========================================
+ Hits          174      183      +9     
  Misses         30       30             
  Partials       14       14
Impacted Files Coverage Δ
src/modules/Redirect.js 90% <94.11%> (+4.28%) ⬆️

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 1558eda...29fe8f4. Read the comment docs.

@old-fusion-bot old-fusion-bot bot requested a deployment to production February 28, 2019 20:57 Abandoned
@rtsao rtsao closed this Mar 15, 2019
@rtsao rtsao reopened this Mar 15, 2019
@rtsao rtsao changed the title Upgrade react-router-dom to 4.4.0-beta Upgrade react-router-dom to v5.0 Mar 26, 2019
@rtsao rtsao requested a review from ganemone March 29, 2019 20:32
@@ -9,6 +9,9 @@
import * as React from 'react';
import PropTypes from 'prop-types';

// $FlowFixMe
Copy link

Choose a reason for hiding this comment

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

Can you describe what this $FlowFixMe is fixing? I usually add the error from Flow next to the $FlowFixMe. You can also just reply to this if you don't feel like adding that info to the code, because I'm interested in why we need it.

class Lifecycle extends React.Component<{
onConstruct?: () => void,
onMount?: () => void,
}> {
Copy link

Choose a reason for hiding this comment

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

Can you assign the object type to a type variable that describes what it represents?

React.Component<{	  
    onConstruct?: () => void,
    onMount?: () => void,
}>

// changes to 

type MyCoolType = {
    onConstruct?: () => void,
    onMount?: () => void,
};

React.Component<MyCoolType>

@Choongkyu
Copy link

Is there an ETA for merging this branch into master?

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

Successfully merging this pull request may close these issues.

4 participants