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

Update react-router-dom to v5 #46885

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -221,7 +221,7 @@
"react-input-range": "^1.3.0",
"react-markdown": "^3.4.1",
"react-redux": "^5.1.1",
"react-router-dom": "^4.3.1",
"react-router-dom": "^5.1.0",
"react-sizeme": "^2.3.6",
"reactcss": "1.2.3",
"redux": "4.0.0",
Expand Down Expand Up @@ -330,7 +330,7 @@
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
"@types/react-redux": "^6.0.6",
"@types/react-router-dom": "^4.3.1",
"@types/react-router-dom": "^5.1.0",
"@types/react-virtualized": "^9.18.7",
"@types/redux": "^3.6.31",
"@types/redux-actions": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-framework/package.json
Expand Up @@ -60,7 +60,7 @@
"react-dom": "^16.2.0",
"react-redux": "^5.0.6",
"react-router": "^3.2.0",
"react-router-dom": "4.2.2",
"react-router-dom": "^5.1.0",
"react-router-redux": "^4.0.8",
"redux": "3.7.2",
"redux-thunk": "2.2.0",
Expand Down
Expand Up @@ -5,17 +5,17 @@
*/

import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPageContent } from '@elastic/eui';
import React from 'react';
import { withRouter } from 'react-router-dom';
import React, { ComponentProps } from 'react';
import { withRouter, RouteComponentProps } from 'react-router-dom';

