Skip to content

Upgrade from Muffin 0.1.x to 1.0.0

Yaogang Lian edited this page Oct 3, 2013 · 1 revision

Muffin 1.0.0 is a big update since version 0.1.x. It has a few big design changes including a built-in package manager, a plugin architecture, and as a result, a few breaking changes.

Remember that you don't have to upgrade. You can continue using Muffin 0.1.5 and nothing will change.

$ [sudo] npm install -g muffin.io@0.1.5

Breaking Changes

If you decide to take the time to upgrade to the latest Muffin, here are the breaking changes.

  1. --cdn option has been removed. use assetHost in the config.json file instead. Your maven script might need to write to config.json with the proper settings.
  2. --hash option has been removed. use version in the config.json file instead.
  3. Dependency management has been overhauled. Most of the libraries such as Logger, I18n have been moved to their own repos, and are installed as dependencies. But you don't have to make the change all at once. You can still keep things in libs/ or vendor/, and graudally move to the new paradigm.
  4. There are some small changes to Logger and I18n themselves. Check their repos for more details.
  5. Configuration files have been changed significantly. Now there is a project-level config.json file, which specifies a few project-level settings, such as client directory, server directory, build director and Muffin plugins. There is another config.json file in the client folder, which specifies client settings, such as assetHost, version, aliases and dependencies. Check muffin.io website for the specs of these configuration files.
  6. There is a new way to include module loader and live reload script in index.html. These two files now reside inside Muffin's codebase, since they work intimately with the build process and package manager. This design change makes it easy to include these two scripts. Use <?= include_module_loader() ?> and <?= include_live_reload() ?> in the index.html file.
  7. The liveReload settings in config file has been removed. Muffin now automatically increments the live reload port number if it's already in use.

Also remember that Muffin 1.0.0 uses the latest CoffeeScript, Backbone and jQuery, so you might run into compatibility issues with these new libraries, rather than with Muffin itself.

If you are not sure how things work, create a new project with muffin new <project-name> and examine the project setup, then compare to your existing project. Muffin's source code is small, clean and well-documented, so you can always read the annotated source if you are pulling your hair out.

Clone this wiki locally