开发者

I'm a ruby on rails developer and I don't like using jquery-ui. Am I wrong? [closed]

开发者 https://www.devze.com 2023-03-24 21:30 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

开发者_如何学Go

Closed 11 years ago.

Improve this question

I use jquery all the time and couldn't build a great website without it. But I'm learning to really dislike jquery-ui.

On applications that I've seen use jquery-ui, I feel that there's too much javascript in the client. I've also seen situations where people attach jquery code to jquery-ui widgets that results in multiple events firing when a user clicks a button.

Moreover, I feel like almost all the features you get with jquery-ui you can build with plain divs and showing/hiding/animating elements using plain jquery.

In the end, I think it results in too much going on in the browser, is difficult to automate testing for, is harder to debug and really isn't needed that often anyway.

Am I wrong?


I think there are many who would agree testability (particularly in a cross-browser manner) is a real problem.

With regards to it being too much - there are other JS libraries and frameworks that are usable in the place of jquery-ui.

If anybody has any recommended frameworks they consider "lighter" than jquery-ui that provide similar widgets, I'd love to hear about them and will note them here.

It's important to remember that jquery-ui and jquery are split for a reason. Jquery-ui gives you lots of nice little widgets which aim to satisfy a bunch of common use cases. Jquery exists to do what it does better than any other library I've seen: match and manipulate the DOM.


Yeah sure there is a lot going on, and used in the wrong hands you could probably end up with too much going on for no real reason.

For all the simple show/hiding modals etc... then if you are concerned with too much going on, then write it yourself.

The jQuery UI is just a nice "In the box" framework for doing things which come with nice styling and have a community behind it.


Full-blown jQuery UI minified is 206kB, that's a lot of JS.

However, do note that if you remove everything except the core, you are left with only 25kB. You can customize your jQuery UI package here http://jqueryui.com/download.

If you think that a customized jQueryu UI package is still too big for your needs, then a microJS framework ( http://microjs.com/ ) can be a lightweight alternative.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号