Quantcast
Viewing all articles
Browse latest Browse all 3491

Production JS not right when creating simple "myapp" example...

... as described on the stealjs site:  http://bitovi.com/blog/2010/09/stealjs-script-manager.html

Using: OSX 10.8.2, Java 1.6.0_43, Rhino 1.7 release 1 2008 03 06 , Rhino 1.7 release 4 2012 06 18
EDIT: I installed the latest version of Rhino.  Still the same error as before... (see below)

I am trying to create a simple "myapp".  The only thing I have changed from the example is the name of the app... which I am calling "testapp".  I cloned the current stealjs repository and ran the following command successfully:
  1. ./js steal/generate/app testapp

I then ran the build... successfully:
  1. ./js testapp/scripts/build.js

The "dev" version of the app works, and here is the javascript in the root "testapp.js".  Take special note that ./testapp.coffee should run after the styles and scripts have been loaded:

  1. steal( './testapp.css',       
  2.        'testapp/plugin',
  3.   'steal/coffee')
  4. .then( './testapp.coffee' );

However, in the production.js , the compiled coffee script gets call()ed above the rest of the code, which causes an error because it relies on a function defined in plugin.js  (which comes lower in the code).  

EDIT: Using the latest version of Rhino, the compiled coffee script appears at the bottom of production.js as you would expect.  However, I am still getting the same error as before - a function is not yet defined.

You can see an example of the of the dev and production app here:


Again, I have made no customizations to my environment, stealjs, or the generated code.  The only thing I have done is beautified the production.js file and created a testapp.prod.html file so that you can see a live example of the code working and not working.

Viewing all articles
Browse latest Browse all 3491

Trending Articles