News for hackers. Stuff that matters.
Re:JQuery 1.7 Released by bad_user on Thursday November 03, 2011 @07:29PM (#3194177)
One thing I don't like about jQuery's evolution is the size. This version weights at 92K minified / 33K gzipped, which for mobile phones is a PITA.
Re:JQuery 1.7 Released by dmethvin on Thursday November 03, 2011 @07:48PM (#3194245)
Agreed, and we plan to do something about it. There will be a jQuery blog post coming soon.
Re:JQuery 1.7 Released by alastair on Friday November 04, 2011 @06:39AM (#3195558)
Why isn't there a tool that analyzes which functions / features of jQuery your project is using and generates a smaller library with only the stuff you need?

I'm not really a developer so ignore if that's not possible / makes no sense.

Re:JQuery 1.7 Released by lucianof on Friday November 04, 2011 @07:05AM (#3195602)
That plus server-side browser sniffing to serve only what the user's browser needs could result in an extremely reduced file size. But of course the PITA would then be to maintain that.
Re:JQuery 1.7 Released by JoachimSchipper on Friday November 04, 2011 @08:38AM (#3195790)
Google's Closure compiler can apparently do that.
Re:JQuery 1.7 Released by JonnieCache on Friday November 04, 2011 @10:29AM (#3196165)
Doesn't work on jquery. To use that functionality of the closure compiler without breaking your code, the source has to be annotated in a special way, or it has to be incredibly simple.
Re:JQuery 1.7 Released by JoachimSchipper on Friday November 04, 2011 @10:40AM (#3196194)
I don't know much about this, but do you mean http://code.google.com/p/closure-compiler/source/browse/trun... ? That suggests that it will be available at some point, at least...
Re:JQuery 1.7 Released by kellishaver on Thursday November 03, 2011 @08:40PM (#3194389)
I've been leaning more and more toward Zepto for mobile. It's still lacking a fair bit of jQuery's functionality, but the basics are there and the syntax is compatible. You lose a lot of IE/older browser support, but if you do some device sniffing and serve jQuery to desktops and Zepto to mobile devices, that's not really an issue.
Re:JQuery 1.7 Released by nicolsc on Friday November 04, 2011 @10:12AM (#3196107)
Zepto is great if you're targeting iOS devices, or any webkit-based browser. But you'll need something else to handle Opera, which is 'quite' popular among mobile devices.
Re:JQuery 1.7 Released by Werba on Friday November 04, 2011 @11:49AM (#3196475)
I had split jquery 1.6 to two parts just put some code to string an then used exec, hack but work.

Why eq: 1.css 14kb -250ms engine.js 12kb 250ms

jquery 33kb 320ms ???

so

jquery1.js 13kb - 243ms jquery2.js 14kb - 250ms

So my page open 100ms faster :P

Re:JQuery 1.7 Released by bad_user on Friday November 04, 2011 @12:12PM (#3196581)
Dude, I don't understand you. You did what?

I don't think you gain anything by splitting it in 2 files. It could happen if the browser downloads the 2 files in parallel, but it can make your page load actually worse because you do not have a guarantee of parallelism (there's a limit to how many resources you can download in parallel from the same domain and adding multiple domains is not without cost because of the extra DNS lookup, which is also a big problem on mobile phones) and you're also introducing eval().

If anything, a better hack would be to load it such that it does not block the page being loaded.

See a sample how it's done in this project: https://github.com/alexandru/crossdomain-requests-js/wiki/Us...

Re:JQuery 1.7 Released by Werba on Sunday November 06, 2011 @03:24PM (#3203697)
Firefox is 6 parlsee but my website is 3 files so

http://stackoverflow.com/questions/7133749/can-i-split-jquer...

Re:JQuery 1.7 Released by jonknee on Friday November 04, 2011 @08:24AM (#3195760)
That's somewhat mitigated with the CDN version (most users won't have to download it).
Re:JQuery 1.7 Released by JonnieCache on Friday November 04, 2011 @10:28AM (#3196162)
That doesn't apply in mobile though, you basically have to think as if the cache is always empty, because it usually is. Especially on iOS.