문제

I like the idea of cutting out 80% of jQuery by using Zepto.js. However, when making the switch, it is clear some of the jQuery plugins I'm using, for example jQueryUI draggable(), can't find in Zepto what they need.

Is there a sane way to go about switching to Zepto? Or Am I just going to have to extend it function by function until I stop getting errors?

도움이 되었습니까?

해결책

Hear me out. In a perfect world we always have frameworks that are exactly what we need. But we don't live in such a world. Different projects - different requirements. JQuery is designed to cover ALL of the usual requirements, therefore saving time. It may sound tempting to try to optimize it for the project needs, but in the wrong run, will it be worth building frameworks for every small project? In the end it's only 15 kbs of difference, a fraction of a second. As javascript is not compiled you don't save from compilation-time or anything. Just that little tiny bit of bandwidth. I'm not aware of the importance of your project, but I personally wouldn't sacrifice my time to build a custom jQuery distribution for every new project I'm creating.

If the stripped down Zepto doesn't work out, I'd stick with jQuery. But if you are determined to do this, I think it would be easier to start striping jQuery down, instead of upgrading Zepto. That way you can instantly tell when your modules break and see the reason.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top