Re-compiling orbited.js

19 views
Skip to first unread message

Niklas B

unread,
Sep 10, 2011, 10:07:46 AM9/10/11
to Orbited Discussion
Hi,

I pretty much figured out how to recompile Orbited.js to support the
latest version of js.io. It wasn't easy though. I'm going to push it
into a github project later on, but for now the instructions are:


1. Checkout js.io from github (latest)
2. enter the js_src folder from Orbited 0.8
3. Create a symlink for jsio (js_src/jsio) to the latest js.io/
packages
4. Move orbited.pkg and Orbited.js to the jsio folder
5. cd jsio
6. Run: /path/to/js.io/jsio_compile orbited.pkg -j ./ -o /path/to/
orbited/daemon/orbited/static/Orbited.js -d
7. Install it by python setup.py install
8. Make sure you include our single Orbited.js in the regular folder
of your app

Note:
jsio_compile looks for Orbited.js in ../, which means you might need
to symlink it to the root folder of jsio as well.

You need a new Orbited.js (patched) and orbited.pkg (also patched).

If you want to help test it, give me a message. The only downside is
that I can't figure out how to have the none-compiled Orbited.js in
js.io itself, so now it needs to be a separate file.

Regards,
Niklas

bird sky

unread,
Sep 10, 2011, 11:24:57 PM9/10/11
to orbite...@googlegroups.com
maybe I've found a workground solution for your last problem

"You need a new Orbited.js (patched) and orbited.pkg (also patched).

If you want to help test it, give me a message. The only downside is
that I can't figure out how to have the none-compiled Orbited.js in
js.io itself, so now it needs to be a separate file."

