Skip to main content

Posts

Showing posts with the label css

ReactJS, NPM and Maven

I'm just starting to get into working with ReactJS, Facebook's open source rendering framework. My project uses SpringBoot for annotation-driven dependency injection and MVC. I thought it would be great if I could use a bit of ReactJS to enhance the application. If you're looking for a basic conceptual intro, I recommend ReactJS for Stupid People and of course the official documentation  is quite good. In full disclosure, I still have no idea how to do "flux" yet. As an experienced Java backend developer, I'm pretty decent at hacking Maven builds - which is precisely what this blog post is going to be about. First, a word about how React likes to be built. Like many front-end tools, there is a toolkit for the node package manager (NPM). From the command prompt, one might run npm install -g react-tools  which installs the jsx command. The  jsx  command provides the ability to transform JSX syntax into ordinary JavaScript, which is precisely what I want...

Integrating LESS and Maven

When working on your local workstation, running a local instance of your website is very helpful. I often create two scripts to move code from my development workspace into the local website instance. One takes the war file outputted by Maven and publishes it. The second takes all of my static content and publishes it bypassing Maven, which is much faster than building and deploying the war file. When integrating CSS preprocessors into the workflow, I need to make sure they run in both deployment scripts. Here are the requirements for running CSS preprpceasors in my build process: The preprocessors need to run as part of the Maven build so my compiled files make it into the war file. The preproceasors should be run when I deploy just the static resources to my local instance. I am going to walk through installing and integrating LESS, but the concept is similar for other tools like compression or inspections. First I need to install LESS. I am running Ubuntu, so I can simply use...