What’s new with MavensMate?

Posted by in mavensmate, salesforce

logo2

MavensMate undergoes some pretty radical changes with the most recent release, so I want to take this opportunity to give a brief rundown of its current state:

“MavensMate” now refers to a tool for writing cross-platform IDEs for Force.com
What does this mean? Well, the APIs that have historically provided the functionality for the TextMate & Sublime Text plugins have been rewritten in Python and “frozen” to run as executables on OSX, Linux, and Windows. The Sublime Text plugin has been rewritten to utilize the new executables.

There are two executables packaged with MavensMate: mm and mmserver. mm is the more interesting of the two. mm provides a JSON API that wraps Salesforce.com APIs like the Metadata API, Apex API, Partner Web Services API, and Tooling API and makes it easy for developers to write IDEs with rich functionality. Here’s an example of a request a developer may make to mm to create a new project:

$ mm -o new_project <<< 'json_request_body_here'

# json request body
{
	"project_name" 		: "myproject",
	"username" 		: "[email protected]",
	"password" 		: "foo123",
	"package" 		: [
		"ApexClass" 	: "*",
		"ApexComponent" : ["MyComponent1", "MyComponent2"]
	]
}

# json response body
{
    "success" : true,
    "body"    : "Your operation completed successfully" 
}

The power of mm is that it abstracts many of the difficult aspects of developing an IDE like file system interaction, secure password storage, etc. and provides easy-to-use endpoints for commonly used operations. For example, the new_project operation:

  1. retrieves the metadata requested in the “package” definition in the JSON request
  2. stores the password in the secure store (Keychain in OSX)
  3. retrieves and stores debug logs
  4. stores api session information locally
  5. puts the project directory in the workspace

A full list of operations supported by mm can be found in the README.

For more information about MavensMate, please visit the GitHub project page.

Why the move from Ruby to Python?
To many, the answer to this question may be obvious (especially if you are in the group that had difficulty installing MavensMate). Ruby is simply not built for ease of distribution. Rubygems can be awfully difficult to manage and rvm is certainly not always straightforward either. And for the vast majority of MavensMate users, running a Ruby environment is simply not high on their list of things to do.

Python, on the other hand, is quite fantastic when it comes to distribution. We’re using a tool called PyInstaller to “freeze” the Python code that comprises MavensMate so that it may be run cross-platform WITHOUT users needing specific modules installed or even Python installed. That’s pretty powerful stuff, especially when combined with the power of the Python language itself.

MavensMate now “supports” Windows and Linux
OK, why is “supports” in quotes? Well, the MavensMate APIs are written to be cross-platform, however, we have not focused our efforts on building the mm and mmserver executables for use on Windows and Linux. So, we’re looking for some talented developers to utilize PyInstaller (or another similar tool) to build MavensMate for Windows and Linux. This shouldn’t be a difficult task, we simply have not had the time to dedicate to it. If you’re interested in assisting us with these tasks, please let us know.

OK, so what now?
Well, if you’re keen to jump in and start using the newest version of the Sublime Text plugin, you’ll need to download MavensMate.app, place it in /Applications, and install the Sublime Text plugin:

plugin

Is Sublime Text 3 supported?
Sublime Text 3 support is scheduled for release in the very near future.
Yes, Sublime Text 3 is supported. Use the “Plugins” panel in MavensMate.app to install.