从 jQuery 切换到 Dojo 的缺点

发布于 2024-10-22 10:01:25 字数 298 浏览 6 评论 0原文

我正在考虑在一些新项目(或至少包括它)中使用Dojo,部分原因是它与 Google Closure 编译器的高级模式兼容,这将(希望)完全删除所有未使用的代码。

我会失去什么? (除了熟悉语法之外)

(此外,通常任何有关不同之处的提示可能会有所帮助)

I am considering using Dojo in some new projects (or at least including it),, Partially because of it's compatibility with Google Closure Compiler's Advanced mode which will (hopefully) entirely delete all unused code.

What would I lose? (besides familiarity with syntax)

(also, generally any tips on what is different would probably be helpful)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

吻泪 2024-10-29 10:01:25

我自己使用 jQuery,但总而言之,jQuery 似乎有更好的文档记录,并且更容易“开箱即用”地完成很酷的事情。如果您知道自己在做什么,Dojo 似乎更容易扩展。我从 社区 wiki 获取此信息:

jQuery

  • 快速
  • 有据可查
  • 易于使用
  • 链接
  • 原型不同如果您没有特别要求,则不会扩展对象(尝试在 Prototype 中循环数组)
  • 易于使用的 Ajax(我喜欢 $.ajaxSetup() 函数)
  • 不错的事件处理程序
  • CSS 选择器
  • 过滤您的
  • 选择提到链接?
  • 小(仅 30 KB)
  • 漂亮的小内置效果。
  • 插件

Dojo

“作为一名 Dojo 开发人员,我会推荐 Dojo。虽然我的选择并不奇怪,但我成为一名 Dojo 开发人员是因为我发现以下事情比其他 JavaScript 框架做得更好:”

  • OOP (和其他范式)做得正确。
  • Widget 基础设施做得很好。
  • 模块完成了所有必要的功能:
    • 动态延迟加载模块。
    • 可以仅提取必要的模块并构建自定义的单文件配置文件。
    • 如果需要,可以异步加载模块。
    • 与 CDN 简单集成以实现重型网络应用程序。
  • DojoX 中的可用模块非常广泛,包括图形、图表、网格等。
  • 能够在非浏览器环境中使用它。
  • 注意小部件中的细节:
    • 支持 i18n(包括 LTR 和 RTL 语言),
    • 支持本地化(包括标准日期、货币、数字格式),
    • 为有特殊需求的人提供的服务(自动高对比度模式、仅键盘支持等)——对于普通用户也很有用,并且对于大多数政府合同来说都是强制性的。
  • 社区中的聪明人(最后但并非最不重要的)——尽管我很喜欢为新手提供指导,但在某些时候,每个开发人员都会变得“经验丰富”,并且需要的远不止于此。

“社区中的聪明人(最后但并非最不重要的)——尽管我很喜欢为新手提供指导,但在某些时候,每个开发人员都会变得“经验丰富”,并且需要的远不止于此。
如果您只想编写简单的代码并向现有 Web 应用程序添加简单的渐进式增强功能,那么您几乎可以使用任何框架甚至纯 JavaScript 来完成此操作。但是,一旦您的 Web 应用程序变得更大或更复杂,良好的包装、对您喜欢的方法的良好支持、良好的构建块以及制作自己的构建块的能力就变得越来越重要。这就是为什么我选择了 Dojo,并且再也没有回头。”

I use jQuery myself, but to sum it up jQuery appears to be better documented and easier to do cool stuff "out of the box". Dojo appears to be easier to extend if you know what you are doing. I got this info from the community wiki here:

jQuery

  • Fast
  • Well documented
  • Easy to use
  • Chaining
  • Unlike Prototype it doesn't extend an object if you didn't specifically ask for it (try looping an array in Prototype)
  • easy-to-use Ajax (I love the $.ajaxSetup() function)
  • Nice event handlers
  • CSS selectors
  • filtering your selection
  • did I mention chaining?
  • Small (only 30 KB)
  • Nice little build-in effects.
  • Plugins

Dojo

"Being a Dojo developer I would recommend Dojo. While my choice is not surprising, I became a Dojo developer because I found following things, which are done better than in other JavaScript frameworks:"

  • OOP (and other paradigms) done right.
  • Widget infrastructure done right.
  • Modules done right with all necessary goodies:
    • Lazy loading of modules dynamically.
    • Possibility to extract only necessary modules and build a custom one-file profile.
    • Asynchronous loading of modules if desired.
    • Simple integration with CDNs for heavy-duty web applications.
  • Sheer breadth of available modules in DojoX including graphics, charting, grids, and so on.
  • Ability to use it in non-browser environments.
  • Attention to details in widgets:
    • support for i18n (including LTR and RTL languages),
    • support for l10n (including standard date, currency, number formatting),
    • provisions for people with special needs (automatic high-contrast mode, keyboard-only support, and so on) — useful for regular users too, and mandatory for most government contracts.
  • Smart people in the community (last but not least) — as much as I love hand-holding for novices at some point every developer becomes "seasoned" and needs much more than that.

"Smart people in the community (last but not least) — as much as I love hand-holding for novices at some point every developer becomes "seasoned" and needs much more than that.
If all you want is to write one-liners and add simple progressive enhancements to existing web applications, you can do it with pretty much any framework, or even with a pure JavaScript. But as soon as your web application becomes bigger or more complex good packaging, good support for your favorite methodologies, good building blocks, and the ability to make your own building blocks become more and more important. That's why I settled on Dojo, and never looked back."

左耳近心 2024-10-29 10:01:25

就其价值而言,dojo 的完整源代码版本附带了 ShrinkSafe。我不熟悉它和闭包编译器之间的任何性能比较,但我发现 dojo 的模块管理和打包工具(包括 ShrinkSafe)非常有用。

For what it's worth, the full source version of dojo comes with ShrinkSafe. I'm not familiar with any performance comparisons between that and the closure complier, but I find dojo's module management and packaging tools (including ShrinkSafe) to be very useful.

弱骨蛰伏 2024-10-29 10:01:25

好吧,如果我现在需要说一些事情,我会说 jquery 和 dojo 对我来说没有区别,因为我不使用两者。我使用纯javascript,我对此进行了更深入的研究,我不需要任何库我创建自己的框架我自己的东西更快,更纯粹,更固化,

我会说我讨厌所有库,因为它让我更不知道诸如 JavaScript 的奇妙及其美丽之类的事情。

我不建议使用任何库,如果你需要的话,请在你真正了解 javascript 之后再使用。

Well if I need to say some thing now I would say there is not a difference for me between jquery and dojo because I don't use both. I use pure javascript that i have gone deeper on it that I don't need any of the libraries I create my own framework my own things more fast, pure, cured,

And I would say I have hated all libraries cause it make me more unkowing of things like the wonder of javascript and its beauty.

I dont advise using any library and if you need so do it after you know javascript for real.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文