Plugins You can find out about all the publicly available Grails plugins.

Sencha Grails Asset Pipeline Plugin for Sencha Applications

  • Tags: assets
  • Latest: 1.0.2
  • Last Updated: 05 August 2014
  • Grails version: 2.0 > *
0 vote
Dependency:
compile "org.grails.plugins:sencha-grails-asset-pipeline:1.0.2"

 Documentation  Issues

Summary

"Sencha Grails Asset Pipeline Plugin that understands how to order dependencies in Sencha applications. Requires asset-pipeline version 1.8.9 or higher.

Installation

compile ':sencha-grails-asset-pipeline:1.0.0'

Description

Note: This plugin requires asset-pipeline version 1.8.9 or higher.

What It Does

This plugin can handle JavaScript files as well as CoffeeScript (via the bundled coffee-asset-pipeline plugin ). It parses the files in your Ext JS application folder (and subfolders) and builds a mapping of file names to Sencha class names, as well as what other files each file requires.

It will:

  • Handle arrays of class names declared in the requires: property of a class.
  • When using CoffeeScript, it should properly handle arrays using commas or arrays that omit commas by defining each element on a separate line.
  • Implicitly require any class name declared in the extend: or override: property of a class.
  • Require class names declared using Ext.require() and Ext.syncRequire(). (Note that required class names must be declared inline, and cannot be a variable, as there is no way to evaluate what the runtime value of the variable will be.)
  • Require the correct file(s) even when using an alternate class name (defined in the alternateClassName: array in a class).
  • Determine the correct required files even when multiple classes are defined in a single file.
  • It should even handle classes required by the @require() Sencha Cmd annotation.

Configuration

Other than installing the plugin, the only other config option is to set a grails.assets.sencha.appRootPath in your Config.groovy file. This lets the plugin know what your Sencha application's root is. It's a relative path from your assets/javascripts folder.

For example, if your app is located at grails-app/assets/javascripts/app then you'd set this config option to:

grails.assets.sencha.appRootPath = 'app'

By default, it will treat your assets/javascripts folder as the app root.