Difference between revisions of "Create Local MXR"
(added note about httpd.js) |
|||
(9 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
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. | 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/ | + | Resources: [http://lxr.mozilla.org/mozilla/source/webtools/lxr/ MXR source], [http://timeless.justdave.net/mxr-test/patches/ patches to lxr] in the tree |
== Project Leader(s) == | == Project Leader(s) == | ||
Line 36: | Line 36: | ||
* 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. | * 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. | + | * 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]] |
Latest revision as of 15:03, 11 February 2009
Contents
Project Name
Create Local MXR
Project Description
Many developers without highspeed network access would like to be able to use 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 Prism front-end specific for the task of using this local MXR.
Resources: MXR source, patches to lxr in the tree
Project Leader(s)
Project Contributor(s)
- None
Project Details
- Project begun in conjunction with Mozilla Developer Resource Kit project.
- 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 lighttpd or one of the other 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 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:
- Might make sense to have the web app control the web server via nsIProcess, so it can start/stop it intelligently.
- Another option to consider is a self-hosting web server using httpd.js. Waldo has a 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):
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.
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.
- PRISM build instructions are here.
- Use shjs.js to do syntax highlighting of source.
- Blogged on my progress to date, showing MXR working, and re-done as an extjs app.
- Spoke with justdave about source for mxr:
To get the source, use hg clone http://hg.mozilla.org/users/bsmedberg_mozilla.com/mxr/
File bugs in Webtools/LXR and attach patches, CC justdave, timeless, and bsmedberg on them
- Need to deal with chars in filenames when creating ids in elements:
$^_-/.{}0123456789aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
- Considering doing an extension with a binary web browser app included. See this discussion of tiny web servers, and also the Prism Firefox Extension, which shows the model for containing binary apps and using nsIProcess to start/stop.