

JQuery Core 1.9 Upgrade Guide - robin_reala
http://jquery.com/upgrade-guide/1.9/

======
jasonkostempski
"Prior to 1.9, an ajax call that expected a return data type of JSON or JSONP
would consider a return value of an empty string to be a success case, but
return a null to the success handler or promise. As of 1.9, an empty string
returned for JSON data is considered to be malformed JSON (because it is);
this will now throw an error."

That one is gonna cause some headaches, I've abused this behavior for years,
as recently as yesterday.

~~~
dmethvin
So your server returns an HTTP 200 with an empty response, and you process the
`null` in your success handler? Do you really want a `null` returned? Is this
a server you control, or is it some third-party service? Just curious about
the use case and how widespread it might be.

~~~
jasonkostempski
I was probably in control of all of them at some level but I either didn't
think about it or didn't care enough. Sometimes I suck. Today I can start
sucking a little less.

------
thiderman
Since so very very many things changed in backwards incompatible ways, why
didn't they just go with calling it 2.0 rather than 1.9? I mean, the changes
are huge and most versioning schemes increase the major version number on
backwards incompatibility.

~~~
dmethvin
> so very very many things changed in backwards incompatible ways

jQuery has always made feature changes/additions on .x releases. We're saving
the 2.0 moniker for removing oldIE because that is a much more significant
change than these API cleanups.

At this point the jQuery installed base is so big that any change, however
innocuous, is a breaking change for someone. Even fixing bugs, conforming to
W3C standards, or making API return values consistent can cause trouble
because someone depends on the old way of doing things. We try to be
respectful of people's existing work but also want to make forward progress.

Like the intro at the top of the upgrade guide page says, this list seems a
lot more scary than it really is. We're just trying to call out every change
that we think may cause issues, so people can assess and address them in
advance.

The jQuery Migrate plugin is designed to make it easier to find any
compatibility problems, and can be included with jQuery versions as old as
1.6. Add the plugin to your current code, run it, and view the console to see
if there are warnings.

------
lacosaes0
If you're not targeting old browsers there's no reason to use JQuery. Plain
JavaScript offers you the same features.

~~~
benesch
I'm certainly not a jQuery fanboy, but jQuery's DOM-manipulation functions are
certainly more _concise_ and abstract away some of the funky internals
(NodeLists, etc.).

That said, I've always found jQuery's function naming to be particularly
ambiguous. There's no indication that "find" searches an element's descendants
for a matching CSS selector based on its name. On the other hand, vanilla JS's
element.getElementsByTagName is so much more verbose. Back in the day I found
PrototypeJS [0] to be much better organized and offer the same feature set,
but it's largely fallen out of use since Rails dropped it. mootools is nice
but the docs, while comprehensive, are arranged in no logical order. Every
time I try to pick up mootools I end up running around the docs in circles.

tl;dr jQuery is overblown but I think there's room for improvement over
vanilla JS.

Plus there's always the (literally) hundreds of plugins for every possible
application of jQuery.

[0] <http://prototypejs.org>

~~~
emn13
I actually like long verbose names. Unfortunately, plain JS names are often
long, verbose _and_ unclear, so that's not a win. (e.g.
document.querySelectorAll - that should have made some reference to css; and
"all" should be implicit as it is the norm in CSS).

I'd love to see a JS library that doesn't try to add a lot of functionality,
but only decruftify the browser API.

The right aim would be to end up with a complete API that might actually
replace the normal JS api (DOM+otherwise) in actual browsers.

~~~
eze
What do you think of Zepto?

