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

Make react-router-dom treeshakable #6465

Merged
merged 3 commits into from Nov 8, 2018
Merged
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
22 changes: 11 additions & 11 deletions packages/react-router-dom/.size-snapshot.json
@@ -1,26 +1,26 @@
{
"esm/react-router-dom.js": {
"bundled": 7978,
"minified": 4880,
"gzipped": 1618,
"bundled": 8022,
"minified": 4817,
"gzipped": 1612,
"treeshaked": {
"rollup": {
"code": 1250,
"code": 453,
"import_statements": 417
},
"webpack": {
"code": 3322
"code": 1661
mjackson marked this conversation as resolved.
Show resolved Hide resolved
}
}
},
"umd/react-router-dom.js": {
"bundled": 159709,
"minified": 57597,
"gzipped": 16540
"bundled": 126991,
"minified": 47032,
"gzipped": 14084
},
"umd/react-router-dom.min.js": {
"bundled": 97476,
"minified": 34651,
"gzipped": 10216
"bundled": 84909,
"minified": 30118,
"gzipped": 9978
}
}
4 changes: 0 additions & 4 deletions packages/react-router-dom/modules/Link.js
Expand Up @@ -12,10 +12,6 @@ function isModifiedEvent(event) {
* The public API for rendering a history-aware <a>.
*/
class Link extends React.Component {
static defaultProps = {
replace: false
};

handleClick(event, history) {
if (this.props.onClick) this.props.onClick(event);

Expand Down
9 changes: 2 additions & 7 deletions packages/react-router-dom/modules/NavLink.js
Expand Up @@ -12,8 +12,8 @@ function joinClassnames(...classnames) {
* A <Link> wrapper that knows if it's "active" or not.
*/
function NavLink({
"aria-current": ariaCurrent,
activeClassName,
"aria-current": ariaCurrent = "page",
activeClassName = "active",
activeStyle,
className: classNameProp,
exact,
Expand Down Expand Up @@ -59,11 +59,6 @@ function NavLink({
);
}

NavLink.defaultProps = {
"aria-current": "page",
activeClassName: "active"
};

if (__DEV__) {
const ariaCurrentType = PropTypes.oneOf([
"page",
Expand Down
138 changes: 130 additions & 8 deletions packages/react-router-dom/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.