Skip to content

Commit

Permalink
updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebecca Murphey committed Mar 20, 2011
1 parent 9b427ec commit 902f3ac
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 41 deletions.
42 changes: 13 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ dojo-boilerplate
================

The Dojo Boilerplate is a set of files to help you rapidly get up and running
with the Dojo Toolkit. It illustrates some basic best practices when
working with Dojo, and includes a build system that uses
[RequireJS](http://requirejs.org) for efficient development and tiny, blazing
fast production builds.
with the Dojo Toolkit. It illustrates some basic best practices when working
with Dojo. The master branch uses the standard Dojo build system; if you're
feeling adventurous, there is also a branch that uses AMD modules and is built
using [RequireJS](http://requirejs.org).

Huge thanks go out to [neonstalwart](https://github.com/neonstalwart) for his
original
Expand All @@ -31,40 +31,24 @@ A brief tour

* The boilerplate provides the file `src/js/app/base.js` as the starting point
for your development
* The `src/index.html` file loads the configuration file located at
`src/js/app/_base.js`, which in turn asynchronously loads
`src/js/app/base.js`.
* The `src/index.html` file loads `src/js/app/base.js`; it's up to you to make
this file load anything else your app requires.
* The file `util/build.sh` reads the profile file at `profiles/app.js`, which
contains instructions to RequireJS on how to build the files for production.
The profile instructs RequireJS to create a single file that includes Dojo,
your application's code, and all associated dependencies as specified within
your application's code.
contains instructions to the Dojo build tool on how to build the files for
production. The profile instructs the build tool to create two files: one
that includes a built version of the base Dojo files, and one that includes
all of your application's code and its dependencies.

Useful resources
----------------

* [Dojo Reference Guide](http://dojotoolkit.org/reference-guide/)
* [RequireJS documentation](http://requirejs.org/docs/api.html)

Potential issues
----------------

* Current releases of Dojo don’t include an asynchronous loader. We use
RequireJS as a stand-in until the official loader and build system are
complete. Current discussions suggest that Dojo will ultimately use bdLoad as
its loader; however, it does not presently include a build system. Since both
RequireJS and bdLoad both comply with the CommonJS AMD standard, you will be
ready to go with no changes to your application’s code when the new official
loader is ready. Yay standards!
* Dojo currently uses `dojo.cache` for its widget templates instead of the AMD
`text!` plugin; this means that strings included by widgets using
`dojo.cache` will end up being loaded twice. This has been reported upstream
at [ticket #12383](http://bugs.dojotoolkit.org/ticket/12383).

License
-------

The Dojo Boilerplate is licensed under the [same
terms](http://bugs.dojotoolkit.org/browser/dojo/trunk/LICENSE) as the Dojo Toolkit. Consult
the individual projects (see the Useful resources section above) for additional
licensing information.
terms](http://bugs.dojotoolkit.org/browser/dojo/trunk/LICENSE) as the Dojo
Toolkit. Consult the individual projects (see the Useful resources section
above) for additional licensing information.
11 changes: 6 additions & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<title></title>
<link rel="stylesheet" href="css/app.css">
</head>
<body class="claro">
<body>
<script>
djConfig = {
modulePaths : { app : "../../app" }
};
var _dbpDev = true;
dojoConfig = _dbpDev ? {
modulePaths : { app : dev ? "../../app" }
} : {};
</script>
<script src="js/dojo-release-1.6.0-src/dojo/dojo.js"></script>
<script>dojo.require('app.base');</script>
<script>dojo.require("app.base");</script>
</body>
</html>
12 changes: 8 additions & 4 deletions src/js/app/base.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
dojo.provide('app.base');
dojo.provide("app.base");

dojo.require('dijit.Dialog');
dojo.require("dijit.Dialog");

dojo.addOnLoad(function() {
// add a class to set the dijit theme
dojo.addClass(document.body, "claro");

// create a new dialog
new dijit.Dialog({
title: 'Hello World',
content: 'Loaded successfully!'
title: "Hello World",
content: "Loaded successfully!"
}).placeAt(document.body).show();
});
11 changes: 8 additions & 3 deletions util/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ set -e
DOJOVERSION="1.6.0"

THISDIR=$(cd $(dirname $0) && pwd)
UTILDIR="$THISDIR/../src/js/dojo-release-${DOJOVERSION}-src/util/buildscripts"
SRCDIR="$THISDIR/../src"
UTILDIR="$SRCDIR/js/dojo-release-${DOJOVERSION}-src/util/buildscripts"
PROFILE="$THISDIR/../profiles/app.js"
CSSDIR="$THISDIR/../src/css"
CSSDIR="$SRCDIR/css"
DISTDIR="$THISDIR/../dist"

if [ ! -d "$UTILDIR" ]; then
Expand All @@ -20,7 +21,7 @@ if [ ! -f "$PROFILE" ]; then
exit 1
fi

echo "Building with $PROFILE"
echo "Using $PROFILE. CSS will be copied and JS will be built."

# clean the old distribution files
rm -rf "$DISTDIR"
Expand All @@ -33,3 +34,7 @@ cd "$THISDIR"
# copy the css files
# todo: how to do this better?
cp -r "$CSSDIR" "$DISTDIR/css"

# copy the index.html and make it production-friendly
cp "$SRCDIR/index.html" "$DISTDIR/index.html"
sed -i -e "s/var _dbpDev = true;//" "$DISTDIR/index.html"

0 comments on commit 902f3ac

Please sign in to comment.