[squeak-dev] [ANN] Phobos for Squeak

Pavel Krivanek squeak1 at continentalbrno.cz
Sun Oct 14 06:22:50 UTC 2012


On Sun, Oct 14, 2012 at 1:07 AM, Chris Cunnington
<smalltalktelevision at gmail.com> wrote:
> On 12-10-13 4:29 PM, Pavel Krivanek wrote:
>
> Hi,
>
> I created a port of Phobos (framework for creation of native user
> interface using XULRunner) to Squeak too.
>
> http://code.google.com/p/phobos-framework/
>
> It uses WebClient instead of Zinc. To load Phobos evaluate:
>
> (Installer repository: 'http://www.squeaksource.com/WebClient')
>   addPackage: 'WebClient-Core';
>   install.
>
> (Installer repository: 'http://www.squeaksource.com/Seaside30')
>   addPackage: 'Grease-Core';
>   addPackage: 'Grease-Pharo-Core';
>   addPackage: 'Seaside-Pharo-Continuation';
>   install.
>
> (Installer repository: 'http://www.squeaksource.com/SCouchDB')
>   addPackage: 'JSON';
>   install.
>
> (Installer repository:
> 'http://smalltalkhub.com/mc/PavelKrivanek/Phobos/main')
>   addPackage: 'Phobos-Core';
>   addPackage: 'Phobos-XUL';
>   addPackage: 'Phobos-HTML';
>   addPackage: 'Phobos-Demo';
>   addPackage: 'Phobos-WebClient';
>   install.
>
> To start the server evaluate:
>
> app := PhobosDemo new.
> app startOnWebClient.
>
> ATTENTION: You will need to modify start.st script in the bundle.
>
> There is one main ugly difference from Pharo, If an error on Smalltalk
> side is raised, no debugger is opened. You will get the information
> about an error only on the JavaScript side in JSConsole:
>
> "
> Error: The connection to ws://localhost:46528/newSession has
> terminated unexpectedly. Some data may have been transferred.
> Source File: chrome://myapp/content/main.js
> Line: 132
> "
>
> Cheers,
> -- Pavel
>
> We were just talking about this in the Squeak Community Meeting, as we were
> discussing the possible limitations of web browsers
>
> Having played with this a bit my first question is where is the client?

You need a JavaScript client based on XULRunner. You need to download
a bundle for your platform:
http://code.google.com/p/phobos-framework/downloads/list

This bundles include XULRunner (with exception of Linux bundle), the
JavaScript client application, CogVM and a Pharo image.

Then you have two option. Prepare Squeak image with Phobos, modify
start.st script and replace app.image with the Squeak image (include
sources and changes file into the same directory). With that setting
the XULRunner will show splash screen and will start the CogVM.

If you change a line in defaults/preferences/prefs.js to
pref("toolkit.defaultChromeURI", "chrome://myapp/content/templates/main.xul");
then XULRunner will start only the JavaScript client application that
expects, that the Smaltalk server is already running. This setting is
better for development. Before the XULRunner run firstly the Squeak
image with Phobos and start the server:
app := PhobosDemo new.
app startOnWebClient

> I loaded Phobos, started it, and went to http://localhost: 46528 in Chrome,
> which I think is my first mistake right there. Does this work on Firefox and
> not Chrome, because Firefox uses Xul? Nope.
> This uses a ws://localhost protocol I've never seen before. OK. Where does
> that go? Is there a Xul browser? Certainly not.

The JavaScript client application is something like a statical web
page showed by XULRunner that tries to start the web socket
communication with the server.

> I download XulRunner, but that isn't an application. I'm supposed to create
> an application like ChatZilla [1] and start it with XulRunner after I've
> downloaded it, c'est la:
>
> /Library/Frameworks/XUL.framework/xulrunner-bin
> /Users/chrisucunnington/Desktop/chatzilla-0.9.89-xr.zip
>
> And I don't see any place to put a ws:// address. Hmmm...

use a bundle from the Phobos site.

>
> So I've got some nice pictures of the running Phobos demo presenting in an
> unknown client. [2] They setup looks kind of like the Xul Periodic Table,
> which used to be online, but was severed due to security.

It is based on the XUL Periodic Table. But XULRunner doesn't have
Firefox security limitations

Cheers,
-- Pavel.

> So, I think before you can use the Phobos demo you need to build a client to
> see it and start it with XulRunner. There's something wrong with that
> statement, but I don't know what it is.
>
> Pavel also created an all JavaScript version called XulJet. [3]
>
> Chris
>
> [1] http://chatzilla.rdmsoft.com/xulrunner/
> [2]
> https://plus.google.com/photos/106846588629768024210/albums/5797347436751628657
> [3] http://code.google.com/p/xuljet/
>
>
>


More information about the Squeak-dev mailing list