Skip to content

Commit

Permalink
Switch to mini-create-router-context (#6692)
Browse files Browse the repository at this point in the history
  • Loading branch information
StringEpsilon authored and timdorr committed Apr 7, 2019
1 parent 2ce1d32 commit 992af48
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 104 deletions.
12 changes: 6 additions & 6 deletions packages/react-router-dom/.size-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
}
},
"umd/react-router-dom.js": {
"bundled": 162277,
"minified": 57870,
"gzipped": 16689
"bundled": 158978,
"minified": 56593,
"gzipped": 16361
},
"umd/react-router-dom.min.js": {
"bundled": 98089,
"minified": 34473,
"gzipped": 10230
"bundled": 95833,
"minified": 33613,
"gzipped": 9925
}
}
24 changes: 12 additions & 12 deletions packages/react-router/.size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"esm/react-router.js": {
"bundled": 23391,
"minified": 13245,
"gzipped": 3676,
"bundled": 23396,
"minified": 13250,
"gzipped": 3680,
"treeshaked": {
"rollup": {
"code": 2209,
"import_statements": 465
"code": 2214,
"import_statements": 470
},
"webpack": {
"code": 3572
"code": 3577
}
}
},
"umd/react-router.js": {
"bundled": 102432,
"minified": 36295,
"gzipped": 11538
"bundled": 98991,
"minified": 35022,
"gzipped": 11227
},
"umd/react-router.min.js": {
"bundled": 63974,
"minified": 22277,
"gzipped": 7899
"bundled": 61594,
"minified": 21423,
"gzipped": 7606
}
}
6 changes: 3 additions & 3 deletions packages/react-router/modules/RouterContext.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// TODO: Replace with React.createContext once we can assume React 16+
import createContext from "create-react-context";
import createContext from "mini-create-react-context";

const createNamedContext = name => {
const context = createContext();
context.displayName = name;

return context;
}
};

const context = /*#__PURE__*/ createNamedContext('Router');
const context = /*#__PURE__*/ createNamedContext("Router");
export default context;
107 changes: 25 additions & 82 deletions packages/react-router/package-lock.json

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

2 changes: 1 addition & 1 deletion packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
},
"dependencies": {
"@babel/runtime": "^7.1.2",
"create-react-context": "0.2.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",
Expand Down

0 comments on commit 992af48

Please sign in to comment.