Feature request minify js and css when creating archive

128 views
Skip to first unread message

mail...@gmail.com

unread,
Feb 3, 2015, 12:42:04 AM2/3/15
to lu...@googlegroups.com
Hi All, in the admin section "Archives & Resources - Mappings" I would like to add an option "minify css and javascript resources", I currently do this manually using the yui compressor however doing this in a single step is easier.

If I can have some pointer how to do this either as a "application extension" plugin or as part of the admin section.

GX


Kai Koenig

unread,
Feb 3, 2015, 1:52:26 AM2/3/15
to lu...@googlegroups.com
> Hi All, in the admin section "Archives & Resources - Mappings" I would like to add an option "minify css and javascript resources", I currently do this manually using the yui compressor however doing this in a single step is easier.
>
> If I can have some pointer how to do this either as a "application extension" plugin or as part of the admin section.


I think as a feature this could be useful.

Some ideas/discussion points:

- Should there be optional settings, e.g.
* minimising CSS or JS only
* nomunge for JS
* charsets?

Cheers
Kai

Michael Offner

unread,
Feb 3, 2015, 2:28:48 AM2/3/15
to lu...@googlegroups.com
So when you create a mapping in the admin, Lucee should compress css and js files? We could do that by adding a listener to the admin action that creates the archive, we could call that listener for every file added to the archive the listener gets and returns the file in question.

Micha 
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/655131ba-3c79-4654-b09e-787f2e60e390%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adam Cameron

unread,
Feb 3, 2015, 3:00:35 AM2/3/15
to lu...@googlegroups.com


On Tuesday, 3 February 2015 07:28:48 UTC, Micha wrote:
So when you create a mapping in the admin, Lucee should compress css and js files? 


No. At most it should provide hooks so pre/post/etc operations can be included in the archival process. There is no need for Lucee to provide the minification functionality as there's plenty of solutions out there already to do that. You get more bang for buck providing the mechanism to facilitate [some thing] to be done, rather than implementing one specific thing. Also then it farms out the development of a minification module to third parties, so the Lucee team can focus on Lucee.

-- 
Adam

Jonas Hauß

unread,
Feb 3, 2015, 3:04:13 AM2/3/15
to lu...@googlegroups.com
So we are going to use the admin and mappings to manage static assets? Cool!

Sooner or later an other addition could be a function, to load a specific script or stylesheet with an optional flag for minification.

Would be very helpful to make pages a bit more dynamic ;)

Jean Moniatte

unread,
Feb 3, 2015, 3:11:11 AM2/3/15
to lu...@googlegroups.com
The same way the UI tags were not a good idea at the time, I think that it is better to keep minification and compression of static assets outside of Lucee. Like Adam said, there are plenty of tools to do so, no need to have Lucee involved for that.

Thanks,
Jean
--
Jean Moniatte
UGAL


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

mail...@gmail.com

unread,
Feb 3, 2015, 3:11:32 AM2/3/15
to lu...@googlegroups.com
yes hooks are best option it could even be used to inject license info at top of files or optimize images :D

if this approach is taken I understand that to implement it I will need to create a plugin ("application extension") correct?

Adam Cameron

unread,
Feb 3, 2015, 3:17:08 AM2/3/15
to lu...@googlegroups.com
On 3 February 2015 at 08:11, <mail...@gmail.com> wrote:
yes hooks are best option it could even be used to inject license info at top of files or optimize images :D

if this approach is taken I understand that to implement it I will need to create a plugin ("application extension") correct?

I could not comment on how it should be implemented. But I'd sure like to see what the plan is before it was signed off for implementation (TBH: the same applies to any dev on Lucee)

-- 
Adam 

Mark Drew

unread,
Feb 3, 2015, 3:20:02 AM2/3/15
to lu...@googlegroups.com
+1000

