closurebuilder, uncompiled dev environment

69 views
Skip to first unread message

dali

unread,
May 22, 2013, 6:35:51 PM5/22/13
to closure-lib...@googlegroups.com
The closurebuilder tool has its doc here:

The section "Resolving Closure Library Dependencies" shows how to create a sequentially correct .js file list but isn't very explicit about how to use the list.

I think I have resolved this but am noting my solution here for feedback. It would probably be nice to have more explicit guidance in the documentation as well, for the other beginners out there :).
The solution seems to be to just enclose all the resulting .js files into script tags and add them to the html file...

Also, maybe it's worthwhile mentioning that I was initially puzzled by a strange error:

TypeError: childCtor is undefined

function tempCtor() {};
 (base.js line 1468)
TypeError: this.stopEvent is not a function
(field.js line 136)

It turned out this was due to a 
goog.inherits(value_with_a_typo, goog.editor.SeamlessField);
statement... also noting this here in case anyone else out there googles this error and needs the needle from the haystack.

James Deyerle

unread,
May 22, 2013, 6:54:41 PM5/22/13
to closure-lib...@googlegroups.com
You shouldn't need to put all your JS files in script tags.  Let closure do that for you with goog.require.
For raw, uncompiled JS, I first run this script to create a deps.js file as output:

..\closure\bin\calcdeps.py ^
  --output_file=..\war\generated\deps.js ^
  -o deps ^
  -p ..\js_src\ ^
  -p ..\js_generated\ ^
  -p ..\closure\

My dev HTML file looks like this:

<!DOCTYPE HTML>
<html>
  <head>
    <script src="/closure/goog/base.js"></script>
    <script src="/generated/deps.js"></script>
    <script>
      goog.require('your.root.namespace');
    </script>
  </head>
  <body>
    <script>
      your.root.namespace.doSomething();
    </script>
  </body>
</html>

Hope this helps!
James

P.S.  For your goog.inherits issue, the closure compiler should catch it I think.


--
 
---
You received this message because you are subscribed to the Google Groups "Closure Library Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to closure-library-d...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Daniel Steigerwald

unread,
May 22, 2013, 7:05:48 PM5/22/13
to closure-lib...@googlegroups.com
Or use dev stack like http://github.com/Steida/este.
Sorry for advertisiment, but I created it also to ease starting with Google Closure Tools.
You can, and definitely should, automatize all that boring tasks. Otherwise you will hate Closure Tools.

Rhys Brett-Bowen

unread,
May 23, 2013, 12:06:52 PM5/23/13
to closure-lib...@googlegroups.com

dali

unread,
May 27, 2013, 4:23:03 AM5/27/13
to closure-lib...@googlegroups.com
alright thanks ;)
so depswriter.py is the successor of calcdeps.py..
Reply all
Reply to author
Forward
0 new messages