cram issue with questionsmark in define section (dojo)

23 views
Skip to first unread message

Daniel Haag

unread,
Feb 25, 2013, 10:09:12 AM2/25/13
to cuj...@googlegroups.com
If you xpecify a dependency on dojo/Deferred and dojo/request/watch cram removes dependencies. It seems that it is not able to handle /has with questionmarks. It results in has!0

I found this issue when depending on the following files /Deferred and /request/watch
 
Do I miss some configuration to be able to handle this pattern or is this an issue in cram. I am currently on the cram-dev version 

Regards, 

Daniel

Origninal Deferred
define([
        "./has",
        "./_base/lang",
        "./errors/CancelError",
        "./promise/Promise",
        "./has!config-deferredInstrumentation?./promise/instrumentation"
], function(has, lang, CancelError, Promise, instrumentation){
 
Deferred after cram
define('dojo/Deferred', ['dojo/has', 'dojo/_base/lang', 'dojo/errors/CancelError', 'dojo/promise/Promise', 'dojo/has!0'], function (has, lang, CancelError, Promise, instrumentation) {
 
 
 
 
Original watch.js
define([
        './util',
        '../errors/RequestTimeoutError',
        '../errors/CancelError',
        '../_base/array',
        '../has!host-browser?../_base/window:',
        '../has!host-browser?dom-addeventlistener?:../on:'
], function(util, RequestTimeoutError, CancelError, array, win, on){
 
Watch.js after cram
;define('dojo/request/watch', ['dojo/request/util', 'dojo/errors/RequestTimeoutError', 'dojo/errors/CancelError', 'dojo/_base/array', 'dojo/has!0', 'dojo/has!0'], function (util, RequestTimeoutError, CancelError, array, win, on) {

unscriptable

unread,
Feb 25, 2013, 11:20:02 AM2/25/13
to cuj...@googlegroups.com
Hey Daniel, "smart" has.js handling is on the short list of features to add to cram.js. It looks like cram.js is running dojo/has at build time, which is what it *should* do by default since you typically want to resolve plugins at build time, if possible.  

Of course, there are situations when you may want cram to defer has! checks until run time.  There is no way to defer has! checks in cram, at the moment.

Are you providing a "has profile"?  This would fix the problem by providing the target user agent profile (set of pre-run tests) you wish to build against.

-- John
Reply all
Reply to author
Forward
0 new messages