-
Notifications
You must be signed in to change notification settings - Fork 522
Steal Type API
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
});
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
.