search the compiled Orbited.js
find the string like this:
"./../Orbited.js":{"path":"./../Orbited.js",

and change the first ""./../Orbited.js" to "./Orbited.js"

ant at last it should be like this
"./Orbited.js":{"path":"./../Orbited.js",


I think this is the bug in the jsio_compile with the relativePath process problem. So just a workground solution.


--
You received this message because you are subscribed to the
Orbited discussion group.
To post, send email to
   <orbite...@googlegroups.com>
To unsubscribe, send email to
   <orbited-user...@googlegroups.com>
For more options, visit
   <http://groups.google.com/group/orbited-users>

Niklas B

unread,
Sep 11, 2011, 3:30:07 PM9/11/11
to Orbited Discussion
I tried it live for a while, didn't work out to well. Appears as it
the new jsio has problems with the encoding, sending none-utf8 (i.e
latin-1/none-ascii characters) to the CSP session in Orbited (which
triggers UnicodeDecode errors). Basically Win XP IE 7/8 messes up
characters no matter what.

I've had these issues before on the server side (and I'm doing a lot
of checks due to it) but once I have the time I'll see if I can solve
the underlying issue - i.e javascript sending wrong. But we should
probably have a check in the python CSP as well, since the client can
always send wrong sets and it shouldn't crash python.

Erik Anderson

unread,
Nov 13, 2011, 5:52:47 PM11/13/11
to orbite...@googlegroups.com
Figures, I spent more time than I wanted to trying to figure out how to recompile orbited2 last week.  I think I eventually got to the point where (1) the node.js version was throwing "setDebuggingLevel is not defined in Object {300 lines of code of unknown source}". (2) The js.io included with orbited2 is missing the Magic String that causes any of the dependencies to actually be included in the compiled output, and (3) after making a bunch of semi-random patches (and/or calls to easy_install), I get a version of orbited2.js that contains everything necessary *except* for the ./Orbited2.js module.  That last one is about where I threw up my hands Friday night.  I'm guessing that adding a dependency from Orbited2.js to Orbited2.js is not exactly allowed...

I will take a look at the instructions posted by the OP, it sounds like there may be some files that one has to ask pretty-please to get copies of?  Are these included in a pull request somewhere?

Niklas B

unread,
Nov 17, 2011, 11:28:46 AM11/17/11
to Orbited Discussion
Unfortunately my Orbited.js is for Orbited 0.8 :/

If you want it for inspiration I'll upload it!

Erik Anderson

unread,
Nov 17, 2011, 1:02:04 PM11/17/11
to Orbited Discussion
I suspect that my beef is more with js.io than with orbited2. However
I still haven't found that block of code yet that didn't define
setDebuggingLevel (sp?), so it could be anything at this point.

I'm moderately certain that the current version of js.io cannot be
compiled with the python version though, so I likely need to get the
node.js version running before I get much further.

Or just throw up my hands and "compile" the file using notepad++ and a
bunch of Replace commands...

Niklas B

unread,
Nov 18, 2011, 6:12:29 AM11/18/11
to Orbited Discussion
No you can't use the Python version, it's only for the older versions
of js.io. You need the regular node.js version. Unfortunately for me I
had to modify Orbited.js to be included with node.js.

Could you paste the output here?

Erik Anderson

unread,
Nov 29, 2011, 9:31:37 PM11/29/11
to Orbited Discussion
Okay, managed to get back to this again. As the error message is
rather... lengthy, I've stuffed it into http://pastebin.com/Eh1ZzjVD

I'm likely doing something wrong with the environmental setup here,
I'm familiar with javascript in the browser, but considering what I'm
trying to do I'm starting to wonder what the purpose of "compiling"
does that I can't just do with cut&paste in notepad++. Likely some
minification I'm guessing, but this is getting a bit too difficult for
me not to start asking questions...

Niklas B

unread,
Nov 30, 2011, 3:07:57 AM11/30/11
to Orbited Discussion
Hi,

From what I remember the compiler.js should have a setDebugLevel
function, at least using the latest js.io source from github.

When I compiled Orbited 0.8 js I actually had to modify Orbited.js,
maybe you can find some pointers there.

http://pastebin.com/88Netqi4

Regards,
Niklas

On Nov 30, 3:31 am, Erik Anderson <eri...@teamworkgroup.com> wrote:
> Okay, managed to get back to this again.  As the error message is

> rather... lengthy, I've stuffed it intohttp://pastebin.com/Eh1ZzjVD

Erik Anderson

unread,
Nov 30, 2011, 5:00:56 PM11/30/11
to Orbited Discussion
I think I managed to get things working, mostly by merging my
pyjsiocompile-damaged version with the official downloaded version to
get the features I needed.

I think I just ran into a new brick wall, but this time it's in
Orbited2 rather than js.io so I prob won't get much help in this
thread (use of Orbited2.Connection.send() requires a local variable
named 'id' not defined or passed from anywhere).

It would be very nice if someone could somewhere define such concepts
such as Class, bind, Transport, Protocol, etc. So much of my time is
being spent wandering around the code for instance wondering how to
get a Protocol to use a TCPSocket.

As a side note, i did attempt to recompile my jsio_compile (in case I
had an out-of-date version) with no effect to the posted error.

All the code I have been using is taken off of git master tip.

Niklas B

unread,
Dec 13, 2011, 3:29:51 AM12/13/11
to Orbited Discussion
Erik, I tried the new js.io and compilation is MUCH easier. Could you
try to follow the instructions I posted on
http://groups.google.com/group/orbited-users/browse_thread/thread/4f28f538b109e1e0
?

Regards,
Niklas

Niklas B

unread,
Dec 14, 2011, 2:21:47 AM12/14/11
to Orbited Discussion
Erik, I used the instructions from my previous reply and recompiled
Orbited2.js. I changed the Orbited2.pkg to the following to make this
happen:

{
"root": "./Orbited2",
"externalName": "Orbited2",
"transports": ["csp", "websocket"],
"environments": ["browser"],
"additional_dependancies": [ ]
}

And recompiled (while in js_src) with "jsio compile Orbited2.pkg -o
Orbited2-new.js"

That said, I haven't got an active Orbited2 setup at the moment, but
if you have the time to try I uploaded the new Orbited2.js to:

http://www.snyggastchatten.se/chat/Orbited2-new.js

Please try it out and see if you still get the .Connection.send()
issues, if so I'll setup an Orbited2 and help you debug. Does that
sound OK?

On Dec 13, 9:29 am, Niklas B <biv...@gmail.com> wrote:
> Erik, I tried the new js.io and compilation is MUCH easier. Could you

> try to follow the instructions I posted onhttp://groups.google.com/group/orbited-users/browse_thread/thread/4f2...

Reply all
Reply to author
Forward
0 new messages