-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Need Changes to BBQ #6
Comments
So, I think that BBQ is already very small at 4kb minified (2kb gzip). BBQ is basically made of 2 parts, the hashchange event and the param/deparam stuff. The latest hashchange event (v1.3) plugin weighs in at 1.5kb minified (0.8kb gzip), but if the IE6/7-specific code is stripped out, that brings the hashchange event plugin size down to 0.9kb minified (0.5kb gzip).. so 0.6kb (0.3kb) can be saved by removing that stuff. Since the param/deparam stuff is pretty much the whole point of BBQ, I'm not sure that much savings can be had there. That being said, if you're just going to be storing a full href in the location.hash, you could just use the hashchange event. A simple feature comparison: Hashchange event
BBQ
Also note that an upcoming version of BBQ will allow per-hashchange-handler param+value matching, which will work like routes, but work withing standard jQuery event handler bind/trigger patterns. If 2kb is too big and you still want to handle setting/getting the hash as an object with properties, you might want to take the basic v1.3 hashchange event, strip out the IE6/7 stuff (which is very easy to do), and then write some super-simple non-deep deparam code to parse the hash. Of course, from what I've seen in jQuery.mobile.js, you don't even need the param/deparam stuff at all (but I bet you'll want param/deparam eventually). |
seems we might be able to just use hashchange. I'll take a look. |
removed dependency on jQuery bbq in this file. Now we only really need the hashchange plugin, unless plugins like tabs and tree end up needing to track their state via hash params. (Currently, jQuery.tabs.js uses bbq for tracking state under the "tab" parameter.) For now, this closed by 1e7ed8c |
Right now we're using hashchange and using getters and setters for the state history - unfortunately we have to include the full BBQ for that. Any help in reducing the plugin down to just what we need would be appreciated. You can see what we're using it for in jquery.mobile.js.
The text was updated successfully, but these errors were encountered: