ff-stream-web

git clone git://archive.git.mtrnord.blog/MTRNord/ff-stream-web.git
Log | Files | Refs | README | LICENSE

commit 989918622ee2811847cdc8d78fdf11fa4e4b7381
parent 18f5b973b9f7510110d3acdf0d3d621e54b66631
Author: Konstantin Tarkus <hello@tarkus.me>
Date:   Thu, 15 Oct 2015 16:51:36 +0300

Update npm packages; fix Location and Link components

Diffstat:
Mpackage.json | 24++++++++++++------------
Msrc/components/Link/Link.js | 9++++-----
Msrc/core/Location.js | 3++-
3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/package.json b/package.json @@ -10,14 +10,14 @@ "eventemitter3": "1.1.1", "express": "4.13.3", "fastclick": "1.0.6", - "fbjs": "0.3.1", + "fbjs": "0.3.2", "flux": "2.1.1", "front-matter": "1.0.0", - "history": "1.11.1", + "history": "1.12.5", "jade": "1.11.0", "normalize.css": "3.0.3", - "react": "0.14.0-rc1", - "react-dom": "0.14.0-rc1", + "react": "0.14.0", + "react-dom": "0.14.0", "react-routing": "0.0.4", "source-map-support": "0.3.2", "superagent": "1.4.0" @@ -28,24 +28,24 @@ "babel-eslint": "^4.1.3", "babel-loader": "^5.3.2", "babel-plugin-react-transform": "^1.1.1", - "browser-sync": "^2.9.7", + "browser-sync": "^2.9.11", "css-loader": "^0.19.0", "csscomb": "^3.1.8", "del": "^2.0.2", "eslint": "^1.6.0", "eslint-config-airbnb": "0.1.0", - "eslint-loader": "^1.0.0", - "eslint-plugin-react": "^3.5.0", + "eslint-loader": "^1.1.0", + "eslint-plugin-react": "^3.5.1", "file-loader": "^0.8.4", - "gaze": "^0.5.1", + "gaze": "^0.5.2", "git-repository": "^0.1.1", "glob": "^5.0.15", - "jest-cli": "^0.5.8", - "jscs": "^2.2.1", + "jest-cli": "^0.5.10", + "jscs": "^2.3.1", "lodash.merge": "^3.3.2", "mkdirp": "^0.5.1", "ncp": "^2.0.0", - "postcss": "^5.0.8", + "postcss": "^5.0.10", "postcss-cssnext": "^2.1.0", "postcss-import": "^7.0.0", "postcss-loader": "^0.6.0", @@ -59,7 +59,7 @@ "url-loader": "^0.5.6", "webpack": "^1.12.2", "webpack-dev-middleware": "^1.2.0", - "webpack-hot-middleware": "^2.3.0" + "webpack-hot-middleware": "^2.4.1" }, "jest": { "rootDir": "./src", diff --git a/src/components/Link/Link.js b/src/components/Link/Link.js @@ -15,12 +15,11 @@ class Link extends Component { static propTypes = { to: PropTypes.string.isRequired, - children: PropTypes.element.isRequired, state: PropTypes.object, onClick: PropTypes.func, }; - static handleClick(event) { + static handleClick = (event) => { let allowTransition = true; let clickResult; @@ -44,11 +43,11 @@ class Link extends Component { this.props && this.props.state || null, this.props && this.props.to || (link.pathname + link.search)); } - } + }; render() { - const { to, children, ...props } = this.props; - return <a onClick={Link.handleClick.bind(this)} {...props}>{children}</a>; + const { to, query, ...props } = this.props; + return <a href={Location.createHref(to, query)} onClick={Link.handleClick.bind(this)} {...props} />; } } diff --git a/src/core/Location.js b/src/core/Location.js @@ -2,8 +2,9 @@ import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment'; import createHistory from 'history/lib/createBrowserHistory'; +import createMemoryHistory from 'history/lib/createMemoryHistory'; import useQueries from 'history/lib/useQueries'; -const location = canUseDOM ? useQueries(createHistory)() : {}; +const location = useQueries(canUseDOM ? createHistory : createMemoryHistory)(); export default location;