TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Fez, a file-based build tool for JavaScript

70 点作者 isaacb超过 11 年前

13 条评论

jdlshore超过 11 年前
If you&#x27;re interested in file-based tools, Jake [1] has excellent support for the sort of rules Fez of offers, and is quite mature.<p>I haven&#x27;t dug deeply into Fez yet, but here&#x27;s a few things Fez seems to offer that Jake doesn&#x27;t:<p>1- Automatic concurrency. Like Gulp, Fez&#x27;s subtasks run in parallel. It looks like Fez launches them in subprocesses in order to prevent conflicts, which is a good idea. I&#x27;m skeptical of parallelism in builds, though, because race conditions lead to nasty, hard-to-detect-and-fix bugs. I don&#x27;t think the theoretical speed boost is worth the potential of defects getting into released code.<p>2- Automatic pipelining. Also like Gulp, Fez can pipe the output of one operation to the input of another. This is useful because you can avoid dealing with temporary files. Unlike Gulp, Fez has an extremely simple and non-error-prone way of constructing those pipelines. I like it.<p>The major advantage of Fez (and Jake) over Grunt and Gulp is that they use file timestamps to tell if a task needs to run. This can lead to major speed benefits. I recently modified my Jakefile to use this sort of dirty checking on my Sass compiler. I don&#x27;t change my CSS that often, but the css task was doing an expensive &quot;shell to Ruby&quot; command on every build no matter what. Adding dirty checking shaved my typical build time down from 6.5s to 3.5s.<p>Overall, Fez looks like a really nice tool. It has a strong ideology (rule-based transformation of files) tempered by a nice dose of practicality. For example, although Fez wants every task to define a file-transformation rule, it also supports &quot;imperative mode&quot; for tasks that don&#x27;t fit that model. It&#x27;s very promising, and I&#x27;m looking forward to learning more.<p>[1] Jake: <a href="https://github.com/mde/jake" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;mde&#x2F;jake</a>
robert-wallis超过 11 年前
I&#x27;m suppose I&#x27;m in the minority of developers that _don&#x27;t_ think we need to learn more build tools.<p>make, configure, automake, autoconf, MSBuild, Apache Ant, rake, gradle, jake, grunt, gulp, fez<p>Sorry, I&#x27;m sure your system is nice and organized. But now you&#x27;ve introduced one more build dependency that will make projects based on Fez just a little more difficult to on-board.
评论 #7092120 未加载
scribu超过 11 年前
I wonder what the pros&#x2F;cons are for Fez, compared to Gulp: <a href="https://github.com/gulpjs/gulp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;gulpjs&#x2F;gulp</a>
评论 #7091589 未加载
c4n4rd超过 11 年前
I am in the process of creating a build tool too (for a different language: Java) I noticed that you have some magic variables (%f), like make ($&lt;, etc..). I am trying to avoid that, but I cannot come up with a clean way without &#x27;magic&#x27; variables (e.g. When using wildcards, one would need to know the set of files that have changed. Mine is something similar to<p><pre><code> classes&#x2F;**&#x2F;*.class -&gt; src&#x2F;**&#x2F;*.java: javac [WHAT TO USE IF NOT A &#x27;Maigc var&#x27;?] </code></pre> Also:<p>1. Will fez support different dir for target and recipes? (like above example I gave) ?<p>2. What about targets that do not have a file dependency (e.g. .PHONY in make)? How does fez deal with it?<p>What I am trying to avoid is a big learning curve (or have a user need to read a book) :-)<p>Thank you and success in your project!
ilaksh超过 11 年前
I don&#x27;t understand how to use it. Can I just write this:<p><pre><code> *.less → %f.css *.css → %f.min.css *.min.css → dist.min.css </code></pre> in a file and then run the command &quot;fez&quot;? And if not, then why not? If that was how you used fez then I would strongly consider using it.<p>If you are looking for a build tool, I strongly recommend you first consider a bash script.<p>Or if you are still looking for a build tool, like you collect them or something, I made my own too (lol): <a href="https://github.com/ithkuil/bild" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ithkuil&#x2F;bild</a><p>Mine uses yaml files like this:<p><pre><code> - coffee: files: src&#x2F;*.coffee out: lib - uglify: files: public&#x2F;js&#x2F;*.js out: public&#x2F;js&#x2F;min.js</code></pre>
评论 #7092849 未加载
possibilistic超过 11 年前
This could turn out to be incredibly powerful tooling for Javascript compilation.<p>I&#x27;m not a fan of Require-type systems because they introduce additional runtime behavior. With the proper dependency graph tools available at compile time, we could remove the need for AMD completely. This will reduce client overhead and boilerplate. (Granted, AMD boilerplate will be converted into a dependency graph spec. But it would be there regardless, and I am of the opinion that this is a superior form.)<p>Exciting times ahead...
oakaz超过 11 年前
Similar to Bud: <a href="http://github.com/azer/bud" rel="nofollow">http:&#x2F;&#x2F;github.com&#x2F;azer&#x2F;bud</a> (<a href="https://medium.com/p/6a4c74b4bd90" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;p&#x2F;6a4c74b4bd90</a>)<p>See how Bud approaches building and watching changes; <a href="https://gist.github.com/azer/7819664" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;azer&#x2F;7819664</a>
CGamesPlay超过 11 年前
Cool! I have two questions: does this support watching files to regenerate them?<p>Second, one of the main features from my similar project (npm install webapp-builder) is appending a socket.io connection to generated HTML to force a browser refresh when files have finished building. I view webapp-builder as too monolithic, so I&#x27;m curious how difficult it would be to implement a similar feature in Fez?
评论 #7090801 未加载
delinka超过 11 年前
Can someone compare and contrast this with Make?
jkrems超过 11 年前
Pretty cool! Does it track dependencies of build steps that have &quot;require&quot;? E.g. if I have a javascript bundle being built using browserify - will it track the files that browserify is loading? Also: Did you consider reusing the Grunt ecosystem? E.g. enable loading grunt plugins and treat this as a potential alternate runner?
mmwtsn超过 11 年前
Looks interesting. A note to the author: that post is very difficult to read on mobile. Setting a width on your container will go a long way to improve readability (e.g. .wrapper { max-width: 90%; margin: 0 auto; }).
评论 #7090768 未加载
mikewhy超过 11 年前
How does this compare to something like Brunch? <a href="http://brunch.io/" rel="nofollow">http:&#x2F;&#x2F;brunch.io&#x2F;</a>
评论 #7090988 未加载
pencilcode超过 11 年前
BTW, fezes is faeces in portuguese ;)
评论 #7090584 未加载