Welcome to WebmasterWorld Guest from 54.145.44.134

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Ultimate Asset Management

     

httpwebwitch

1:47 am on May 27, 2013 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I'm looking for the best design pattern & solution for asset management. We're using LESS for the CSS, so I'm looking for something robust to handle our jQuery-powered script assets.

I want:
- script versioning
- cache control
- minifying & script concatenation
- dependency management

What's the best way to do all this on a large PHP-based project?

I am a fan of:
- Minify (http://code.google.com/p/minify/)
- Assetic (https://github.com/kriswallsmith/assetic/)

Require.js (http://requirejs.org/) looks promising, but I don't understand how to incorporate it into a PHP project... ?

httpwebwitch

2:06 am on May 27, 2013 (gmt 0)

WebmasterWorld Administrator httpwebwitch is a WebmasterWorld Top Contributor of All Time 10+ Year Member



"Jingo" is another dependency management tool:

[code.google.com...]

coopster

5:32 pm on Jun 5, 2013 (gmt 0)

WebmasterWorld Administrator coopster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



What's the best way to do all this on a large PHP-based project?


The million dollar question. And the answers will be about as unique and broad as there are developers. It will likely come down to your personal preference. I'll share what I'm using and you can take or leave the pieces, investigate, etc. Fair enough?

Have you ever considered SASS? I prefer SASS (Compass) over LESS. I wrote my own Ant build to automatically compile any and all .sass/.scss in my Eclipse IDE when changes are made. The build monitors updates across a project and makes an exploded and fancy indented copy for development/testing/troubleshooting as well as a compressed version for production. This way I just develop as normal without having to be concerned about using the "create new project" and "watch/compile project" features of these nifty tools. It's open source, on github [github.com...]

I use:
  • version control: git
  • cache-control (cache busting?): Apache configuration ( fairly good read on how to approach this at H5BP: [github.com...] )
  • minifier: YUI [yui.github.io...]
  • dependency management: ?

On that last one I have my projects setup to handle this by default.