[dojo-contributors] dojo-sie

Rawld Gill rcgill at earthlink.net
Thu Oct 21 14:19:37 EDT 2010


Inline

> -----Original Message-----
> From: dojo-contributors-bounces at mail.dojotoolkit.org [mailto:dojo-
> contributors-bounces at mail.dojotoolkit.org] On Behalf Of Ben Hockey
> Sent: Thursday, October 21, 2010 8:16 AM
> To: dojo-contributors at mail.dojotoolkit.org
> Subject: [dojo-contributors] dojo-sie
> 
> it was exciting to see dojo-sie added to trunk yesterday.  thanks rawld for
> your work on this.
> 
> even though i haven't been at the weekly meetings, i've been trying to follow
> along with the transcripts to keep up with what's happening but i still have
> some questions.  some of these may have been touched on briefly in the
> weekly meetings but perhaps this will give an opportunity for some more
> detailed explanations.  if there is some documentation that already covers
> any of this then feel free to just point me to it - btw, this is not meant to be a
> backhanded way of saying "where's the docs?"
> 
> the first 2 questions are directed generally to the group rather than rawld
> directly.
> 
> -  is it intended that dojo-sie.js becomes dojo.js so that existing projects
> would get the new loader by default?

It is not intended that dojo-sie.js become dojo.js.

The entire dojo-sie project, including dojo-sie, are simply bleeding edge enhancements to dojo that I need for my projects. I intend these enhancements to be 100% API compatible with dojo 2.0. I am working with Eugene on 2.0 base (which is where most of the enhancements in dojo-sie occur) to push/pull these enhancements to/from dojo 2.0 base. In this sense, one could consider dojo-sie a public, preview look at dojo 2.0. Because it's bleeding edge, I make no guarantees to dojo-sie other than it's going to loosely follow dojo 2.0 until dojo 2.0 is frozen, at which point it will be exactly dojo 2.0 and go away.

 * It is a way for "average users" to grab a complete dojo/dijit with new stuff (like asyn loader, new bootstrap).

 * It is *NOT* a branch.

 * It will be taken down and removed from the web after dojo 2.0.

It is my understanding regarding the loader:

1. The dojo 1.x branch will retain (a) the current sync loader as a default, (b) the current xdomain loader, (c) the current build system--forever.
2. dojo 1.6 will be released with modules that are compatible with an async loader; 1.a, 1.c are modified to handle this transparently; 1.b does not change.
3. dojo 1.7 will contain (directly or by reference) officially sanctioned async loader(s).

I don't know the time frame for dojo base and boot enhancements or what will land in the 1.x branch, 2.0 branch, or both.

> 
> - it seems that the bootstrap (code which specifically loads dojo base) and
> the loader (the mechanism to load stuff) are combined in dojo-sie.js.  

This is configurable by simply setting configuration switches (the vars at lines 871, 977 in http://github.com/rcgill/dojo-sie/blob/master/dojo/dojo-sie.js are configurable). This is documented yet. Look for docs soon.

> is there
> any intention to try and separate these 2 so that a different loader could be
> used with very little effort and minimal overhead?  for example,
> dojo/_base.js might contain the bootstrap code which assumes "require"
> and "define" already exist.  if a developer included dojo/dojo.js in their page
> (assuming dojo-sie.js becomes dojo.js) then that would include the default
> loader and automatically load dojo/_base.js.  however, if a developer
> wanted to use a different loader then they would use that loader to load
> dojo/_base.js and the net result should be basically the same as if they had
> included dojo/dojo.js.

In 1.x, dojo.js will always include the dojo 1.x sync loader.

Hopefully by 1.7, you will have the option to script-inject an AMD-conforming loader (http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition), and then use that loader to load dojo asynchronously.

Today you can use dojo-sie or (I think) requireJS has a conversion available for async loading.

> 
> 
> - rawld, is there a way to change configuration options (eg v1xGlobals,
> loaderOnly, etc) during development?

In the html doc:
var require= {
  config: {
    v1xGlobals: false,
    loaderOnly: true
  }};
<script type="text/javascript" src="dojo-sie.js"></script>


> 
> as i make more of an attempt to use this in my current work, i'll probably
> have some more questions.  to give some background on my use case, part
> of my current project includes building a widget/application that will live in
> other people's pages.  loading dojo anonymously (ie without globals) is
> something i'll be looking at closely since the widget could potentially be
> included in a page that already uses dojo.  also, i *might* consider that if a
> loader already exists in the page (ie "require" and "define" already exist as
> globals) then i'll just "require" the bootstrap (dojo/_base.js) rather than
> manually inject the loader (dojo/dojo.js).
> 
> also, sorry if i'm asking questions which were covered somewhere else but
> i've looked and haven't found definitive answers to these questions.
> 

These are all great questions. One big caution: I think dojo/dijit may have some problems if you take dojo/dijit out of the global namespace.

I have an article coming out on this soon. Feel free to email me directly at rgill at altoviso.com and I'll try to help if it's a project-specific issue. If it's dojo-related, we can talk on this list so everybody can learn and/or disagree.

> thanks,
> 
> ben...

Best,
Rawld




More information about the dojo-contributors mailing list