ben hockey | 30 Jun 2011 22:48
Picon
Gravatar

dojo/date/locale outside of the browser

i've been looking into the possibility of getting dojo/date/locale 
working outside of the browser.  unfortunately, it's dependency chain is 
tied to dojo/_base/window which references `window` directly when 
defining dojo.doc.  the chain to dojo/_base/window is like this:
     dojo/date/locale -> dojo/cldr/supplemental -> dojo/i18n -> 
dojo/_base/xhr -> dojo/dom-form -> dojo/dom -> dojo/_base/window

i've come up with 2 possible solutions to avoid this direct reference to 
window

option 1
=====
guard the reference to window with has("host_browser") and update 
dojo/_base/window to have a dependency on has and change the declaration 
of dojo.doc to be
     dojo.doc = has("host-browser") && window["document"] || null;

option 2
=====
break the chain of dependencies leading to the window reference by 
preventing dojo/i18n from pulling in dojo/_base/xhr when not in the 
browser.  afaik, dojo/i18n only pulls in dojo/_base/xhr to support 
legacy i18n packages in the browser, maybe we could change that 
dependency to be "dojo/has!host-browser?./_base/xhr" or some other has 
test if there's a more appropriate one?

i also explored the possibility of ways to break dojo/_base/xhr -> 
dojo/dom-form or breaking dojo/dom-form -> dojo/dom but those look like 
dead ends.

(Continue reading)

Adam L. Peller | 1 Jul 2011 01:39
Gravatar

Re: dojo/date/locale outside of the browser

IIRC, not only did dojo/date/locale used to work in Rhino tests, but xhr did as well.  Would it make sense to have xhr operate independent of the browser also?  That would probably cover a lot more codepaths than dojo.i18n.


-Adam


On Thu, Jun 30, 2011 at 4:48 PM, ben hockey <neonstalwart <at> gmail.com> wrote:
i've been looking into the possibility of getting dojo/date/locale
working outside of the browser.  unfortunately, it's dependency chain is
tied to dojo/_base/window which references `window` directly when
defining dojo.doc.  the chain to dojo/_base/window is like this:
    dojo/date/locale -> dojo/cldr/supplemental -> dojo/i18n ->
dojo/_base/xhr -> dojo/dom-form -> dojo/dom -> dojo/_base/window

i've come up with 2 possible solutions to avoid this direct reference to
window

option 1
=====
guard the reference to window with has("host_browser") and update
dojo/_base/window to have a dependency on has and change the declaration
of dojo.doc to be
    dojo.doc = has("host-browser") && window["document"] || null;


option 2
=====
break the chain of dependencies leading to the window reference by
preventing dojo/i18n from pulling in dojo/_base/xhr when not in the
browser.  afaik, dojo/i18n only pulls in dojo/_base/xhr to support
legacy i18n packages in the browser, maybe we could change that
dependency to be "dojo/has!host-browser?./_base/xhr" or some other has
test if there's a more appropriate one?


i also explored the possibility of ways to break dojo/_base/xhr ->
dojo/dom-form or breaking dojo/dom-form -> dojo/dom but those look like
dead ends.

any thoughts or opinions about whether the goal of using
dojo/date/locale outside of the browser is worth pursuing and which
option is preferred for moving forward?

thanks,

ben...
_______________________________________________
dojo-contributors mailing list
dojo-contributors <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors

_______________________________________________
dojo-contributors mailing list
dojo-contributors <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
Ben Hockey | 1 Jul 2011 02:03
Picon
Gravatar

Re: dojo/date/locale outside of the browser

Sounds reasonable but I couldn't see how to cleanly separate the formToObject stuff ie the dojo/dom-form dependency.  If it can be done then I agree it's better.

ben...

Sent from my Palm Pre on AT&T

On Jun 30, 2011 19:51, Adam L. Peller <adam <at> peller.org> wrote:

IIRC, not only did dojo/date/locale used to work in Rhino tests, but xhr did as well.  Would it make sense to have xhr operate independent of the browser also?  That would probably cover a lot more codepaths than dojo.i18n.

-Adam


