On 27/11/06, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> the discussion so far led to the conclusion to remove all those macros
> for css() and attr(), eg. color() or val(). css() and attr() are already
> quite flexible: Both allow you to get a single property, set a single
> property or set a set of properties. I wonder if it would help to extend
> them to allow getting of multiple properties at once. A possible
> implementation would accept an array of String and returns a key/value
> object, with the values of the array as the keys. Is this useful?
>
> Another interesting point that needs some discussion:
> The event system is improved by accepting:
>  - an amount paramter (the number of times to execute an event handler,
> default is infinite) and additional data when binding events
>  - an bubble paramter (to trigger handlers of parent elements) and
> additional data when triggering events programmatically
> The big so far unsolved question: What should the API methods look like?
> How to pass the additional data to the event handler?
>
> Currently I favor an interface that looks like this:
> $().bind("type of event", eventHandler, {amount: 5, data: additionalStuff})
> $().trigger("type of event", {bubble: true, data: moreStuff});
> This avoids any type checking of arguments and provides a clear API: A
> little bit more to type, yet less confusion when you need only one of
> the optional paramters.
>
> Possible interfaces for the event handlers:
> $().bind("click", function(event, bindData, triggerData) { ... });
> $().bind("click", function(event) {
>     event.bind // contains bind data
>     event.trigger // contains trigger data
> });
>
> Your opinions?
>
> --
> Jörn Zaefferer
>
> http://bassistance.de

The problem with removing all the helper methods is that some are very
heavily used (especially val and click). While that may reduce
jQuery's file size, it will increase the size of many plugins and
pages that use jQuery.

Moving out of core may be a good idea if file size really is that
important (many have broadband or fast dialup and you can always use
gzip compression on the server), but it would still be good if these
(or at least the most used ones) were still part of the default
download (i.e. http://jquery.com/src/jquery-latest.js).

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to