Using streamline with rails and not node?

10 views
Skip to first unread message

Benjamin Wheeler

unread,
Feb 18, 2015, 1:06:15 PM2/18/15
to stream...@googlegroups.com
I'm trying to figure out how to take some streamline-compiled js code, which attempts to require the streamline runtime, and execute that code in a client's browser.

I'm not running node, so maybe I'm not approaching this in the standard way... I'm running into issues like not having the exports variable already defined. Is what I'm trying possible?

Does anyone have any examples of streamline-compiled js code running in a browser with minimal extra frameworks?

Thanks!

Bruno Jouhier

unread,
Feb 18, 2015, 3:26:29 PM2/18/15
to stream...@googlegroups.com
Hi Benjamin,

There are some examples on github (examples/streamlineMe and test/common/callbacks). 

The easiest way is to compile with the --standalone option (see lib/compiler/build.sh for some examples). This will include the runtime files into the generated .js. If you load several scripts in the same page you only need the first one to be compiled with --standalone.

I already answered through a different channel but I'm posting here too. I'd rather follow up on this mailing list.

Bruno


--
You received this message because you are subscribed to the Google Groups "streamline.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to streamlinejs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Benjamin Wheeler

unread,
Feb 18, 2015, 5:21:18 PM2/18/15
to stream...@googlegroups.com
sweet, following the lead from examples/streamlineMe works! thanks! 

my mistake was that i was looking at the source for
http://sage.github.io/streamlinejs/examples/streamlineMe/streamlineMe.html
... which is out of date!

--standalone didn't work for me, fyi... js complaint was unexpected
token illegal, hard to pin down what the issue is. perhaps the
relative paths for the various require statements don't work?

Reply all
Reply to author
Forward
0 new messages