Bluish Coder

Programming Languages, Martials Arts and Computers. The Weblog of Chris Double.


2007-07-11

Javascript on the Server

Running Javascript on the server seems to be gaining in popularity. Last year I wrote a small framework to test writing web applications in Javascript. Tony Garnock-Jones later extended this to support building continuation based web applications.

More recently, Peter Michaux has taken my original code and made a nicer web framework out of it.

John Resig has written a browser DOM emulation layer that allows jQuery and some other frameworks to be run server side. His example code looks very neat. Combining this with a decent Javascript based web framework would make for a interesting environment.

Steve Yegge has apparently ported Rails to Javascript. Hopefully this code will be released as open source someday.

Sun have a server side Javascript web application environment, Phobos.

Helma looks to be a mature Javascript web system too.

I wonder if Javascript usage outside the browser is reaching a 'tipping point' and is about to grow dramatically. It's an under-appreciated language and is very much like a protoype OO based Scheme with a Java-ish syntax. Ecmascript 4 is looking to be even more interesting.

Tags: javascript 

2007-07-07

SuperHappyDevHouse Aotearoa

I'm at the SuperHappyDevHouse Aotearoa hackathon in Wellington at The Cross. Free food, free coffee, lots of people and lots of hacking going on. Hopefully by the end of today I'll have the video tag implementation a bit further along.

There's a Flickr stream of photo's under the tag shdhnz.

Tags: misc 

2007-07-07

Building a Video element enabled Firefox

I've had a few comments and emails about problems encountered building Firefox with the video element patch, or from the git repository.

Once you've applied the patch, or retrieved the git repository, you'll need to add a .mozconfig file in the 'mozilla' directory. The Mozilla Build Documentation has the details on what can go in this file. A simple .mozconfig which will get a debug build working is:

. $topsrcdir/browser/config/mozconfig

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-@CONFIG_GUESS@
mk_add_options MOZ_CO_PROJECT=browser
ac_add_options --disable-tests
ac_add_options --enable-debug
ac_add_options --with-macosx-sdk=/Developer/SDKs/MacOSX10.4u.sdk

The last line is only needed for Mac OS X builds.

There was a problem with the patch in that this default build on some platforms would give a link error due to not finding the Alsa sound libraries. This is fixed in the git repository. The problem only occurred in 'libxul' enabled builds, which is now the default. You can disable libxul in the build process by adding this line to .mozconfig:

ac_add_options --disable-libxul

Disabling this is quite useful for development as the builds are faster and you can selectively build portions to cut down compile times. Once you have a .mozconfig file you can start the build using make:

make -f client.mk build

Note the use of the 'client.mk' makefile with the 'build' target.

In the .mozconfig we specified a MOZ_OBJDIR. This is a directory that will contain the build files and the final executable. When the build completes you can run Firefox with something like:

obj-a-b-c-d/dist/bin/firefox -ProfileManager

Change 'obj-a-b-c-d' with the name of the object directory that was created. On Mac OS X a '.App' is created and you will need to run Firefox with:

obj-a-b-d/dist/MinefieldDebug.app/Contents/MacOS/firefox -ProfileManager

The .app will be called 'Minefield' in an optimized build and 'MinefieldDebug' in a debug build.

To build something you can install on another system (a .dmg file on Mac OS X, tar file on Linux, etc) you must have a 'libxul' enabled build and run the following after a successfull build:

make -C obj-a-b-c-d/browser/installer

The packaged installer will be in the obj-a-b-c-d/dist directory.

Tags: mozilla 

2007-07-05

Patch for Video element support in Firefox

I've uploaded a patch which is the first pass at implementing support for the <video> element in Firefox. The patch is attached to bug 382267.

There are quite a few known issues with the patch at the moment, and I'm working through them, but I've made it available at this time so others can at least try it out. A page with some example usage is here: http://www.double.co.nz/video_test.

To build you'll need the latest Firefox CVS, and apply the following:

I've also made a git repository available that tracks my work on video. This is basically Firefox CVS with the patch applied, and is the repository I used to generate the patch in the first place. I'll be updating that regularly with my changes between patch generation for the bugzilla entry. You can track this repository with one of the following commands:

 git clone http://double.co.nz/git/video.git
 git clone git://double.co.nz/git/video.git

The main issues at the moment are problems with optimized builds, so I suggest trying it out with a debug build. I'm also not using channels correctly for multithreaded code which is the cause for a bit of instability. Read the bug for further details.

Tags: mozilla 

2007-06-15

Viewing Firefox CVS changes via gitweb

Following on from my previous post about using git to track the Firefox CVS repository, I've installed 'gitweb' to allow browsing the repository. The URL to access it is: http://www.double.co.nz/cgi-bin/gitweb.cgi

This is quite a nice way to see diffs for what has changed recently in the CVS tree for the time period between when my git import script runs. Unfortunately you don't get the original CVS comments for the commit.

You can also now clone or pull from the repository using the 'http' protocol as well as the 'git' protocol:

# Git protocol 
git clone git://double.co.nz/git/firefox.git

# HTTP protocol
git clone http://double.co.nz/git/firefox.git

In the comments to the last post, Alex asked for advice on how to get git on Mac OS X and MozillaBuild on Windows users.

On Mac OS X I installed 'git-core' using macports:

sudo port install git-core

Windows is a bit trickier as most people who have been following git know. The best approach at the moment is to use cygwin. Git is available in cygwin or you can install it from source. Make sure you get version 1.5.1 or greater. What I do is run all my git commands from cygwin and use the msys based MozillaBuild shell for building and other things. It's not ideal but it has worked reasonably well for me. Another option might be git-mingw but I've not tried it and don't know how stable it is.

Also in the comments, jmdesp asked about using the git repository to track regressions. I have a script that updates the repository about every 6 hours. You could probably use this to track down the six hour window where the problem occurred, and use git to see the files that were changed in the commit. You can use git to move forward and back commits and try builds. Here's an example workflow:

# Get the repository
git clone git://double.co.nz/git/firefox.git regression
cd regression/mozilla
...create .mozconfig...
make -f client.mk build
...test...

# Go back one commit
git checkout HEAD~1
make -f client.mk clean
make -f client.mk build
...test...

# Go back another commit
git checkout HEAD~1
make -f client.mk clean
make -f client.mk build
...test...

# Go back 3 more commits
git checkout HEAD~3
make -f client.mk clean
make -f client.mk build
...test...

# Restore back to the most recent commit
git checkout HEAD

The number following the tilde in HEAD~1 is the number of commits to go back. You can also use 'git log' to see the commit id of each commit and jump directly to that:

git log
...Commit c2148196de6a112982e273b5c469a9f763a1fa8b...

git checkout c2148196de6a112982e273b5c469a9f763a1fa8b
Tags: mozilla 


This site is accessable over tor as hidden service 6vp5u25g4izec5c37wv52skvecikld6kysvsivnl6sdg6q7wy25lixad.onion, or Freenet using key:
USK@1ORdIvjL2H1bZblJcP8hu2LjjKtVB-rVzp8mLty~5N4,8hL85otZBbq0geDsSKkBK4sKESL2SrNVecFZz9NxGVQ,AQACAAE/bluishcoder/-61/


Tags

Archives
Links