Follows some ideas for future jQuery development. Those come from my
experience while using the library.

== "microformats" ==

I really like how jQuery works with the whole DOM tree, it is much
more flexible than other libraries but some times, I wish it could use
a set of predefined DOM nodes. Think microformats. Maybe an example is
more explicit :

----- HTML -----

<ul class="tabbuttons">
  <li for="firsttab">First tab</li>
  <li for"secondtab">Second tab</li>
</ul>

<div class="tabgroup">
  <div class="tab" id="firsttab">   Some content here    </div>
  <div class="tab" id="secondtab">   ...   </div>
</div>

---- js ----

// here you would lookup for the tabbuttons, maybe wrap the li content
with a link,
// hide the other tabs, ...
// in place, it would be nice to be able to just say something like
this :
$.setupTabs();
// notice, now CSS query where made.

---- css ----
/* the advantage is that you know the structure */

== messaging extension ==

It often happens that you want to show messages to the user instead of
the dreaded alert box. I see three common scenarios :
1) The webserver embeds some message to a page to notify the user of
the state of an operation (like rails' flash)
2) The javascript has something to tell to the user, for example form
validations, ..
3) An AJAX call returns some message to be displayed.

It would be really nice if jQuery provided a global "message" event
that could be triggered by those various cases.

--- js ---

$.onMessage(function(msg, kind) {
  var div = document.createElement("DIV");
  div.innerHTML = msg;
  $(div).addClass(kind);
})

$(function() {
  $("DIV.servermessage").each(function() {
   $.sendMessage($(this).text())
})

== logging / debug features ==

I really like the firebug console. If only jQuery could provide
something similar for the other browsers, it could be simply
marvelous. It would not take too much space to add $.console in the
base library with only phantom methods that could be overridden if
jquery-debug.js where included.

== plugin repository cleanup ==

The jQuery "make with_plugins" is not realy useful because not all
plugins follow the same file structure. Even the default one append
pictures, html, .. in the jquery.js file.

== single / many distinction ==

One confusing part of jQuery is how it handles single answers. $
("#someid").each for example is not logical, you expect one ore zero
answers, not many to zero. Same with the .offset() method. I wish some
distinction where made but I'm not sure how.

== the end ==

that's all folks :)

Reply via email to