What if I want to call cfgrunt or whatever project I am happy with? Much better provide the hooks than do the job and become obsolete and fill this mailing list with "why isn't Lucee using cfgrunt 3.0 instead of 2.9?! Are you all idiots?!!!" Kind of posts. 

Mark Drew
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Michael Offner

unread,
Feb 3, 2015, 4:01:18 AM2/3/15
to lucee
Maybe my explanation about the "listener" was not clear enough, this was exactly the idea.
Let me show it with an example.
This is the code you find in the admin to create an Archive:

<cfadmin 
  action="createArchive"
  type="#request.adminType#"
  password="#session["password"&request.adminType]#"
  file="#target#"
   virtual="#data.virtuals[idx]#"
  addCFMLFiles="#data.addCFMLFiles[idx]#"
  addNonCFMLFiles="#data.addNonCFMLFiles[idx]#"
  append="#not doDownload#"
  remoteClients="#request.getRemoteClients()#">

we simply make the possibility to extend it as follows:

<cfadmin 
  action="createArchive"
  type="#request.adminType#"
  password="#session["password"&request.adminType]#"
  file="#target#"
   virtual="#data.virtuals[idx]#"
  addCFMLFiles="#data.addCFMLFiles[idx]#"
  addNonCFMLFiles="#data.addNonCFMLFiles[idx]#"
  append="#not doDownload#"
  remoteClients="#request.getRemoteClients()#"
  listener="#function (string path, any content /* binary or string*/){
      if(listLast(path,'.') != "js") return;
      return compressJS(content);
}#"
>

that's it!
you can also manipulate the java bytecode, images whatever you like!

Micha





--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

mail...@gmail.com

unread,
Feb 3, 2015, 4:05:39 AM2/3/15
to lu...@googlegroups.com
ok that would be ideal

Michael Offner

unread,
Feb 3, 2015, 4:11:14 AM2/3/15
to lucee
See my comments between the lines ...

Micha

On Tue, Feb 3, 2015 at 9:04 AM, Jonas Hauß <hauss...@gmail.com> wrote:
So we are going to use the admin and mappings to manage static assets? Cool!
We already do, when you create a archive you can define if it should include static assets or not with a flag.
only problem is, to call a static asset like this "/myMapping/susi.jpg" you need to do a mapping in the servlet engine that Lucee is handling the ".jpg" extension, we have a "FileServlet" for this in place..., there is description about this somewhere, i will search it and add it to the wiki. 
 

Sooner or later an other addition could be a function, to load a specific script or stylesheet with an optional flag for minification.
yeah i was also thinking about this, having a <cfscriptInclude> tag.
that is compressing the include, so this could look like this.
<cfscriptInclude template="my/script.js" compress="#application.compress#">
a tag like this is easly done within a hour and it could be provided as an extension.
Sure not part of the core!
 

Would be very helpful to make pages a bit more dynamic ;) 
--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Jonas Hauß

unread,
Feb 3, 2015, 4:24:07 AM2/3/15
to lu...@googlegroups.com
<cfscriptinclude>? Maybe I can do that for you.

Adam Cameron

unread,
Feb 3, 2015, 5:42:38 AM2/3/15
to lu...@googlegroups.com


On 3 February 2015 at 09:01, Michael Offner <mic...@lucee.org> wrote:
Maybe my explanation about the "listener" was not clear enough, this was exactly the idea.
Let me show it with an example.
This is the code you find in the admin to create an Archive:

Yes Micha, I get that. I was responding to this:

Micha:
> So when you create a mapping in the admin, Lucee should compress css and js files? We could do that

My emphasis

My point is no you shouldn't.

Provide the hook. That's it. I was just making sure you weren't also going to roll the minification stuff into Lucee.

I guess perhaps when you said "we" you were just being inclusive, and you pretty much meant "someone".

-- 
Adam






Adam Cameron

unread,
Feb 3, 2015, 5:44:13 AM2/3/15
to lu...@googlegroups.com
On 3 February 2015 at 09:01, Michael Offner <mic...@lucee.org> wrote:

