-
Notifications
You must be signed in to change notification settings - Fork 522
Steal Type API
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:
-
Allow
steal.build
to do its thing without a DOM or DOM substitute. -
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
steal({
build: 'steal/view/foo_build'
}, 'can/util', function(can) {
// definition here
});
steal({
map: {
'can/util': 'can/util/standalone'
}
}, 'can/util', function(can) {
// DOM-less implementation
});