= envjs : pilot fish =
Envjs has moved! Here! We are currently looking for volunteer team members to help make Envjs the project we know it can be. We are also moving out ticket tracking and primary documentation here which we’ll integrate into our main site at our site so we can improve our docs rapidly.
Envjs needs a small group of dedicated volunteers to help keep this project rolling along smoothly. If your interested please just send us a message letting us know the role(s) you’ld like to help with.
Pull Request Manager
Email List Manager
Originally Developed by:
John Resig (http://ejohn.org)
Early Contributers and Integrated Project Authors:
John Resig (Envjs Prototype and Concept)
Yehuda Katz (Early XHR Implementation)
Jon van Noort (Early DOM Implementation)
David Joham (Early DOM Implementation)
Scott Severtson (Early DOM Implementation)
Steffen Meschkat (XPath Implementation)
Henri Sivonen (HTML5Parser Implementation)
Main GitHub Repository:
- BUG TRACKING HAS MOVED TO GITHUB!!
Lighthouse (Bug Tracking):
Original blog post:
Getting the code:
- Check the code out from git: git clone git://github.com/thatcher/env-js.git
- Build targets
> ant //(does all the following in order)
> ant env-platforms
> ant console-specs
> ant dom-specs
> ant event-specs
> ant html-specs
> ant timer-specs
> ant parser-specs
> ant xhr-specs
> ant window-specs
== src folder ==The source files for this project are organized by the conventions described below. All final sources are included here, including the massaged parser. Platform developers are welcome to use the src/env/ folder to consider a new platform.
== specs folder ==The ‘specifications’ are our best attempt at isolating some DOM Spec into something we can measure via an existing implementation, namely Firefox, and which also allow us to pass the same tests in a Platform.
== a couple code conventions ==
- Page width <= 80
- ‘Modules’ are isolated as
A = …;
B = …;
C = …;
- Modules depend on each other in some order. Many modules provide mix-ins to
enhance interfaces exposed in other modules. events.js for example, provide
dom 2 events for the dom.js module, adding addEventListener etc to the dom.
Here is the general hierarchy as proposed:
- Variable naming should be short but complete words.
- Module level internal functions should be prefixed and appended with __.
For example example.
== contributing tests with patches ==Each module has a spec in env-js/specs. Most tests will run whether you load them in the file:, http:, or https:, though once you get to xhr.js the tests will fail for the ‘file:’ protocol in firefox because of permissions. To run xhr.js and window.js specs, copy settings.js to local_settings.js, update it, and run a local server to satisfy those urls included in the spec.js;
== Platforms ==
= 1.3 =
Out of the box we have support for native platforms with rhino, nodejs,
python-spidermonkey, ruby-v8 (via therubyracer), and ruby-spidermonkey (via
johnson). We hope to support php and perl as well soon.
== 1.2 and lower ==
Out of the box 1.2 and lower will only run on rhino. Some support via ruby
was possible via steven parkes fork of envjs.
== Installing ==
= 1.3 =
0) common usage –
bin/envjs file0.js file1.js file2.js … fileN.js
1) fileX.js should be used to simply set window.location and do whatever
Thats its! There are a lot of ways to use Envjs to be productive so enjoy!
= 1.2 and lower =
0) common usage – all you need is env.rhino.js and rhino js.jar
java -jar js.jar -opt -1 myscript.js
1) Include the proper env.js file for your platform.
load(‘env.rhino.js’); //if in a Rhino script
The window object can be re-used, for example when crawling
Testing jQuery Compatibility:
- run ./bin/test-jquery.sh #runs 1.4.1 by default
- run ./bin/test-jquery.sh 1.3.2
- run ./bin/test-jquery.sh 1.3.1
- run ./bin/test-jquery.sh 1.2.6
- Checks out the given jQuery tag from Subversion into test/vendor/jQuery/[version],
moves dist/env.rhino.js into the correct location in their tree, and runs the test suites.
== 1.3 change notes ==
- Runs in Java, Nodejs, Ruby, and Python environments!
- Commonjs support. Just add envjs to your load path.
- Rhino no longer needs to be run in non-optimized mode. ( yeah! )
- XML Parser no longer uses e4x since it is not supported by V8 and
to allow simplified support across all engines.
- Basic XPath support from googles ajaxslt project now included.
- NodeList are live, meaning getElementByTagName returns a nodelist
which will change when node are added or removed from the document.
- Reimplementation of Timer internals to allow
- Cleaned up all jslint errors and 99.9% of warnings.
- Added internal Category Logging implementation.