一下是关于每个工具上榜的理由,一些众所周知的理由这里就不重复了。
半强制的让你写出所谓优雅的代码哈哈,没什么好说的,硅谷各大小公司前端通用规范
没什么好说的,基本没有竞争者。这里有一点要强调下:请好好利用npm script
关于组件化管理:比如一个button组件,文件结构如下:
-- src
-- components
-- Button
-- index.js
-- index.css
index.js和index.css只包含关于这个button的东西.
index.js
import ‘./index.css‘;
...
...
render() {
return (
<button className=‘app-button‘>Click me</button>
);
}
index.css
.app-button {
color: black;
}
没什么好说的,基本已成为行业标准
注意:Sail.js自带的ORM是waterline,自带的任务运行和打包工具是grunt。如果有需求的话自己花一两天研究下可以改成bookshelf和webpack.
后台与数据库交互的必备神器
如果你不想被callback搞得生活不能自理:
function isUserTooYoung(id, callback) {
openDatabase(function(db) {
getCollection(db, ‘users‘, function(col) {
find(col, {‘id‘: id},function(result) {
result.filter(function(user) {
callback(user.age < cutoffAge)
})
})
})
})
}
请用promise:
function isUserTooYoung(id) {
return openDatabase(db)
.then(getCollection)
.then(find.bind(null, {‘id‘: id}))
.then(function(user) {
return user.age < cutoffAge;
});
}
没什么好说的,这些软件都是用前端的技术和Electron写出来的:
(此处我在英文版里写的是utilities, 不知道中文到底应该翻成什么。。)
必备Lodash,除此之外貌似没有这么刚需的
最后想讲的是,需求驱使技术,技术提升需求。可以为了练习用这个东西来用这个东西,但是绝对不要为了用这个东西而用这个东西。永远把你的需求摆在第一位。对于连需求都没有的朋友们,希望先找到你们的需求。
原文:http://www.cnblogs.com/doit8791/p/5270921.html