0

I am (still) new to ClojureScript an understand the browser repl makes use of an iframe. I am trying to introduce the ClojureScript application in an existing app and it would be convenient to add the generated JavaScript to in the head of the document. Doing so unfortunately breaks clojure.browser.repl/connect trying to add the iframe to an undefined parent element in goog.net.xpc.CrossPageChannel.prototype.createPeerIframe.

Is there a reasonable approach to make the compiled JavaScript work when you put the script element in the head of the document?

Andreas Steffan
  • 6,039
  • 2
  • 23
  • 25
  • Can you provide more details about your problem? [Austin](https://github.com/cemerick/austin) browser REPL [example](https://github.com/cemerick/austin/tree/master/browser-connected-repl-sample) works great. In `index.html` single `script` tag is child of the `head` tag. – Jarlax Feb 01 '15 at 15:48
  • Interesting. Thanks for pointing it out. I started working trough https://github.com/magomimmo/modern-cljs and those pages (e.g. ``shopping-dbg.html``) break in ``connect`` when you move the script element in the head. – Andreas Steffan Feb 01 '15 at 15:56

1 Answers1

0

You might be interested in https://github.com/tomjakubowski/weasel as an alternative for your browser repl needs. Instead of using iframes, it uses WebSockets. You shouldn't have to worry about script element placement as long as dependencies are run in order.

alvinfrancis
  • 454
  • 3
  • 5