[Solar-talk] Moving to Solar_Json

Clay Loveless clay at killersoft.com
Tue Sep 5 08:28:29 PDT 2006


On Sep 4, 2006, at 6:08 AM, Rodrigo Moraes wrote:

> Other companion for all the js stuff is a minifier like JSMin [1].
> I've been using it; on development I ever use a "filename-src.js"
> javascript version; before putting it online, I minify the scripts
> using JSMin and save them as "filename.js".

Hi Rodrigo,

The general approach I've been taking to this is very similar.

If the bundled library is available elsewhere, we just include a  
jsmin-imized version in Solar, with a comment at the top of the file  
indicating what library and version it is. That way those who need to  
debug, troubleshoot, etc. know where they can find the full source.

In the future, Solar will likely include a couple of JavaScript files  
of its own. In that case, we'll include a 'filename.src.js' version  
of the file, which will not be minimized, and the minimized version  
as 'filename.js'. We'll then only include the minimized version in a  
page ... but by providing the source, Solar users can tinker around  
by renaming a couple of files temporarily and throwing in FireBug  
console.log() calls, etc.

> I'm still thinking on a
> better way to change the script calls when in dev/production;
> currently I keep two arrays and change the one that is used, not very
> smart. ;-)

This might be as simple as setting a config variable, and leaving the  
variable blank when in production.

$config['Tipos_App']['srcstr'] = '-src';


$this->layout_scripts[] = 'filename'.$this->_config['srcstr'].'.js';


Then just leave that variable empty when you go to production.

-Clay

--
Killersoft.com





More information about the solar-talk mailing list