I am finally getting around to cleaning up and sharing something I started a long while ago: an extended JavaScript format, and some conversion tools to convert it into regular javascript.
The extended javascript format (.jsx) introduces preprocessor definition capability (#if, #else etc. along with my very own single line preprocessor definition mechanism such as ##if DEBUG) to allow writing conditional code. This would for example, enable you to build a debug mode of your script, without impacting the performance of your code once its in production. The tools also condense script by stripping out whitespace, and comments while allowing you to specify and preserve significant comments such as copyright headers, so as to minimize download size, and make the script somewhat harder to read.
The conversion utility can be run as a standalone tool if you want to deply regular .js files to your web site. However, the real value of this tool is that it can be used as an http handler to allow dynamic conversion of .jsx files into .js files. In the dynamic conversion case, you can also use preprocessor directives such as #if IE and #if MOZILLA to conditionally generate browser-specific code from the server!
I am putting this out as a project... so it has a page of its own, along with a comment form, an RSS feed etc. Head on there now for more details and binaries...
Posted on Thursday, 8/4/2005 @ 10:41 PM
| #
Projects