Yeah I think it make sense to mention it in the documentation, it's something every developer will run into. I'd suggest to try and keep our own documentation as short as possible and link out to the requirejs shim doc though, to avoid duplication and help maintenance.<br>
<br>On Saturday, 2 November 2013, Code wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks, Daniel!</div><div>I'd rather use "shim", too.</div>
<div><br></div><div>I think it's a common need to have non-AMD dependencies when building an activity.</div><div>What do you think about finding out a canonical way to achieve this and write it down in "write your own activity" doc?</div>
<div><br></div><div>I'm willing to make a pull-request with the updated doc.</div><div><br></div><div>Thanks again,</div><div>Code</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Nov 1, 2013 at 6:18 PM, Daniel Narvaez <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'dwnarvaez@gmail.com');" target="_blank">dwnarvaez@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think we have been suggesting to use the shim. Modifying loader.js should be fine, the template one shouldn't change often.<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div>On 1 November 2013 22:02, Code <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'iraguet@activitycentral.com');" target="_blank">iraguet@activitycentral.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Hello, list!<div>I'd like to add a non-AMD lib (AngularJS in this case) to my activity.</div>
<div><br>
</div><div>Here only points out how to add AMD ones:</div><div><a href="http://developer.sugarlabs.org/activity.md.html#using%20other%20javascript%20libraries" target="_blank">http://developer.sugarlabs.org/activity.md.html#using%20other%20javascript%20libraries</a><br>
</div><div><br></div><div>Of course there are workarounds like adding script tags (I'd rather not) or setting up the "shim" option from RequireJS config...</div><div><a href="https://github.com/code-sur/web-activity-POC/blob/master/js/loader.js" target="_blank">https://github.com/code-sur/web-activity-POC/blob/master/js/loader.js</a><br>
</div><div><br></div><div>But it seems that I shouldn't be touching the loader.js file, isn't it?</div><div><br></div><div>Is there a standard/preferred way to achieve this?<br></div><div><br></div><div><br></div>
<div>Thanks,</div><div>Code</div><div><br></div><div><br></div><div><br></div></div>
<br></div></div>_______________________________________________<br>
Sugar-devel mailing list<br>
<a href="javascript:_e({}, 'cvml', 'Sugar-devel@lists.sugarlabs.org');" target="_blank">Sugar-devel@lists.sugarlabs.org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/listinfo/sugar-devel</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><br>-- <br>Daniel Narvaez<br>
</font></span></div>
</blockquote></div><br></div>
</blockquote><br><br>-- <br>Daniel Narvaez<br><br>