Welcome Guest, Not a member yet? Register   Sign In
Carabiner 1.3: Asset Management Library
#1

[eluser]tonydewan[/eluser]
Carabiner has been updated to version 1.42. See the new thread for more info and to download.

I fixed some standing bugs and added a bunch of little new features to Carabiner. Asset grouping is not yet included, as I'm still deciding what syntax makes the most sense. See the previous thread to see what I'm thinking.

Here is what is included:

Fixed realpath bug
I didn't read the PHP docs closely enough, and introduced a bug in some situations. I think I've fixed the issue. Let me know if I'm wrong.


Improved Logging
I added some more involved debug and error logging. This should make the troubleshooting easier if you're having problems.


Config File
Carabiner can now be configured with a config file. It's included in the zip. Please note that the old method of configuration will still work. In fact, Config options passed to the method directly will override options in the config file.


Recognize URLs
Carabiner is smarter. It will recognize URLs in assets and treat them differently. So, this will now work as expected:

Code:
$this->carabiner->js('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js');


Uses Default base_url value
The base_uri config value is no longer required. Carabiner will pull the value from the base_url CodeIgniter config setting by default. You only need to set it if you want to override it (with a subdomain, for example.)


Asset Specific Minify Flag
You can now pass a Boolean flag for minification on specific assets. This is similar to the combine flag.


Cleaner Code
For those of you who read through the source, you'll notice a few changes that (hopefully) make it a bit easier to follow.


Aside from these changes, usage remains the same. See the previous threads or the Wiki entry for background.
#2

[eluser]Amzad Hossain[/eluser]
When are you going to add asset grouping ??

I am looking forward to see that feature. Nice to see some new features.
#3

[eluser]tonydewan[/eluser]
@Amzad: Which syntax would you prefer? I outlined a couple of them in the previous thread, and I'm curious what people think would be better/more useful.

I'm glad your happy with the new features.
#4

[eluser]Amzad Hossain[/eluser]
Sorry, i missed the previous thread discussion. I think your grouping idea is fine. Let's just bring it to life.

There is another wicked idea but it could be troublesome or i am dreaming much, to not only minify the css/js files but also to combine them. I meant if there are 5 Css files let's just combine them into one ( Drupal does this). It can reduce HTTP request count. To do it, i have a rough idea, to use a controller to provide js/css files.

And if you add db support(optional) that can help to eliminate or overwrite old cached files.

I can put some assistance if you like.
#5

[eluser]tonydewan[/eluser]
The concept of combining assets is one of the core ideas of Carabiner. Carabiner will automatically combine assets as long as you have the combine flag set to true and you're in a production environment ( dev = false.) In fact, this is the default configuration.

Perhaps looking at the wiki or one of the previous threads will give you a better idea of how it works.

I've thought about bringing the database into the picture to allow for automatic elimination of cached files. However, it seems like an additional use of resources without much gain. Once your in a production environment, your cached files probably won't be replaced much. Since your not using much disc space, there's not really a reason to remove old ones immediately. However, I am interested in other ways to make automatic removal of assets happen. There might be smarter ways to name the cache files, for example. Or maybe it should happen on a regular basis? I'm definitely open to new ideas!
#6

[eluser]Amzad Hossain[/eluser]
sorry .. my mistake. i should have read it carefully. i have decided to put carabiner in my next project. Which will help me to understand it more closely. Till now i was just skimming through.. so better to put this in a real one.

Thanks for enlighten me. Hope to see some gr8 features in carabiner pretty soon.
#7

[eluser]12vunion[/eluser]
It should be noted that you do not/should not autoload the carabiner config in 1.3, as this causes carabiner to flip out. carabiner loads the config file itself.
#8

[eluser]tonydewan[/eluser]
For those of you interested, Carabiner has been updated to version 1.42, with new features including asset group and predefined assets of popular JavaScript Libraries! See the new thread for more info and to download.




Theme © iAndrew 2016 - Forum software by © MyBB