<cfadmin 

I believe that at this point <cfadmin> is still undocumented?

So you're now in the position to get rid of the tag-based implementation, and do it properly? (at least deprecate the undocumented implementation, lest anyone is actually using it).

There is no way this ought to be a tag.

-- 
Adam
 

Mark Drew

unread,
Feb 3, 2015, 5:47:40 AM2/3/15
to lu...@googlegroups.com
What do you suggest (honest question, not an incitement) ? something like an Admin.cfc ?

There is an Admin.cfc in the /lucee/admin/ folder that means you could invoke the <cfadmin> tag. 

or maybe a luceeAdmin<action>() function? the problem is that there are so many attributes and they vary… maybe an Admin (core) object with more methods?

admin = LuceeAdmin();
admin.setDatasource(type=“web”, password=“bla”);
admin.restart(password=“bla”) 

Thoughts?


MD







--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Adam Cameron

unread,
Feb 3, 2015, 5:55:19 AM2/3/15
to lu...@googlegroups.com
On 3 February 2015 at 10:47, Mark Drew <mark...@gmail.com> wrote:
What do you suggest (honest question, not an incitement) ? something like an Admin.cfc ?


Yeah. It's an object-oriented language, so some sort of object-oriented solution. What you suggested seemed infinitely better, right from the outset.

Just not a tag. That was a "suboptimal" way of doing it right form the outset. 

(flat out @ work today... PHPUnit shenanigans... so can't give it much thought. I just want to make sure that whilst we're in the position to de-cruft the language, we do).

I'll think about it and come back.


-- 
Adam

mail...@gmail.com

unread,
Feb 3, 2015, 6:04:38 AM2/3/15
to lu...@googlegroups.com
actually I do use <cfadmin> to create datasources and compile code on the fly...
That said documentation is king and since one of the primary goals of Lucee is better documentation I suggest you look to the two best documentation imho:

The arch wiki:
https://wiki.archlinux.org/index.php/
just look at the information they give on tomcat:
https://wiki.archlinux.org/index.php/Tomcat

Sencha Extjs docs
http://docs.sencha.com/extjs/
look at the expanation of a panel
http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.panel.Panel

GX

Simon Hooker

unread,
Feb 3, 2015, 6:40:39 AM2/3/15
to lu...@googlegroups.com
I'm also using <cfadmin> to configure OpsWorks instances during the setup process however would love to see it deprecated in favour of a documented Admin object.

Especially if it means no longer having to consult http://www.getrailo.org/index.cfm/documentation/cfadmin-doc/ and the railo-context source code to try and guess at parameters!

gary gilbert

unread,
Feb 4, 2015, 4:18:27 AM2/4/15
to lu...@googlegroups.com
where's the like button?

<button>like</button>

Ahh there it is

gary gilbert

unread,
Feb 4, 2015, 4:30:03 AM2/4/15
to lu...@googlegroups.com

Adam it is documented, or at least is/was for railo

http://www.getrailo.org/index.cfm/documentation/cfadmin-doc/

I think we've been using it since Railo existed, getting rid of it now could cause some problems with all of our clients that were "promised" a painless migration to lucee.

Cheers,

Gary

Mark Drew

unread,
Feb 4, 2015, 4:46:39 AM2/4/15
to lu...@googlegroups.com
Yeah, it is used by the whole Lucee admin so that would take a bunch of work to change it to a new api for real benefit so let’s keep cfadmin tag as it is and provide a better way to access it that is more self documenting. 

This was an effort that I think most of the community could do by making methods concrete in:


Then it would just be a matter of making Admin.cfc a top level component (i.e. that you can do new Admin() from anywhere, like new Query()) 

I am saying this is not a hard job, just a tedious job and we can all do it. 

The actual implementation of the Admin is here:


So at least you can see all the methods (don’t read it plainly you need eclipse. or at least scroll down past all the imports) 

