Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Mar 2009
    Location
    Uk, North
    Posts
    47
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Cutting down frameworks!!!!?????

    Is there ever any merit in cutting down a lib to the essentials that a particular exercise needs....? Oh I dunno, example if you want one... cutting down MooTools to the essential elements needed by the mRotate script at http://www.piksite.com. Is there ever a scenario where it's worth doing... ever? Is it even feasible (or sensible)?

    Yeah, this is one of those wildcard questions isn't it. It's a serious one , even if it's slightly mad.

  • #2
    New Coder
    Join Date
    Aug 2009
    Location
    London, England
    Posts
    21
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Kelon View Post
    Is there ever any merit in cutting down a lib to the essentials that a particular exercise needs....? Oh I dunno, example if you want one... cutting down MooTools to the essential elements needed by the mRotate script at http://www.piksite.com. Is there ever a scenario where it's worth doing... ever? Is it even feasible (or sensible)?

    Yeah, this is one of those wildcard questions isn't it. It's a serious one , even if it's slightly mad.
    there's a new dependency checker which can look at what your script does and then list only relevant required components to be picked through the mootools.net downloader:

    check http://www.aryweb.nl/projects/mooDeps/

    now personally, i believe that using gzip on css and js files + some packer (not eval based, say, yahoo one) will really be a better option in saving bandwith. you remain with a framework with it's full capabilities at little or no cost to the end user. by doing so, you can even reference the google hosted versions of the frameworks and save yourself bandwith anyway.

    but should the time come when a feature is needed you may have neglected to include, no "recompile" or re-download of mootools will be necessary (other frameworks' approaches disinterest me)

  • #3
    New Coder
    Join Date
    Mar 2009
    Location
    Uk, North
    Posts
    47
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Oo, I see you've made the move to London then, Dimitar . Late nights... yes, understood. I have a recipe for late nights called "Promise a site done for a certain time and then decide to push your own boundaries", cooks up late nights easy. Anyhow....

    Again, another good link, thank you. I'm exploring all possibilities... as I've a site which, oh blah, blah, you know, image heavy, c/w movies, flash, whizzo, brand/product is showy-whizzo, so... how it is.... me being me, I'm still determined the site'll be as efficient as it can be.

    Been reading gzip tech guide for IIS... an wondering how much fun I can stand all at once.

    Thanks again for your opinion, useful, appreciated. Regards.

  • #4
    New Coder
    Join Date
    Aug 2009
    Location
    London, England
    Posts
    21
    Thanks
    0
    Thanked 3 Times in 3 Posts
    oh IIS... that's not ideal. apache can use content type deflate filters which do the gzip on the fly but IIS... I am sure somebody figured it out. still, consider hosting on a CDN at least your js and css if you fail with the rest.

    i think the best tool for optimising site speed by doing a series of updates/checks is the YSlow plugin for firebug by yahoo. i can't recommend it enough - it has really helped me optimise some heavy sites. it also has a meaningful performance measure as a yahoo speed index' - assigns a grade that's comparable to other sites etc.

    there's also a firebug plugin by google called PageSpeed which can measure performance index as well as profile javascript, also rather nice... good luck optimising

    oh and if you use mootools, there's also a bunch of things to help squeeze more juice out of the javascript itself but that's a separate subject altogether.

  • Users who have thanked Dimitar for this post:

    Kelon (08-28-2009)

  • #5
    New Coder
    Join Date
    Mar 2009
    Location
    Uk, North
    Posts
    47
    Thanks
    2
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by Dimitar View Post
    oh IIS... that's not ideal.
    ., tell me about it. I'm pleased I've had a life free of IIS until a couple of projects ago. There is something in the documentation about deflate, but I've lost the will to live with the tech doc so have been doing the front-end stuff as I'm not into optimisation of the site proper yet.

    YSlow is cool, good recommend., I'd not tripped over PageSpeed in my meanderings, thanks for the tip.

    I've managed to get by repurposing the odd simple JavaScript having worked as part of a team to date, where serious JavaScript was someone else's bag. It's different now. Take it you'd recommend adopting MooTools? I like the talk of Objects and inheritance via prototypes... very ActionScript sounding.. and while MooTools claims "intermediate/advanced".. well I've enough experience of other languages to over-estimate my capabilities and dive-in - reckless, feckless idiot that I am.

    All the best.

  • #6
    New Coder
    Join Date
    Aug 2009
    Location
    London, England
    Posts
    21
    Thanks
    0
    Thanked 3 Times in 3 Posts
    mootools is the path to joy. classes, inheritance, etc. don't fall for the old intermediate to advanced crap either - especially if you know actionscript and vanilla js (hence ECMA) and OOP, you'll land right at home, reckless or otherwise

    mootools is the marmite of frameworks really. you either love or hate the prototyping - i prefer to think of it as progressive enhancement of existing functions in the style of things that are coming to js anyway. those that oppose see it as making the playing field 'dirty' and thus interfering with other frameworks or scripts. oh well, can't make everyone happy, choosing a framework is not a simple matter anyway. i am just sitting tight and waiting for the quietly hyped up mootools 2.0 to take back the web

  • #7
    New Coder
    Join Date
    Aug 2009
    Posts
    84
    Thanks
    1
    Thanked 7 Times in 7 Posts
    if you have any PHP support on a server ANYWHERE, here's a nice little script that will automatically gzip deflate js and css files if the browser supports it:

    lib.php:
    Code:
    <?php
    @ob_start('ob_gzhandler');
    
    if(substr($_GET['src'], -3) == '.js')
      $mime = 'text/javascript';
    elseif(substr($_GET['src'], -4) == '.css')
      $mime = 'text/css';
    
    header('Content-type:  '. $mime);
    readfile($_GET['src']);
    ?>
    What this does is it gets the file path from $_GET['src'] and reads the file after sending appropriate headers, and compresses it along the way, thanks to the second line.

    Example usage:
    Code:
    <script type="text/javascript" src="lib.php?src=path/to/file.js"></script>
    Which compresses and outputs the contents of the file at path/to/file.js


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •