te')); return $arr; } /* 遍历用户所有主题 * @param $uid 用户ID * @param int $page 页数 * @param int $pagesize 每页记录条数 * @param bool $desc 排序方式 TRUE降序 FALSE升序 * @param string $key 返回的数组用那一列的值作为 key * @param array $col 查询哪些列 */ function thread_tid_find_by_uid($uid, $page = 1, $pagesize = 1000, $desc = TRUE, $key = 'tid', $col = array()) { if (empty($uid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('uid' => $uid), array('tid' => $orderby), $page, $pagesize, $key, $col); return $arr; } // 遍历栏目下tid 支持数组 $fid = array(1,2,3) function thread_tid_find_by_fid($fid, $page = 1, $pagesize = 1000, $desc = TRUE) { if (empty($fid)) return array(); $orderby = TRUE == $desc ? -1 : 1; $arr = thread_tid__find($cond = array('fid' => $fid), array('tid' => $orderby), $page, $pagesize, 'tid', array('tid', 'verify_date')); return $arr; } function thread_tid_delete($tid) { if (empty($tid)) return FALSE; $r = thread_tid__delete(array('tid' => $tid)); return $r; } function thread_tid_count() { $n = thread_tid__count(); return $n; } // 统计用户主题数 大数量下严谨使用非主键统计 function thread_uid_count($uid) { $n = thread_tid__count(array('uid' => $uid)); return $n; } // 统计栏目主题数 大数量下严谨使用非主键统计 function thread_fid_count($fid) { $n = thread_tid__count(array('fid' => $fid)); return $n; } ?>javascript - Yeoman: LiveReload vs. Yeoman Watch - Stack Overflow
最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Yeoman: LiveReload vs. Yeoman Watch - Stack Overflow

programmeradmin4浏览0评论

I'm trying out Yeoman Server for the first time and see that it offers a native watch tool as a fallback to LiveReload. Here's how the docs explain the fallback:

"[Yeoman Server] automatically fires up the yeoman watch process, so changes to any of the application's files cause the browser to refresh via LiveReload. Should you not have LiveReload installed locally, a fallback reload process will be used instead."

So far the fallback process is working perfectly, and I like that it doesn't require installing anything in the browser/menu bar.

Has anyone tried both watch tools with Yeoman? How is the workflow different and what additional features do you get if you "upgrade" to LiveReload?

UPDATE: A quick inspection of the API revealed that Yeoman's live reload feature is in fact LiveReload. They're one and the same. The reason it works without the browser extensions is because they're using LiveReload's snipvr snippet instead. It's possible there are some additional features accessible via the LiveReload GUI and perhaps for mobile device testing, but more likely the functionality is identical.

I'm trying out Yeoman Server for the first time and see that it offers a native watch tool as a fallback to LiveReload. Here's how the docs explain the fallback:

"[Yeoman Server] automatically fires up the yeoman watch process, so changes to any of the application's files cause the browser to refresh via LiveReload. Should you not have LiveReload installed locally, a fallback reload process will be used instead."

So far the fallback process is working perfectly, and I like that it doesn't require installing anything in the browser/menu bar.

Has anyone tried both watch tools with Yeoman? How is the workflow different and what additional features do you get if you "upgrade" to LiveReload?

UPDATE: A quick inspection of the API revealed that Yeoman's live reload feature is in fact LiveReload. They're one and the same. The reason it works without the browser extensions is because they're using LiveReload's snipvr snippet instead. It's possible there are some additional features accessible via the LiveReload GUI and perhaps for mobile device testing, but more likely the functionality is identical.

Share Improve this question edited Oct 7, 2014 at 9:13 emurb 1472 silver badges13 bronze badges asked Sep 11, 2012 at 1:12 canteracantera 25k25 gold badges102 silver badges140 bronze badges 2
  • Mods: Might be good to add tags for "Yeoman" and "LiveReload." I don't have the rep needed to add tags. Happy to submit a request somewhere if there's a place designated for this. – cantera Commented Sep 11, 2012 at 1:14
  • Please add your update as an answer and accept that as the correct one. Thanks. – Sindre Sorhus Commented Nov 8, 2012 at 15:03
Add a ment  | 

2 Answers 2

Reset to default 12

As noted in my update, I checked the Yeoman source and realized that the live reload feature is in fact LiveReload. They're one and the same. It's pretty cool of LR's creator, Andrey Tarantsov, to let his valuable tool be used in a popular, open-source project like this without charging for its use.

The reason Yeoman Watch works without the browser extensions is because it's using LiveReload's snipvr snippet instead.

As a result, the functionality of LiveReload and running 'yeoman watch' is essentially identical. However, I find that there's still benefit to owning LiveReload. My preferred workflow is to bine LiveReload and CodeKit.

During (pre-build) development, I use CodeKit to pile my Sass/Compass files and Jade templates (another fantastic tool, btw) since CodeKit's config options are a little more extensive than LiveReload's. Since CodeKit doesn't work with Firefox (only Chrome and Safari), I run LiveReload concurrently so that I can see changes live in both browsers.

This workflow also has the added benefit of being able to "fork on the fly" by mixing LiveReload's "custom mand" feature with CodeKit's "advanced piler settings" feature.

EDIT: What I said below isn't exactly correct after all. I did some more testing and found that editing a .scss file would have the changes show up even without editing the HTML file first, so yeah, at this point I haven't got a scooby as to what the difference between LiveReload and the fallback process is.


I say this with the caveat that I don't have LiveReload installed, but from the testing I've done in Yeoman thus far, what I've seen with the "fallback reload process" is that it doesn't reload the page until the HTML file is saved, so saved CSS changes aren't immediately visible until the HTML file receives a Save event from the system. According to livereload., "...when you change a CSS file or an image, the browser is updated instantly without reloading the page" so it appears to be a more robust process.

(Sorry, not a plete answer since I don't have LiveReload available, but this question's been up for a couple of days with no response yet, so I figured any information was better than none.)

发布评论

评论列表(0)

  1. 暂无评论