Live data from Hacker News

JQuery 1.8b1: what’s new?

blog.jquery.com

21–30 of 48 posts

Re: JQuery 1.8b1: what’s new?

#21

Earlier quoted context omitted.

I suppose you write all your code in assembly too? There's no room for going higher-level than the APIs exposed by the browser?

The DOM API is clear enough that silly abstractions like "selector engines" are unnecessary. The C vs. Assembly argument is such a silly non-point; apples and artichokes.

Hilarious that you think that one of the core features of the most successful JS library in history is a "silly abstraction".

And JQuery is much more than just a selector engine.

Re: JQuery 1.8b1: what’s new?

#22
Global ajax events: ( are being removed )

    Events such as ajaxStart fired by $.ajax 
    can currently be attached to any element–even
    to elements that are not in a document at all!
    This creates an inefficient special case, 
    so we will eventually remove that ability 
    and fire ajax events only on document.
I need to look into this. If you are using jQuery outside of a standard browser environment this might be problematic.

Re: JQuery 1.8b1: what’s new?

#23

Earlier quoted context omitted.

The DOM API is clear enough that silly abstractions like "selector engines" are unnecessary. The C vs. Assembly argument is such a silly non-point; apples and artichokes.

Selector engines are clearly not silly abstractions otherwise all major browsers would not have implemented querySelectorAll.

But since they did, why use jQuery on mobile when 100% of mobile browsers support querySelectorAll?

Re: JQuery 1.8b1: what’s new?

#24

Earlier quoted context omitted.

I can't imagine why you'd need jQuery on mobile in the first place? What exactly are these core features that the standard DOM apis don't give you?

I suppose you write all your code in assembly too? There's no room for going higher-level than the APIs exposed by the browser?

I'm just curious what the higher-level APIs are that people need from jQuery that aren't available on mobile. I recall jQuery being popular for selector queries (available on all mobile browsers natively with querySelector and querySelectorAll) and for even listeners (offers no real advantage over addEventListener as far as I can tell).

Re: JQuery 1.8b1: what’s new?

#25

What the jQuery team either perceives or peddles as "modules" are simply split files; there's no encapsulation. All that's new is a shiny node.js builder. I am interested, though, that the team has finally noticed that optional code should be the norm. Resig himself has been quoted as wanting nothing to do with it[0]. However, omitting every single "module" only truncates 2484 lines, which leaves the 1.8.1b source at…

There has been recent work to make jquery compatible with Google closure's advanced compilation[1]. As mentioned in John Resig's reddit comment you referenced, this would allow the compiler to automatically remove unused components in jquery and perform whole program optimizations. Unfortunately, this approach requires large rewrites to jquery to conform to the strict conventions required by the closure compiler.

[1] https://groups.google.com/forum/#!topic/jquery-bugs-team/2zb...

Re: JQuery 1.8b1: what’s new?

#26
post #22

Global ajax events: ( are being removed ) Events such as ajaxStart fired by $.ajax can currently be attached to any element–even to elements that are not in a document at all! This creates an inefficient special case, so we will eventually remove that ability and fire ajax events only on document. I need to look into this. If you are using jQuery outside of a standard browser environment this might be problematic.

Wouldn't you be using the callback or Promise for those cases?

Re: JQuery 1.8b1: what’s new?

#27

"jQuery is now powering about one-half of all the major web sites on the Internet" Anybody have any data on this?

Few of them are major, but the worlds most popular CMS, Joomla, runs 2-3% of all websites, and they will be switching to jQuery (from mootools) later this year.

Re: JQuery 1.8b1: what’s new?

#28

What the jQuery team either perceives or peddles as "modules" are simply split files; there's no encapsulation. All that's new is a shiny node.js builder. I am interested, though, that the team has finally noticed that optional code should be the norm. Resig himself has been quoted as wanting nothing to do with it[0]. However, omitting every single "module" only truncates 2484 lines, which leaves the 1.8.1b source at…

If we remove the blank lines and comments, would the line count be less staggering? By that measure we definitely shouldn't include Closure Compiler annotation comments since they add lines. For better or worse, we've focused on min-gzip size as a measure.

JavaScript doesn't have a formal notion of a module. What we're referring to here is the ability to exclude some chunk of functionality from jQuery and know that, internally, jQuery does not require it. We cannot know whether other code on the page requires it.

> optional code should be the norm

Is there an easy way to know what is "optional" code when including third-party plugins, short of analyzing all the code in advance? That's what Closure Compiler AO does, but it is not for the weak.

> There is still a great deal of work to be done before "modular" is a fair term to apply to the API.

If you've got some ideas we're open to suggestions.

Re: JQuery 1.8b1: what’s new?

#29
VENDOR-PREFIXED CSS PROPERTIES

So there are CSS properties with vendor specific implementation, how are they going to handle that? Also what if the browser (like Chrome) changes its spec.? This could break your current code.

Re: JQuery 1.8b1: what’s new?

#30
post #29

VENDOR-PREFIXED CSS PROPERTIES So there are CSS properties with vendor specific implementation, how are they going to handle that? Also what if the browser (like Chrome) changes its spec.? This could break your current code.

Vendor specific cssHooks are always executed when defined, allowing you to deal with specifics of implementation in your own code.

How exactly do you handle the "change in spec" case in your code right now?

Post reply on HN