← Back to team overview

launchpad-dev team mailing list archive

landed jsmin changes and watching build assistant

 

This is just a heads up on some refactoring of the JS dev tools I've been
able to get landed. This was enabled by some cleanup and work we've got
going towards the combo loader.

1. There's now a seperate lpjsmin package that we use for all minification
steps in Launchpad and it's available as an outside package if anyone else
might find it helpful in other projects.

http://pypi.python.org/pypi/lpjsmin

2. Now that the minification is packaged, I was able to write out a new JS
build helper. It uses pyinotify to watch a directory for any changed files.
In our case, it's watching for .js files changed. If it finds one, it auto
builds it into the combo loader build directory for you. This means that it

- copies the raw file into the combo loader build directory
- minifies that file
- if it's a new file, it auto updates the combo loader meta.js file

You can run this via `make jsbuild_watch`

This leaves a running process that you can just ctrl-c to kill when you're
done.

Note: this only builds for the combo loader, I'm not going to try to
rebuild launchpad.js on every change right now. The `make jsbuild` command
is still there for that. I'm just hoping the auto build tool will help make
the dev cycle for JS code in LP a bit nicer and might be useful for others
out there. (maas?)

Let me know if you've got any questions, suggestions, or bugs you find with
it.

-- 

Rick Harding
@mitechie
http://blog.mitechie.com
http://lococast.net