|
Websites
|
|
Monday, 14 February 2011 17:10 |
|
Working with JavaScript in the browser has a few pain points.
- Keeping your JavaScript in many files is nice for organization, but loading all of those files can cause poor performance.
- You can concatenate and minify your JavaScript into one file, but then you have to integrate this step into your build process
- If you're concatenating & minifying yourself, you've got to have a way to test that both forms behave the same. The most common problem I've seen here is when you add a new JS file and forget to add it to the minified version.
- Most important of all, you have to manage dependencies yourself. Let's say your file myapp.js requires jQuery to work. It would be very nice if you could just say require('jQuery') at the top of myapp.js instead of having to "just know" which files to put in your HTML and in what order.
Gracie fixes these problems. Gracie is a web service that delivers your JavaScript content. And it does some spiffy stuff in the process.
- You can request multiple files in one request
- You can specify if the output should be minified
- You can put "require" statements at the top of your JS files and they will be resolved for you
- You can have multiple JavaScript source directories
- You can run the bundled Gracie server, or you can use it as a library to inject your JavaScript directly into your HTML documents
Learn more or download Gracie.
|