[Update(3/17/16): This plugin has been ported to an Atom Editor, opens in a new tab package called amdbutler, opens in a new tab.]
A few months ago, I built a simple plugin for Sublime Text 3 for managing AMD dependencies called AMD Butler. Now it's hard for me to picture coding without it. If/when I make the switch to Atom this will be the first thing that I port over from Sublime.
AMD Butler is all about staying in the zone. First, let's take a look at life without it:
- Get a great idea
- Start coding
- Decide to add an AMD dependency
- Stop coding
- Scroll to the top of your file
- Remember and type the exact module id
- Scroll down to the factory function parameters
- Remember the order of the dependencies
- Think of what to name the return parameter
- Scroll back to where you were working
- Completely forget what you were doing
Now let's look at life with AMD Butler:
- Get a great idea
- Start coding
- Decide to add an AMD dependency
- Execute the AMD Butler add command
- Type the first few letters of the module id and hit enter
- Continue coding in the zone
This is what it looks like:
AMD Butler dynamically crawls your existing modules and builds a quick list. It only takes a few keystrokes to find the correct one and then it automatically adds it to your list of dependencies with an appropriate associated factory function argument. All without affecting the position of your cursor. This is especially nice to use after slurping ESRI JS modules. No more scrolling, no more trying to remember module names or preferred argument aliases. Just quickly add a dependency and get back to what you were doing.
There's also commands for sorting, removing and pruning unused dependencies.
AMD Butler can be installed via Sublime Package Control. Head over to it's GitHub page to checkout the code or report any issues.