As a suggestion, maybe tasks like this should have a “bounty” like “free individual membership to the association for a year” or something like that?

Regards

Mark Drew



--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Adam Cameron

unread,
Feb 4, 2015, 5:11:20 AM2/4/15
to lu...@googlegroups.com
On 4 February 2015 at 09:30, gary gilbert <gary.g...@gmail.com> wrote:

Adam it is documented, or at least is/was for railo

http://www.getrailo.org/index.cfm/documentation/cfadmin-doc/

I think we've been using it since Railo existed, getting rid of it now could cause some problems with all of our clients that were "promised" a painless migration to lucee.


[Looks at the docs]

OMFG.

Seriously? Someone implemented code that works like that. How professionally embarrassing.

When's this committee that oversees how the Railo^h^h^h^h^hLucee devs implements things being formed? There's *no way* that <cfadmin> tag should ever have made it into the language.


But, yeah, you're right. I guess the best that can be done is deprecating it.

-- 
Adam
 

Mark Drew

unread,
Feb 4, 2015, 5:19:51 AM2/4/15
to lu...@googlegroups.com
This has been in Railo since forever. It’s how you do any settings before even ACF had the concept of doing it. 

<cfadmin action=“bla” type=“web|server’ password=“x”>

Why would it be professionally embarrassing to create  a tag to do administration since BEFORE CFC’s were in Railo?!

cfadmin was always a non documented (ish) and viable to changes as it’s the way the Railo team could administer the admin. There was no better way since Railo 1 or 2 (before my time there) and of very low importance to change. 

See it as an extension and not part of the language if you will. 

A lot of this is now kind of added in the Application.cfc tag so I guess there is massive overlap. 

Personally I would prefer to see it ALL in an Application.cfc but then again peoples mileage may vary. 

MD 



--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Michael Offner

unread,
Feb 4, 2015, 5:38:51 AM2/4/15
to lucee

Michael Offner

unread,
Feb 4, 2015, 5:41:13 AM2/4/15
to lucee
there was never an intention to make the cfadmin tag official, because of that you find no documentation for it.
This was always an internal tag and I did this make clear many times ;-)

Micha


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Mark Drew

unread,
Feb 4, 2015, 5:42:41 AM2/4/15
to lu...@googlegroups.com
Aha, Sorry about that! 

Yep, that looks better, so I guess you would do 

admin = new Administrator();

or
admin = new org.lucee.cfml.Administrator(type=“server”, password=“bob”);
admin.getAvailableTimezones();

so we are getting there, just need to add the other few hundred actions :) 

MD



Adam Cameron

unread,
Feb 4, 2015, 5:45:54 AM2/4/15
to lu...@googlegroups.com
so we are getting there, just need to add the other few hundred actions :) 


Please. FOR THE LOVE OF GOD, break it out into a well-designed API. Not just one monolithic CFC.

-- 
Adam




Mark Drew

unread,
Feb 4, 2015, 5:47:22 AM2/4/15
to lu...@googlegroups.com
Up to you buddy, someone make suggestions and people will build it :) 
I am not doing any architecture on that tag at the moment, but your input is welcome. 

MD 

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Michael Offner

unread,
Feb 4, 2015, 6:10:38 AM2/4/15
to lucee
Everybody is welcome to jump in and change it as they think fit! 
For me is important that every method has a testcase, then cfadmin tag can and will change over time.
I did a wiki entry for this:

Micha

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Alex Skinner

unread,
Feb 4, 2015, 6:36:55 AM2/4/15
to lu...@googlegroups.com
I agree, cfadmin is a legacy its there for those that want to use it,

To be honest I think any further investment in the cfadmin tag is a waste of resources, my view is the admin is in itself a waste of effort for further development

I know we will be announcing some tools with Rasia for server management on a wider scale which helps with some of this stuff but also feel that Lucee should have better support for setting management through environment variables rather than this being something that you are cutting code for.

