10.19.2015

[React Snippets] React.findDOMNode & jQuery

React.findDOMNode & jQuery

In React v0.13 use React.findDOMNode()

'Use React.findDOMNode(component) instead.'

React.findDOMNode(this.refs.main).value.trim();

var _el = React.findDOMNode(this.refs.main);
$(_el).tooltip();


refer to:
http://facebook.github.io/react/blog/2015/03/10/react-v0.13.html#new-features

10.13.2015

[JS] Use console.group for debugging

Grouping Log Messages Using console.group()

You can group related log statements by surrounding them with the console.group()and console.groupEnd() functions:
console.group("URL Details");
console.log("Scheme: HTTPS")
console.log("Host: example.com");
console.groupEnd();

refer to:
http://www.jquerybyexample.net/2015/01/javascript-logging-using-console-group.html
https://developer.chrome.com/devtools/docs/console-api
https://developer.mozilla.org/en-US/docs/Web/API/Console



10.12.2015

[Node] Implement Isomorphic (Express + React)

Implement Isomorphic With Express + React



refer to:
https://strongloop.com/strongblog/node-js-react-isomorphic-javascript-why-it-matters/
http://jmfurlott.com/tutorial-setting-up-a-simple-isomorphic-react-app/
http://reactjsnews.com/isomorphic-javascript-with-react-node/
http://react.rocks/tag/Isomorphic
http://isomorphic.net/libraries


9.30.2015

[NPM] npm check updates


If you have the list of dependencies and dev-dependencies for your application( update your package.json). To see what needs to be upgraded, we can use a super-handly Node.js module called npm-check-updates. Using this application is easy; first, install it globally (I recommend installing it globally, since you should be using this for all your projects which rely on NPM!) by running npm install -g npm-check-updates, and second, run ncu within the your application directory.











Then you need to run npm upgrade which will upgrade all the packages to the latest version found in package.json