Menu Developer Moovweb University

SDK v4.0 - August 10, 2012

Major overhaul of Moovweb SDK and Moovweb Cloud.

Changes

Config Folder

The config folder will be completely gone! (We’ve also deleted the lib and test folders plus the MANHATTAN_VERSION and GENERATOR_OPTIONS files.)

The config folder is replaced by a config.json file that will hold the same information (for the most part).

This file contains your user agent, SSL whitelist, your host maps, and various other settings. Read more about it here.

It also contains a setting for whether or not the project supports compass. Do not use compass on new projects. Compass will ultimately be deprecated.

Rewriters

Rewriters will now be called Host Maps.

Also, the syntax is changing … No more regular expressions!

The syntax is now as follows:

"$.cancer.org => www.cancer.org"

This translates to:

http://mlocal.cancer.org and https://mlocal.cancer.org

Rewriters on the left, upstream on the right.

Links work in the opposite direction.

These are located in your config.json file which will be replacing the config folder.

Mixers

Your new project will have a Mixer.lock file. This contains your mixer specification.

What are Mixers?

Tritium has 12-20 native functions, all other functions — which embody the feature-rich and most useful aspects of the Tritium language — are made up of these native functions.

A mixer is essentially a promise that these functions will continue to work the way you want them to work and have worked in the past.

More Details on Mixers

As the language evolves, even the basic Tritium functions can be tweaked whether it’s to provide further functionality, increase performance, or clean up the code, these tweaks can cause rippling effects that break previous code. Enter Mixers.

Mixers are a collection of functions and tests that account for these changes and make sure you code is backwards compatible. The over-arching concept here is to separate the SDK from the inner workings of the server so they can be maintained individually. Your SDK can be upgraded and still rely on old mixers for functionality, and old mixers can be upgraded without breaking your SDK code.

Why do I need to know this?

Mixer Locking: Compiled projects will be locked to certain mixers upon creation. These mixers can then be upgraded using the command:

moov mixer upgrade

What it means for your projects is that they will be versioned using certain mixins and those mixins will determine how your functions behave. These locks can be seen in the Mixer.lock file in the project folder.

The legacy version of the mixers is named omni-mobile and the new projects use simple-mobile.

Auto DNS

This feature is OPT-IN only so you have to add the flag manually if you’d like to have your /etc/hosts file managed automatically.

The flag is as follows:

sudo moov server --auto-hosts

(NB: Do not use sudo on a Windows machine.)

We recommend using this instead of editing your /etc/hosts file. It’s much simpler!

Project Generators

The layout of the project folder will be somewhat different. Mostly it will be a lot cleaner with many of the random files that you never open now removed.

The recipe for generating a mobile site is now as follows:

moov generate [name] [domain] --recipe=mobile

The default layout is the old perfect representation of an existing site. The mobile layout has the styles and JavaScript removed to make re-working the front-end more simple.

Moovweb Cloud

We have a getting started guide on how to use the Moovweb Cloud and a more in-depth tutorial too.

We’ve also got some video instructions on how to use the Moovweb Cloud.

The Deploy Key instructions have been simplified so if you don’t want to add your own SSH keys manually, you can run the command:

moov login

In your terminal and that will add the SSH keys for you.

Deprecation of Compass

Compass is awesome. But we weren’t using it to its full potential in Moovweb projects and it can cause some project-upgrading issues. So, we’ve decided to go with some other tools that perform all the functions we use in Compass:

Bourbon is a set of mixins. They provide cross-browser compatibility and extra functionality for things like making a columnar layout or implementing gradients. Their reference is great, or you can just look through the stylesheets/globals/bourbon directory of your project.

GoSass is an implementation of Sass in Go. The functionality should be exactly the same as Sass. Plus, it includes the image-url() function of Compass.

Spracker is the new way to implement sprites. Just add the images to a sprites folder in the images directory and a sprite will automatically be created. There will also be a sprites.scss stylesheet created in the stylesheet/globals directory. Include this stylesheet in the main.scss file. Then, use the classes and mixins that are defined within like you would with Compass. For more information, look at our guide to spriting.