原型的缩小版本
是否有一个 Prototype 框架版本可以打包或已经使用 Dean Edward 的打包程序以最高压缩级别打包并经过测试可以正常工作?
Packer:http://dean.edwards.name/packer/
这是一个 Google 问题但我不相信谷歌的关键任务。我想从专业人士那里得到信息。
Is there a version of the Prototype framework that is either packable or already packed at the highest compression level with Dean Edward's packer and is tested to work?
Packer: http://dean.edwards.name/packer/
This is a Google-able question but I don't trust Google over mission-critical stuff. I want the information from the pros.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
读过 Thomas Fuchs(以脚本学闻名)最近出版的《Javascript Rocks》一书后,我可以告诉你,他根本不喜欢混淆 Javascript。他主张将 gzipped javascript 视为“解决 JavaScript 文件大小的最佳解决方案,没有之一”。这可以通过使用
AddOutputFilterByType
在您自己的服务器上启用 GZIP 或使用 在 Google 代码上托管 ajax 库。使用 GZIP 的主要原因是:
变量/函数名称更容易调试
脚本混淆
我知道这实际上并不能回答你的问题,只是认为这可能是一个值得考虑的有趣点。
Having read Thomas Fuchs' (of scriptaculous fame) recent "Javascript Rocks" book I can tell you that he is not a fan of obfuscating Javascript at all. He is an advocate of serving gzipped javascript as its "the best solution for JavaScript file size, bar none". This is possible by either enabling GZIP on your own server using
AddOutputFilterByType
or by using the hosted ajax libs on google code.Main reasons to use GZIP are:
variable / function names so much easier to debug
script obfuscation
I know this doesnt actually answer your question, just thought it might be an interesting point to consider.
经过一番挣扎后,这是我的解决方案:
1 使用 JSLint 捕获所有错误,例如缺少分号和其他难看的东西。
2 没有步骤 2。一旦我完成了这一点,结果就保证可以与 Dean Edward 的打包机一起使用。
对打包的 .js 进行 Gzip 压缩可以进一步减小大小,从而带来惊人的下载速度!!!!!! (或其他东西)。再见
OK after some struggling here's my solution:
1 Use JSLint to catch all the errors like missing semicolons and other unsightly stuff.
2 There is no step 2. Once I have done that, the result is guaranteed to work with Dean Edward's packer.
Gzipping the packed .js reduces the size even further, yielding LUDICROUS DOWNLOAD SPEED!!!!! (or something). Bye
我使用 YUI-Compressor 压缩原型框架取得了出色的结果,即使在附加时也是如此在压缩之前添加附加文件。为了便于开发,我所有的 JavaScript 和 CSS 都是分开的,然后重新组合成更大的模块并进行压缩,以减少 HTTP 请求的数量。
I have had excellent results using the YUI-Compressor to compress the prototype framework, even when appending additional files to it before it is compressed. All of my JavaScript and CSS is kept separate for ease of development and then recombined into larger modules and compressed to reduce the number of HTTP requests.