Config doesn't belong in either the application.cfc or a separate lucee xml file I think we should be expending effort in doing it the right way rather than engineering stuff to do it the old way ;)

My 2p

A



For more options, visit https://groups.google.com/d/optout.



--
Alex Skinner
Managing Director

Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom



T: +44 [0] 845 260 0726 W: www.pixl8.co.uk E: in...@pixl8.co.uk




Follow us on: Facebook Twitter LinkedIn



CONFIDENTIAL AND PRIVILEGED - This e-mail and any attachment is intended solely for the addressee, is strictly confidential and may also be subject to legal, professional or other privilege or may be protected by work product immunity or other legal rules. If you are not the addressee please do not read, print, re-transmit, store or act in reliance on it or any attachments. Instead, please email it back to the sender and then immediately permanently delete it. Pixl8 Interactive Ltd Registered in England. Registered number: 04336501. Registered office: 8 Spur Road, Cosham, Portsmouth, Hampshire, PO6 3EB

Michael Offner

unread,
Feb 4, 2015, 6:51:52 AM2/4/15
to lu...@googlegroups.com
Remember when obd came out without a admin, I think that was the most discussed topic that time in the obd list...
So I think that the admin is still important for many people, maybe only to create a application.cf in there ;-) But that does not mean you are not right with the rest!

Micha

mail...@gmail.com

unread,
Feb 4, 2015, 6:56:29 AM2/4/15
to lu...@googlegroups.com
Yes I agree, I think the fact that tomcat and lucee/railo have a web based admin site although convenient is a HUGE security concern and much prefer to manage things via config files and admin apis or directly from the code.


On Wednesday, February 4, 2015 at 1:51:52 PM UTC+2, Micha wrote:
Remember when obd came out without a admin, I think that was the most discussed topic that time in the obd list...
So I think that the admin is still important for many people, maybe only to create a application.cf in there ;-) But that does not mean you are not right with the rest!

Micha

Am Mittwoch, 4. Februar 2015 schrieb Alex Skinner :
I agree, cfadmin is a legacy its there for those that want to use it,

To be honest I think any further investment in the cfadmin tag is a waste of resources, my view is the admin is in itself a waste of effort for further development

I know we will be announcing some tools with Rasia for server management on a wider scale which helps with some of this stuff but also feel that Lucee should have better support for setting management through environment variables rather than this being something that you are cutting code for.

Config doesn't belong in either the application.cfc or a separate lucee xml file I think we should be expending effort in doing it the right way rather than engineering stuff to do it the old way ;)

My 2p

A

On 4 February 2015 at 11:10, Michael Offner <mic...@lucee.org> wrote:
Everybody is welcome to jump in and change it as they think fit! 
For me is important that every method has a testcase, then cfadmin tag can and will change over time.
I did a wiki entry for this:

Micha
On Wed, Feb 4, 2015 at 11:45 AM, Adam Cameron <dac...@gmail.com> wrote:
so we are getting there, just need to add the other few hundred actions :) 


Please. FOR THE LOVE OF GOD, break it out into a well-designed API. Not just one monolithic CFC.

-- 
Adam




--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.



--
Alex Skinner
Managing Director

Pixl8 Interactive, 3 Tun Yard, Peardon Street, London
SW8 3HT, United Kingdom



T: +44 [0] 845 260 0726 W: www.pixl8.co.uk E: in...@pixl8.co.uk




Follow us on: Facebook Twitter LinkedIn



CONFIDENTIAL AND PRIVILEGED - This e-mail and any attachment is intended solely for the addressee, is strictly confidential and may also be subject to legal, professional or other privilege or may be protected by work product immunity or other legal rules. If you are not the addressee please do not read, print, re-transmit, store or act in reliance on it or any attachments. Instead, please email it back to the sender and then immediately permanently delete it. Pixl8 Interactive Ltd Registered in England. Registered number: 04336501. Registered office: 8 Spur Road, Cosham, Portsmouth, Hampshire, PO6 3EB

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages