Two possible clojurescript errors with accompanying repos

90 views
Skip to first unread message

Jonathon McKitrick

unread,
Mar 27, 2015, 11:44:46 AM3/27/15
to clojur...@googlegroups.com
I've run across two optimization related issues I cannot get past. I followed the advice in 'reporting issues' on the ClojureScript wiki, and I've created 2 simple repos demonstrating the issues. These could be user error, but I've tried to remove anything clouding the issue.

I thought it was a simple externs issue, but I removed jQuery references from this demo, and the error remains.

https://github.com/j-mckitrick/cljs-error-demo-1
https://github.com/j-mckitrick/cljs-error-demo-2

Each repo has a README with steps to reproduce. Any help greatly appreciated.

David Nolen

unread,
Mar 27, 2015, 12:23:55 PM3/27/15
to clojur...@googlegroups.com
First off thank you for putting examples like this together which don't involve any tooling other than ClojureScript itself. This saves me a countless amount of time by eliminating other variables.

Both cases exhibit a subtle kind of user error - you are trying to load the browser REPL in a mode other than :none. This isn't supported, the browser REPL relies fundamentally on loading code dynamically which is not supported in any way whatsoever under any optimization setting other than :none.

The way to avoid this in the future will be :main support under higher :optimizations settings than :none. Won't make it into the next release but no later than the one after that. Until then use the classpath (via :source-paths when using cljsbuild) to configure your dev builds to include code (REPL stuff) you don't want under :simple or :advanced.

David


--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to the Google Groups "ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Erik Price

unread,
Mar 27, 2015, 1:38:07 PM3/27/15
to clojur...@googlegroups.com

This isn’t supported, the browser REPL relies fundamentally on loading code dynamically which is not supported in any way whatsoever under any optimization setting other than :none.

Even an optimization of :whitespace is unsupported?

e

David Nolen

unread,
Mar 27, 2015, 1:41:20 PM3/27/15
to clojur...@googlegroups.com
Nope. We've reached peak option combination support long ago.

Sorry drawing the line at :none. There are few use cases for :simple ever and none of this stuff makes sense under :advanced.

David

Erik Price

unread,
Mar 27, 2015, 2:21:50 PM3/27/15
to clojur...@googlegroups.com

Okay, thanks for answering that.

There are few use cases for :simple ever

You’re probably already aware of this use case for :whitespace, but I’ll mention it anyway: we’re using ClojureScript in a Google Chrome Extension. Because Chrome Extensions require every asset to be individually enumerated in a manifest file (and it’s my understanding that this is also true of Atom Editor plugins), we develop with :whitespace so that we only have to list a single JavaScript file. Developing with an optimization of :none would be great, especially for shaving some extra seconds off our compile times, but we’d have to maintain separate dev/prod versions of the manifest file, and constantly update it with new .js files as they are added to the project.

Maybe there’s some way around this that I’m unaware of?

e

David Nolen

unread,
Mar 27, 2015, 2:28:32 PM3/27/15
to clojur...@googlegroups.com
Ok, browser extensions are a valid use case for desiring :simple.

Would be more than happy to take a patch to make :simple + browser REPL work. As people get more particular about where they want to take ClojureScript we're just going to have to get more patches from the community to go there (and the maintenance work to stay there).

David

jmcki...@gmail.com

unread,
Mar 27, 2015, 2:33:06 PM3/27/15
to clojur...@googlegroups.com
Thanks for taking the time to diagnose and explain.  I'm glad it wasn't a boneheaded user mistake.

So you are saying I can compile different parts of the classpath under different optimization settings, by stacking profiles, I assume?

You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/UPBYggXCcGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.

David Nolen

unread,
Mar 27, 2015, 2:34:46 PM3/27/15
to clojur...@googlegroups.com
This is not a ClojureScript question anymore. Someone else can describe the nitty gritty Lein + cljsbuild details.

David

Erik Price

unread,
Mar 27, 2015, 2:47:39 PM3/27/15
to clojur...@googlegroups.com

Would be more than happy to take a patch to make :simple + browser REPL work. As people get more particular about where they want to take ClojureScript we’re just going to have to get more patches from the community to go there (and the maintenance work to stay there).

Okay, I’ll take a look into what's involved.

e

Jonathon McKitrick

unread,
May 12, 2015, 10:58:15 AM5/12/15
to clojur...@googlegroups.com
On Friday, March 27, 2015 at 12:23:55 PM UTC-4, David Nolen wrote:
> The way to avoid this in the future will be :main support under higher :optimizations settings than :none. Won't make it into the next release but no later than the one after that. Until then use the classpath (via :source-paths when using cljsbuild) to configure your dev builds to include code (REPL stuff) you don't want under :simple or :advanced.

David, what's the status of this feature? I didn't see it in the recent changelogs. Is it still on the roadmap?

David Nolen

unread,
May 12, 2015, 11:38:56 AM5/12/15
to clojur...@googlegroups.com
Still planned, but as always a patch is most welcome.

David

jmcki...@gmail.com

unread,
May 12, 2015, 11:45:16 AM5/12/15
to clojur...@googlegroups.com
I wish I could, but compiler design is over my head....

You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/UPBYggXCcGs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages