Tuesday, June 25, 2013

Custom Packages

We all want some form of customization in our web projects and, in many cases, customization is crucial to the success of an application. Today we're announcing F2 version 1.2.1 will not only provide developers the ability to create custom packages of the F2.js SDK but also include four pre-compiled copies of F2.

In providing AMD support for v1.1, we bundled jQuery and Bootstrap (modal) javascript into F2's closure. This move afforded Container Developers the ability of deploying F2 in any environment without worry about competing frameworks (i.e., jQuery vs Prototype JS). Additionally, this update kept F2's internal version of jQuery from leaking out to the window and conflicting with a different version of jQuery on the container. The biggest benefit was that F2 became instantly portable and (external) dependency-free. Developers simply had to include F2.js in a script tag and call F2.init().

Over the past couple of months, we've heard these features weren't always needed when building an F2-enabled web application. For example, if a container is already using a relatively new version of jQuery, F2 certainly didn't to include its own copy as well. If a Container Developer didn't need secure or sandboxed apps or wasn't using F2.UI, both the easyXDM and Bootstrap modal libraries could be excluded, too.

In F2 version 1.2, an all-new toolkit was introduced for developers, and one of the additions was the use of Grunt to build the framework. Grunt is a Node.js-based task runner for automating development processes such as combining, minifying, testing, js linting or copying files. Since Grunt makes it simple, adding 4 new packages was as easy as defining which files to concatenate and compress. Developers can clone the F2 repo and now define their own packages, too. We'll save all the details for the documentation updates coming in 1.2.1. In the meantime, a preview of just one of the four packages is the most basic version of F2 developers can get their hands on. F2.basic.js is a tiny 7.4kb (minified and gzipped) and offers a 27kb reduction in file size while maintaining 90% of the API coverage.

Keep an eye on the pull request tracking comments and commits for 1.2.1 and let us know if you have any feedback.

No comments:

Post a Comment