On Thu, Jun 30, 2011 at 4:48 PM, ben hockey <neonstalwart <at> gmail.com> wrote:
i've been looking into the possibility of getting dojo/date/locale
working outside of the browser.  unfortunately, it's dependency chain is
tied to dojo/_base/window which references `window` directly when
defining dojo.doc.  the chain to dojo/_base/window is like this:
    dojo/date/locale -> dojo/cldr/supplemental -> dojo/i18n ->
dojo/_base/xhr -> dojo/dom-form -> dojo/dom -> dojo/_base/window

i've come up with 2 possible solutions to avoid this direct reference to
window

option 1
=====
guard the reference to window with has("host_browser") and update
dojo/_base/window to have a dependency on has and change the declaration
of dojo.doc to be
    dojo.doc = has("host-browser") && window["document"] || null;


option 2
=====
break the chain of dependencies leading to the window reference by
preventing dojo/i18n from pulling in dojo/_base/xhr when not in the
browser.  afaik, dojo/i18n only pulls in dojo/_base/xhr to support
legacy i18n packages in the browser, maybe we could change that
dependency to be "dojo/has!host-browser?./_base/xhr" or some other has
test if there's a more appropriate one?


i also explored the possibility of ways to break dojo/_base/xhr ->
dojo/dom-form or breaking dojo/dom-form -> dojo/dom but those look like
dead ends.

any thoughts or opinions about whether the goal of using
dojo/date/locale outside of the browser is worth pursuing and which
option is preferred for moving forward?

thanks,

ben...
_______________________________________________
dojo-contributors mailing list
dojo-contributors <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors

_______________________________________________
dojo-contributors mailing list
dojo-contributors <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
ben hockey | 1 Jul 2011 15:34
Picon
Gravatar

Re: dojo/date/locale outside of the browser

i just committed http://bugs.dojotoolkit.org/changeset/25690 which changes the "./_base/xhr" dependency to be "./has!dojo-v1x-i18n-Api?./_base/xhr" which is the same has option used to bracket the code that uses the xhr dependency.  all the tests still pass.  let me know if there are any objections.

thanks,

ben...

On 6/30/2011 7:39 PM, Adam L. Peller wrote:
IIRC, not only did dojo/date/locale used to work in Rhino tests, but xhr did as well.  Would it make sense to have xhr operate independent of the browser also?  That would probably cover a lot more codepaths than dojo.i18n.

-Adam


On Thu, Jun 30, 2011 at 4:48 PM, ben hockey <neonstalwart <at> gmail.com> wrote:
i've been looking into the possibility of getting dojo/date/locale
working outside of the browser.  unfortunately, it's dependency chain is
tied to dojo/_base/window which references `window` directly when
defining dojo.doc.  the chain to dojo/_base/window is like this:
    dojo/date/locale -> dojo/cldr/supplemental -> dojo/i18n ->
dojo/_base/xhr -> dojo/dom-form -> dojo/dom -> dojo/_base/window

i've come up with 2 possible solutions to avoid this direct reference to
window

option 1
=====
guard the reference to window with has("host_browser") and update
dojo/_base/window to have a dependency on has and change the declaration
of dojo.doc to be
    dojo.doc = has("host-browser") && window["document"] || null;


option 2
=====
break the chain of dependencies leading to the window reference by
preventing dojo/i18n from pulling in dojo/_base/xhr when not in the
browser.  afaik, dojo/i18n only pulls in dojo/_base/xhr to support
legacy i18n packages in the browser, maybe we could change that
dependency to be "dojo/has!host-browser?./_base/xhr" or some other has
test if there's a more appropriate one?


i also explored the possibility of ways to break dojo/_base/xhr ->
dojo/dom-form or breaking dojo/dom-form -> dojo/dom but those look like
dead ends.

any thoughts or opinions about whether the goal of using
dojo/date/locale outside of the browser is worth pursuing and which
option is preferred for moving forward?

thanks,

ben...
_______________________________________________
dojo-contributors mailing list
dojo-contributors <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors

_______________________________________________ dojo-contributors mailing list dojo-contributors <at> mail.dojotoolkit.org http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors
_______________________________________________
dojo-contributors mailing list
dojo-contributors <at> mail.dojotoolkit.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-contributors

Gmane