Skip to content
Matthew Phillips edited this page Nov 12, 2013 · 4 revisions

This defines an API which allows for steal to build without needing a DOM. Goals of this API are:

  1. Allow steal.build to do its thing without a DOM or DOM substitute.

  2. Allow the process to be invisible to the end users. Only the type authors need a small additional amount of work to implement their type.

In order to achieve this a module which defines a type needs an alternate implementation that will be run during the build process. The module provides that as part of an options object as the first parameter to the call to steal, which is defined as steal([options,][moduleIdRef...,]definition). So for example, if we have a type foo, it would need 2 implementations

foo.js

steal({
  build: 'steal/view/foo_build'
}, 'can/util', function(can) {
  // definition here
});

foo_build.js

steal({
  map: {
    'can/util': 'can/util/standalone'
  }
}, 'can/util', function(can) {
  // DOM-less implementation
});

In this example foo.js is the base implementation of the foo type. It includes the option build which points to the alternate implementation foo_build.

Clone this wiki locally