Nice work! In the switch to aeson, the old types were just removed from Julius- we should add the aeson types back in now or otherwise make this easier.<br><br><div class="gmail_quote">On Fri, Apr 29, 2011 at 7:32 AM, JP Moresmau <span dir="ltr">&lt;<a href="mailto:jpmoresmau@gmail.com">jpmoresmau@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Right, found it.<br>
<div class="im"><br>
&gt;&gt;&gt; instance (ToJSON a)=&gt; ToJavascript a where<br>
&gt;&gt;&gt;       toJavascript =toJavascript . toJSON<br>
<br>
</div>That used to work but now seems to go into an infinite loop. I&#39;ve<br>
replaced it by:<br>
<div class="im"><br>
instance (ToJSON a)=&gt; ToJavascript a where<br>
</div>       toJavascript =fromLazyText . decodeUtf8  . encode . toJSON<br>
<br>
and everything works again. Not very elegant, have I missed something?<br>
Shouldn&#39;t that instance be part of Yesod somewhere? I mean if we<br>
standardize on Aeson, and we want variables in Javascript, it makes<br>
sense to serialize ToJSON instances in a Julius template.<br>
<font color="#888888"><br>
JP<br>
</font><div><div></div><div class="h5"><br>
On Fri, Apr 29, 2011 at 4:06 PM, JP Moresmau &lt;<a href="mailto:jpmoresmau@gmail.com">jpmoresmau@gmail.com</a>&gt; wrote:<br>
&gt; juliusFile, I&#39;m not running any scaffolded site, I&#39;ve built everything<br>
&gt; with 1s and 0s. (-:<br>
&gt; Changing to juliusFileDebug results in the same behavior.<br>
&gt;<br>
&gt; JP<br>
&gt;<br>
&gt; On Fri, Apr 29, 2011 at 3:56 PM, Michael Snoyman &lt;<a href="mailto:michael@snoyman.com">michael@snoyman.com</a>&gt; wrote:<br>
&gt;&gt; Are you running juliusFile or juliusFileDebug? (The scaffolded site<br>
&gt;&gt; uses the latter by default.)<br>
&gt;&gt;<br>
&gt;&gt; Michael<br>
&gt;&gt;<br>
&gt;&gt; On Fri, Apr 29, 2011 at 4:52 PM, JP Moresmau &lt;<a href="mailto:jpmoresmau@gmail.com">jpmoresmau@gmail.com</a>&gt; wrote:<br>
&gt;&gt;&gt; Hi all,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I&#39;ve just upgraded to Yesod 0.8. I&#39;ve changed all my Strings into<br>
&gt;&gt;&gt; Texts, and all my Data.JSON.Types into Data.Aeson.Types. I use these<br>
&gt;&gt;&gt; JSON objects in julius templates, by adding the orphan instance:<br>
&gt;&gt;&gt; instance (ToJSON a)=&gt; ToJavascript a where<br>
&gt;&gt;&gt;       toJavascript =toJavascript . toJSON<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; (Removing that instance causes compilation error, and I had it when I<br>
&gt;&gt;&gt; was using json-types).<br>
&gt;&gt;&gt; addJulius works fine when it contains Javascript code. However on one<br>
&gt;&gt;&gt; page I use juliusFile to load an external template. This eats all my<br>
&gt;&gt;&gt; memory and never returns under Warp when I launch the compiled exe (I<br>
&gt;&gt;&gt; see &quot;thread killed&quot; messages in the console, though), and in GHCi<br>
&gt;&gt;&gt; crashes with &quot;out of memory&quot;.<br>
&gt;&gt;&gt; The code hasn&#39;t changed and was working fine in yesod 0.7 before the<br>
&gt;&gt;&gt; upgrade. If I remove juliusFile the page displays instantly.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Any idea? I&#39;m a bit stumped. I suppose I&#39;m going to remove each of my<br>
&gt;&gt;&gt; variables in the julius file to narrow it down, but if anybody has any<br>
&gt;&gt;&gt; insight...<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Thanks!<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; --<br>
&gt;&gt;&gt; JP Moresmau<br>
&gt;&gt;&gt; <a href="http://jpmoresmau.blogspot.com/" target="_blank">http://jpmoresmau.blogspot.com/</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; web-devel mailing list<br>
&gt;&gt;&gt; <a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
&gt;&gt;&gt; <a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; JP Moresmau<br>
&gt; <a href="http://jpmoresmau.blogspot.com/" target="_blank">http://jpmoresmau.blogspot.com/</a><br>
&gt;<br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">JP Moresmau<br>
<a href="http://jpmoresmau.blogspot.com/" target="_blank">http://jpmoresmau.blogspot.com/</a><br>
<br>
_______________________________________________<br>
web-devel mailing list<br>
<a href="mailto:web-devel@haskell.org">web-devel@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/web-devel" target="_blank">http://www.haskell.org/mailman/listinfo/web-devel</a><br>
</div></div></blockquote></div><br>