marklogic-community / roxy

Deployment tool for MarkLogic applications. Also provides optional unit test and XQuery MVC structure
Other
87 stars 66 forks source link

RFE: Add minification option to deploy modules process #100

Open peterskim12 opened 11 years ago

peterskim12 commented 11 years ago

Interesting thought came up during an interview... she mentioned they minify their CSS and JS files during the deployment process.

Might be an interesting feature to have these options available in the build properties file:

minify_js=true/false minify_css=true/false

that perform minification during the deploy process.

dmcassel commented 11 years ago

Paxton & I kicked that around in the past. We got stuck on how to identify references to JS and CSS inside of XQuery files. Or in HTML. Definitely a problem worth solving.

peterskim12 commented 11 years ago

Looks like there are some Grunt plugins that implement this. For pure XQuery-based apps, we'd have to integrate the Grunt plugins with Roxy. For hybrid apps where the front-end is HTML/CSS/JavaScript, it's probably better to manage the front-end app code using Grunt, then rely on Roxy simply to push the Grunt dist output to some MarkLogic app server instance.

dmcassel commented 11 years ago

How hard would it be to set up Roxy's ml deploy modules command to call Grunt?

peterskim12 commented 11 years ago

I'm actually guessing that Grunt wouldn't know how to handle the mixed XQuery/HTML files in a pure XQuery/MVC app but I could be wrong...

paxtonhare commented 11 years ago

The big problem you run into is knowing which js/css files to minify. Often these tools like to minify a bunch of js into one big file. Order matters. I looked into doing this with some ruby gems at one time and found the problem to be more involved than it seemed on the surface. This Grunt approach sounds interesting but I suspect you will alienate people with the node.js requirement. There's been plenty of pushback already over using Ruby.