You have to import the google closure library when compiling without
optimisation.

Given your build, probably something like this:

<script type="text/javascript"
src="public/javascript/goog/base.js"></script>

Just make sure the base.js file is actually there.

Jonathan



On Tue, May 7, 2013 at 10:54 PM, Timothy Washington <twash...@gmail.com>wrote:

> That's an interesting tweak. Indeed, I no longer have any of my contents
> in main.js. But I also get a JS error in my browser.
>
>
> goog.provide('edgar');
>  Uncaught ReferenceError: goog is not defined
> goog.require('cljs.core');
> goog.require('shoreleave.remotes.http_rpc');
> goog.require('clojure.browser.repl');
> shoreleave.remotes.http_rpc.remote_callback.call(null,"\uFDD0'heartbeat",
> cljs.core.PersistentVector.fromArray(["heartbeat"], true),(function (
> p1__2853_SHARP_){
> return alert(p1__2853_SHARP_);
> }));
>
>
> *my-file.js*
>
> Same thing happens in main.js
>
> goog.addDependency("base.js", ['goog'], []);
>  Uncaught ReferenceError: goog is not defined
> goog.addDependency("../cljs/core.js", ['cljs.core'], ['goog.string',
> 'goog.array', 'goog.object', 'goog.string.format',
> 'goog.string.StringBuffer']);
> goog.addDependency("../clojure/browser/event.js", ['clojure.browser.event'
> ], ['cljs.core', 'goog.events.EventType', 'goog.events.EventTarget',
> 'goog.events']);
> ...
> goog.addDependency("../shoreleave/remotes/http_rpc.js", [
> 'shoreleave.remotes.http_rpc'], ['cljs.core', 'shoreleave.remotes.xhr',
> 'cljs.reader']);
> goog.addDependency("../edgar.js", ['edgar'], ['cljs.core',
> 'clojure.browser.repl', 'shoreleave.remotes.http_rpc']);
>
>
> *main.js *
>
>
> Hmm
> Tim
>
>
> On Tue, May 7, 2013 at 4:37 PM, Jonathan Fischer Friberg <
> odysso...@gmail.com> wrote:
>
>> *DON'T DO IT*
>>
>> I just realised, if the :optimizations missing triggers this
>> behaviour, it should be possible to set it to nil, and it was!
>>
>> So try ':optimizations nil' in your build.
>>
>> Jonathan
>>
>>
>> On Tue, May 7, 2013 at 10:20 PM, Jonathan Fischer Friberg <
>> odysso...@gmail.com> wrote:
>>
>>> I tried it, and I think removing the :optimizations flag will do
>>> what you want. The problem is that cljsbuild sets it to :whitespace
>>> by default, so even if you remove it from your build it's still there.
>>>
>>> To circumvent this, I opened lein-cljsbuild-0.3.0.jar in
>>> ~/.m2/repository/lein-cljsbuild/lein-cljsbuild/0.3.0/
>>> In the jar, in the file leiningen/cljsbuild/config.clj I changed the
>>> function
>>>
>>> (defn- default-compiler-options [target-path]
>>>   {:output-to (in-target-path target-path "main.js")
>>>    :optimizations :whitespace
>>>    :warnings true
>>>    :externs []
>>>    :libs []
>>>    :pretty-print true})
>>>
>>> to
>>>
>>> (defn- default-compiler-options [target-path]
>>>   {:output-to (in-target-path target-path "main.js")
>>>    :warnings true
>>>    :externs []
>>>    :libs []
>>>    :pretty-print true})
>>>
>>> (just removing the :optimizations)
>>>
>>> and put it back in the jar. Which had the effect which I think you
>>> want, If I understand you correctly.
>>>
>>> I hope these instructions are clear enough. :)
>>>
>>> Jonathan
>>>
>>>
>>>
>>> On Tue, May 7, 2013 at 10:06 PM, Timothy Washington 
>>> <twash...@gmail.com>wrote:
>>>
>>>> Hey Jonathan,
>>>>
>>>> Saw that flag, and it's useful. But what I want to do is separate my
>>>> main.js from all my other.js files. I've a more detailed description
>>>> abouve. Maybe I just can't do this, but I thought I'd ask around.
>>>>
>>>>
>>>> Tim
>>>>
>>>>
>>>> On Tue, May 7, 2013 at 4:03 PM, Jonathan Fischer Friberg <
>>>> odysso...@gmail.com> wrote:
>>>>
>>>>> From the sample.project.clj:
>>>>>
>>>>> ; Determines whether the temporary JavaScript files will be left in
>>>>> place between
>>>>> ; automatic builds. Leaving them in place speeds up compilation
>>>>> because things can
>>>>> ; be built incrementally. This probably shouldn't be disabled except
>>>>> for troubleshooting.
>>>>> ; Defaults to true.
>>>>> :incremental true
>>>>>
>>>>>
>>>>> So it seems like you don't have to worry about it. :)
>>>>> cljsbuild does it automatically.
>>>>>
>>>>> Jonathan
>>>>>
>>>>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to