<div dir="ltr">Hey Bruno,<div><br></div><div>awesome job with the docker image!</div><div>Could we mention that in the README?</div><div><br></div><div><br></div><div>I&#39;ve created this issue to track improvements in the build itself:</div>



<div><a href="https://issues.jboss.org/browse/AGPUSH-881" target="_blank">https://issues.jboss.org/browse/AGPUSH-881</a><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div class="gmail_extra">


Responds inline:<br>
<br><div class="gmail_quote">On Tue, Aug 5, 2014 at 9:56 PM, Bruno Oliveira <span dir="ltr">&lt;<a href="mailto:bruno@abstractj.org" target="_blank">bruno@abstractj.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



Good morning peeps,<br>
<br>
I would like to open this thread to discuss some ideas about how to<br>
improve the current build on Push server. Lukas have been doing a<br>
stellar job improving it and I think we can help.<br>
<br>
Yesterday I spent some time trying to build a developer environment for<br>
UPS — was a good exercise to realize how people feel trying to contribute.<br>
The goal was to build the environment from scratch.<br>
<br>
Here comes some feedback (keep in mind that I&#39;m not that good on Node.js)<br>
<br>
- Build our dependencies takes a considerable time. For fair<br>
  reasons, we are running mvn install, npm install and bo<a href="http://blog.nodejs.org/2012/02/27/managing-node-js-dependencies-with-shrinkwrap/" target="_blank">http://blog.nodejs.org/2012/02/27/managing-node-js-dependencies-with-shrinkwrap/</a>wer install<br>




  for the first time. Maybe we can reduce one step?<br></blockquote><div><br></div><div>We cannot avoid Maven and if we want really fresh compiled-from-sources approach (as opposed to store-compiled-to-git what we had before), we need go with both, Bower and NPM.</div>



<div><br></div><div>Storing NPM deps in /node_modules is <a href="http://blog.nodejs.org/2012/02/27/managing-node-js-dependencies-with-shrinkwrap/" target="_blank">platform-dependent</a>.</div><div><br></div><div>We could store there Bower dependencies though. We can use <a href="https://github.com/liveoak-io/liveoak/blob/master/console/src/main/resources/bower.json#L28" target="_blank">exportsOverride</a> section to extract just those files from our dependencies that we actually require in the project. Once updated, we can save them.</div>


<div><br></div><div>But once you have NPM installed correctly, it&#39;s just a small step to running Bower.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
- Java developers don&#39;t have their environment ready for Node — it can<br>
  be a blocker. For example, was necessary to install gcc, libpng and<br>
  libpng-devel. I already saw team members struggling with it, like me.<br></blockquote><div><br></div><div>This is a blocker, I wasn&#39;t even aware of it - we may want to choose other plugins that don&#39;t require those dependencies or maybe inspect what grunt plugins we are even using. Do we even need some of those Grunt plugins like PNG minification (imagemin)?</div>



<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
- Maybe we should run -Pdev by default and run the complete build only<br>
  for CI.<br></blockquote><div><br></div><div>Yes, we have to come with sensible defaults. We store our NPM/Bower caches inside the project structure and we clean them with each clean. This is anti-pattern - in Java analogy - it&#39;s cleaning .m2/repository for each build - we should clean them just when we explicitly want to. -Pdev would stay here, but it would just remove /node_modules and /bower_components</div>



<div><br></div><div>a) should add one more profile to clean even caches, e.g. -Pforce-clean</div><div>b) or do not clean it at all and document that if one needs completely fresh sources, he should clean manually by &quot;git clean -f -x -d&quot; and &quot;npm cache clean&quot;</div>



<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
- Maybe we can minify some JS dependencies and don&#39;t build<br>
  everything altogether?<br>
<br>
I built an image[1][2], because developers willing to just use UPS with the<br>
latest bits might struggle to configure their environment and maybe it<br>
can be helpful.<br>
<br>
The image is not perfect and soon will be moved to jboss/dockerfiles.<br>
<br>
Thoughts?<br>
<br>
[1] - <a href="https://github.com/abstractj/docker/tree/master/aerogear-unifiedpush-dev" target="_blank">https://github.com/abstractj/docker/tree/master/aerogear-unifiedpush-dev</a><br>
[2] - <a href="https://registry.hub.docker.com/u/abstractj/unifiedpush-dev/" target="_blank">https://registry.hub.docker.com/u/abstractj/unifiedpush-dev/</a><br>
--<br>
<br>
abstractj<br>
PGP: 0x84DC9914<br>
_______________________________________________<br>
aerogear-dev mailing list<br>
<a href="mailto:aerogear-dev@lists.jboss.org" target="_blank">aerogear-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/aerogear-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/aerogear-dev</a></blockquote></div><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">



Also, someone suggested to use wro4j - as long as it is vital alternative for the build time, wro4j is really not handy for development, you won&#39;t get as quick turnaround as with Grunt.</div><div class="gmail_extra">


<br>
</div><div class="gmail_extra">Some plugins we use doesn&#39;t even have to be available in wro4j, e.g. ngtemplates, ngmin.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">



<br></div><div class="gmail_extra">Making the build straight-forward is an ongoing, continuous process and we have still lot to investigate here. It can&#39;t definitely be finished in 1.0 time.</div><div class="gmail_extra">


<br></div><div class="gmail_extra">Bear in mind that Node/NPM is very young technology and it will take some time to get it to the state where Maven is (if ever).</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">In the meantime, I encourage you to use this awesome docker image Bruno created!</div></div>