interface LayoutProps {
interface LayoutProps extends ComponentProps<any>, RouteComponentProps {
title: string | React.ReactNode;
actionSection?: React.ReactNode;
modalClosePath?: string;
}

export const NoDataLayout: React.SFC<LayoutProps> = withRouter<any>(
({ actionSection, title, modalClosePath, children, history }) => {
export const NoDataLayout = withRouter(
({ actionSection, title, modalClosePath, children, history }: LayoutProps) => {
return (
<EuiFlexGroup justifyContent="spaceAround">
<EuiFlexItem grow={false}>
Expand All @@ -31,4 +31,4 @@ export const NoDataLayout: React.SFC<LayoutProps> = withRouter<any>(
</EuiFlexGroup>
);
}
) as any;
);
Expand Up @@ -3,10 +3,18 @@
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import React from 'react';
import React, { ComponentProps } from 'react';

import { EuiLink } from '@elastic/eui';
import { Link, withRouter } from 'react-router-dom';
import { Link, RouteComponentProps, withRouter } from 'react-router-dom';

interface ConnectedLinkComponentProps extends ComponentProps<any>, RouteComponentProps {
location: any;
path: string;
disabled: boolean;
query: any;
[key: string]: any;
}

export function ConnectedLinkComponent({
location,
Expand All @@ -15,13 +23,7 @@ export function ConnectedLinkComponent({
disabled,
children,
...props
}: {
location: any;
path: string;
disabled: boolean;
query: any;
[key: string]: any;
}) {
}: ConnectedLinkComponentProps) {
if (disabled) {
return <EuiLink aria-disabled="true" {...props} />;
}
Expand All @@ -38,4 +40,4 @@ export function ConnectedLinkComponent({
);
}

export const ConnectedLink = withRouter<any>(ConnectedLinkComponent);
export const ConnectedLink = withRouter(ConnectedLinkComponent);
Expand Up @@ -6,7 +6,7 @@

import { parse, stringify } from 'querystring';
import React from 'react';
import { withRouter } from 'react-router-dom';
import { RouteComponentProps, withRouter } from 'react-router-dom';
import { FlatObject } from '../frontend_types';
import { RendererFunction } from '../utils/typed_react';

Expand All @@ -22,7 +22,7 @@ export interface URLStateProps<URLState = object> {
) => void;
urlState: URLState;
}
interface ComponentProps<URLState extends object> {
interface ComponentProps<URLState extends object> extends RouteComponentProps {
history: any;
match: any;
children: RendererFunction<URLStateProps<URLState>>;
Expand Down Expand Up @@ -86,7 +86,7 @@ export class WithURLStateComponent<URLState extends object> extends React.Compon
});
};
}
export const WithURLState = withRouter<any>(WithURLStateComponent);
export const WithURLState = withRouter(WithURLStateComponent);

export function withUrlState<OP>(
UnwrappedComponent: React.ComponentType<OP & URLStateProps>
Expand Down
4 changes: 2 additions & 2 deletions x-pack/package.json
Expand Up @@ -92,7 +92,7 @@
"@types/react-dom": "^16.8.0",
"@types/react-redux": "^6.0.6",
"@types/react-resize-detector": "^4.0.1",
"@types/react-router-dom": "^4.3.1",
"@types/react-router-dom": "^5.1.0",
"@types/react-sticky": "^6.0.3",
"@types/react-test-renderer": "^16.8.0",
"@types/recompose": "^0.30.6",
Expand Down Expand Up @@ -316,7 +316,7 @@
"react-redux": "^5.1.1",
"react-resize-detector": "^4.2.0",
"react-reverse-portal": "^1.0.4",
"react-router-dom": "^4.3.1",
"react-router-dom": "^5.1.0",
"react-shortcuts": "^2.0.0",
"react-sticky": "^6.0.3",
"react-syntax-highlighter": "^5.7.0",
Expand Down
131 changes: 54 additions & 77 deletions yarn.lock
Expand Up @@ -960,6 +960,13 @@
dependencies:
regenerator-runtime "^0.13.2"

"@babel/runtime@^7.4.0":
version "7.6.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.6.3.tgz#935122c74c73d2240cafd32ddb5fc2a6cd35cf1f"
integrity sha512-kq6anf9JGjW8Nt5rYfEuGRaEAaH1mkv3Bbu6rYvLOpPh/RusSJXuKPEAoZ7L7gybZkchE8+NV5g9vKF4AGAtsA==
dependencies:
regenerator-runtime "^0.13.2"

"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.4.0", "@babel/template@^7.4.4":
version "7.4.4"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.4.4.tgz#f4b88d1225689a08f5bc3a17483545be9e4ed237"
Expand Down Expand Up @@ -3813,19 +3820,19 @@
dependencies:
"@types/react" "*"

"@types/react-router-dom@^4.3.1":
version "4.3.1"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-4.3.1.tgz#71fe2918f8f60474a891520def40a63997dafe04"
integrity sha512-GbztJAScOmQ/7RsQfO4cd55RuH1W4g6V1gDW3j4riLlt+8yxYLqqsiMzmyuXBLzdFmDtX/uU2Bpcm0cmudv44A==
"@types/react-router-dom@^5.1.0":
version "5.1.1"
resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.1.1.tgz#77a2dae8ba6ff1df51d27517f7646127a51a1a3e"
integrity sha512-yXqWGaehta/cdmjvEQfCbHFX6l1c7QHuE5n2OfhcJ33ufbt55xhAKqQ0BmT24YM3s7OKwrrUUgY3FaSzO7be3Q==
dependencies:
"@types/history" "*"
"@types/react" "*"
"@types/react-router" "*"

"@types/react-router@*":
version "4.0.32"
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-4.0.32.tgz#501529e3d7aa7d5c738d339367e1a7dd5338b2a7"
integrity sha512-VLQSifCIKCTpfMFrJN/nO5a45LduB6qSMkO9ASbcGdCHiDwJnrLNzk91Q895yG0qWY7RqT2jR16giBRpRG1HQw==
version "5.1.2"
resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.2.tgz#41e5e6aa333a7b9a2bfdac753c04e1ca4b3e0d21"
integrity sha512-euC3SiwDg3NcjFdNmFL8uVuAFTpZJm0WMFUw+4eXMUnxa7M9RGFEG0szt0z+/Zgk4G2k9JBFhaEnY64RBiFmuw==
dependencies:
"@types/history" "*"
"@types/react" "*"
Expand Down Expand Up @@ -14621,17 +14628,6 @@ history@^3.0.0:
query-string "^4.2.2"
warning "^3.0.0"

history@^4.7.2:
version "4.7.2"
resolved "https://registry.yarnpkg.com/history/-/history-4.7.2.tgz#22b5c7f31633c5b8021c7f4a8a954ac139ee8d5b"
integrity sha512-1zkBRWW6XweO0NBcjiphtVJVsIQ+SXF29z9DVkceeaSLVMFXHool+fdCZD4spDCfZJCILPILc3bm7Bc+HRi0nA==
dependencies:
invariant "^2.2.1"
loose-envify "^1.2.0"
resolve-pathname "^2.2.0"
value-equal "^0.4.0"
warning "^3.0.0"

hjson@3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/hjson/-/hjson-3.2.0.tgz#76203ea69bc1c7c88422b48402cc34df8ff8de0e"
Expand Down Expand Up @@ -14666,11 +14662,6 @@ hoek@6.x.x:
resolved "https://registry.yarnpkg.com/hoek/-/hoek-6.0.3.tgz#7884360426d927865a0a1251fc9c59313af5b798"
integrity sha512-TU6RyZ/XaQCTWRLrdqZZtZqwxUVr6PDMfi6MlWNURZ7A6czanQqX4pFE1mdOUQR9FdPCsZ0UzL8jI/izZ+eBSQ==

hoist-non-react-statics@^2.3.0:
version "2.5.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz#d2ca2dfc19c5a91c5a6615ce8e564ef0347e2a40"
integrity sha512-6Bl6XsDT1ntE0lHbIhr4Kp2PGcleGZ66qu5Jqk8lc0Xc/IeG6gVLmwUGs/K0Us+L8VWoKgj0uWdPMataOsm31w==

hoist-non-react-statics@^2.3.1, hoist-non-react-statics@^2.5.0, hoist-non-react-statics@^2.5.5:
version "2.5.5"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
Expand Down Expand Up @@ -19071,6 +19062,15 @@ min-document@^2.19.0:
dependencies:
dom-walk "^0.1.0"

mini-create-react-context@^0.3.0:
version "0.3.2"
resolved "https://registry.yarnpkg.com/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz#79fc598f283dd623da8e088b05db8cddab250189"
integrity sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw==
dependencies:
"@babel/runtime" "^7.4.0"
gud "^1.0.0"
tiny-warning "^1.0.2"

mini-css-extract-plugin@0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-0.8.0.tgz#81d41ec4fe58c713a96ad7c723cdb2d0bd4d70e1"
Expand Down Expand Up @@ -23048,35 +23048,40 @@ react-reverse-portal@^1.0.4:
resolved "https://registry.yarnpkg.com/react-reverse-portal/-/react-reverse-portal-1.0.4.tgz#d127d2c9147549b25c4959aba1802eca4b144cd4"
integrity sha512-WESex/wSjxHwdG7M0uwPNkdQXaLauXNHi4INQiRybmFIXVzAqgf/Ak2OzJ4MLf4UuCD/IzEwJOkML2SxnnontA==

react-router-dom@4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.2.2.tgz#c8a81df3adc58bba8a76782e946cbd4eae649b8d"
integrity sha512-cHMFC1ZoLDfEaMFoKTjN7fry/oczMgRt5BKfMAkTu5zEuJvUiPp1J8d0eXSVTnBh6pxlbdqDhozunOOLtmKfPA==
dependencies:
history "^4.7.2"
invariant "^2.2.2"
loose-envify "^1.3.1"
prop-types "^15.5.4"
react-router "^4.2.0"
warning "^3.0.0"

react-router-dom@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
integrity sha512-c/MlywfxDdCp7EnB7YfPMOfMD3tOtIjrQlj/CKfNMBxdmpJP8xcz5P/UAFn3JbnQCNUxsHyVVqllF9LhgVyFCA==
react-router-dom@^5.1.0:
version "5.1.2"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-5.1.2.tgz#06701b834352f44d37fbb6311f870f84c76b9c18"
integrity sha512-7BPHAaIwWpZS074UKaw1FjVdZBSVWEk8IuDXdB+OkLb8vd/WRQIpA4ag9WQk61aEfQs47wHyjWUoUGGZxpQXew==
dependencies:
history "^4.7.2"
invariant "^2.2.4"
"@babel/runtime" "^7.1.2"
history "^4.9.0"
loose-envify "^1.3.1"
prop-types "^15.6.1"
react-router "^4.3.1"
warning "^4.0.1"
prop-types "^15.6.2"
react-router "5.1.2"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-router-redux@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/react-router-redux/-/react-router-redux-4.0.8.tgz#227403596b5151e182377dab835b5d45f0f8054e"
integrity sha1-InQDWWtRUeGCN32rg1tdRfD4BU4=

react-router@5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.1.2.tgz#6ea51d789cb36a6be1ba5f7c0d48dd9e817d3418"
integrity sha512-yjEuMFy1ONK246B+rsa0cUam5OeAQ8pyclRDgpxuSCrAlJ1qN9uZ5IgyKC7gQg0w8OM50NXHEegPh/ks9YuR2A==
dependencies:
"@babel/runtime" "^7.1.2"
history "^4.9.0"
hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1"
mini-create-react-context "^0.3.0"
path-to-regexp "^1.7.0"
prop-types "^15.6.2"
react-is "^16.6.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-router@^3.2.0:
version "3.2.1"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-3.2.1.tgz#b9a3279962bdfbe684c8bd0482b81ef288f0f244"
Expand All @@ -23090,32 +23095,6 @@ react-router@^3.2.0:
prop-types "^15.5.6"
warning "^3.0.0"

react-router@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.2.0.tgz#61f7b3e3770daeb24062dae3eedef1b054155986"
integrity sha512-DY6pjwRhdARE4TDw7XjxjZsbx9lKmIcyZoZ+SDO7SBJ1KUeWNxT22Kara2AC7u6/c2SYEHlEDLnzBCcNhLE8Vg==
dependencies:
history "^4.7.2"
hoist-non-react-statics "^2.3.0"
invariant "^2.2.2"
loose-envify "^1.3.1"
path-to-regexp "^1.7.0"
prop-types "^15.5.4"
warning "^3.0.0"

react-router@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-4.3.1.tgz#aada4aef14c809cb2e686b05cee4742234506c4e"
integrity sha512-yrvL8AogDh2X42Dt9iknk4wF4V8bWREPirFfS9gLU1huk6qK41sg7Z/1S81jjTrGHxa3B8R3J6xIkDAA6CVarg==
dependencies:
history "^4.7.2"
hoist-non-react-statics "^2.5.0"
invariant "^2.2.4"
loose-envify "^1.3.1"
path-to-regexp "^1.7.0"
prop-types "^15.6.1"
warning "^4.0.1"

react-select@^2.2.0:
version "2.4.4"
resolved "https://registry.yarnpkg.com/react-select/-/react-select-2.4.4.tgz#ba72468ef1060c7d46fbb862b0748f96491f1f73"
Expand Down Expand Up @@ -27015,6 +26994,11 @@ tiny-warning@^1.0.0:
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.2.tgz#1dfae771ee1a04396bdfde27a3adcebc6b648b28"
integrity sha512-rru86D9CpQRLvsFG5XFdy0KdLAvjdQDyZCsRcuu60WtzFylDM3eAWSxEVz5kzL2Gp544XiUvPbVKtOA/txLi9Q==

tiny-warning@^1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==

tinycolor2@1.4.1, tinycolor2@^1.0.0, tinycolor2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8"
Expand Down Expand Up @@ -29264,13 +29248,6 @@ warning@^3.0.0:
dependencies:
loose-envify "^1.0.0"

warning@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.2.tgz#aa6876480872116fa3e11d434b0d0d8d91e44607"
integrity sha512-wbTp09q/9C+jJn4KKJfJfoS6VleK/Dti0yqWSm6KMvJ4MRCXFQNapHuJXutJIrWV0Cf4AhTdeIe4qdKHR1+Hug==
dependencies:
loose-envify "^1.0.0"

warning@^4.0.2:
version "4.0.3"
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
Expand Down