Changes

Jump to: navigation, search

Create Local MXR

3,700 bytes added, 16:03, 11 February 2009
no edit summary
Many developers without highspeed network access would like to be able to use [http://mxr.mozilla.org MXR] but can't. This project will build a lightweight, installable Windows package that gives the full functionality of MXR locally. This will also include a [http://labs.mozilla.com/featured-projects/#prism Prism] front-end specific for the task of using this local MXR.
Resources: [http://lxr.mozilla.org/mozilla/source/webtools/lxr/ MXR source], [http://timeless.justdave.net/mxr-test/patches/20080114.zip patches to lxr] in the tree
== Project Leader(s) ==
* I'm not sure the best way to do this, in terms of having a usermode, lightweight web server that can run this on Windows. We could use something like [http://www.lighttpd.net/ lighttpd] or one of the other [http://en.wikipedia.org/wiki/Tiny_web_servers small servers] for win32. Ideally, this could run as an app vs. a service--people won't want to install a service just to search source code.
 
* Win32 port of lighttpd is [http://wlmp.dtech.hu/down_lighty.php?type=nossl&lang=en here]. 1.3M download, 5.34M installed. Takes ~3.3M RAM on startup.
 
* Need DB_File. I tried to get this working with msys-perl |perl -MCPAN -e 'install DB_File'| but it doesn't seem to work for me. So I installed ActivePerl, and get it that way |ppm install DB_File|.
 
* Index db file size for an index of a fresh trunk checkout = ~77.8MB
 
* Wondering about adding syntax highlighting. Various JS libs exist for this:
:* http://softwaremaniacs.org/soft/highlight/en/
:* http://www.webessence.nl/projects/highlight/index.html
:* http://mihai.bazon.net/projects/javascript-syntax-highlighting-engine
 
* Might make sense to have the web app control the web server [http://developer.mozilla.org/en/docs/Code_snippets:Running_applications via nsIProcess], so it can start/stop it intelligently.
 
* Another option to consider is a self-hosting web server using [http://mxr.mozilla.org/seamonkey/source/netwerk/test/httpserver/ httpd.js]. Waldo has a [https://bugzilla.mozilla.org/show_bug.cgi?id=js-cgi patch] to add cgi capabilities. '''UPDATE:''' This has landed on trunk, but it's not a good option according to Jeff (from an email asking about using the new js-cgi stuff for this project):
 
<blockquote>
Well, first, the server's CGI is only CGI done in JS, so you'd have to call out to Perl or what-have-you to use the existing code of MXR. Second, the server doesn't expose as much information as is exposed in a CGI environment, some because it requires a bit of pre-configuration of the server (the APIs could be added, but it'd either be a fair number or a config file, neither of which is all that great for usability). Third, the server doesn't allow you to access the body of requests, so, for example, you can't process the body of POST requests yet, so you can't handle most form submits.
<br />
The server was mostly designed for mocking a set of static files onto a web server for testing purposes (and not much more than that) without needing to run a full-fledged local web server, to get correct file paths and such (and at a specific host if you set up proxying correctly, a la Mochitest). Full dynamicity was never really a goal, and POST requires a fair amount more pain than you'd expect as I'm unable to use threads in the server due to non-threadsafe components. I'd suggest sticking with what you have, more or less, because this sounds like more than the server really was meant to do.
</blockquote>
 
* PRISM build instructions are [http://developer.mozilla.org/en/docs/Creating_XULRunner_Apps_with_the_Mozilla_Build_System here].
 
* Use [http://shjs.sourceforge.net/index.html shjs.js] to do syntax highlighting of source.
 
* [http://vocamus.net/dave/?p=124 Blogged] on my progress to date, showing MXR working, and re-done as an extjs app.
 
* Spoke with justdave about source for mxr:
 
<blockquote>To get the source, use <code>hg clone http://hg.mozilla.org/users/bsmedberg_mozilla.com/mxr/</code>
File bugs in Webtools/LXR and attach patches, CC justdave, timeless, and bsmedberg on them</blockquote>
 
* Need to deal with chars in filenames when creating ids in elements: <code>$^_-/.{}0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ</code>
 
* Considering doing an extension with a binary web browser app included. See [http://www.ibm.com/developerworks/web/library/wa-ltwebserv/ this] discussion of tiny web servers, and also the [https://addons.mozilla.org/en-US/firefox/addon/6665 Prism Firefox Extension], which shows the model for containing binary apps and using nsIProcess to start/stop.
 
* [[Create Local MXR UI Suggestions]]
 
* [[Instructions for Setting Up DXR]]

Navigation menu