Persevere can run on Rhino or Node, mutually exclusively. Rhino is
supported for users that wish to run their code on the JVM and interact
with Java libraries (something you can't really do very efficiently in
NodeJS).
Just FYI, I am currently working on getting Persevere running on RingoJS
as the Rhino foundation. I'm also upgrading to running on Node 0.6.0
(main breaking change is using multi-node on the new clustering
technology in Node).
>
> Whatever, for now, I need to create a full documentation of my choices
> (on persvr and custom tools).
> I'me payed to do this Job and I clearly want to share persvr related
> docs with community.
> I�ll start by making few tutorials, based on beta4 for now, as :
> - Managing User, Authentication, Default Security, Session, �
> - Install and administrate server
> - Managing different sources, installing driver
> �
Awesome, contributions to docs are greatly appreciated!
>
> And a normalised APIs docs (short description of calls and parameters
> of all modules).
> For this point, may I start from beta4 (is there no really big
> difference with last srcs)?
> Or maybe I must start from the last sources?
I would recommend using the latest when possible just to minimize any
doc changes that would need to be done.
>
> I�ll submit those stuffs to community.
>
> If anybody has already documentations stuffs that�s need more works,
> or small workable demo, or if anybody wants to give any help : (s)he�s
Thx for the answer.
So, about my investigations...
I've seen that you (Kris) have work a lot those last days...
I was trying by myself to have the wiki example working on nodejs.
Definitivly, I could not make the wiki example or my own demo workable
with nodules.
Before that you make the last updates, I was having a lot of
references problems among differents packages.
Among other things, I was trying to make nodules download the last
sources.
To make something workable (not completly), I was needing to change
few scripts at a lot of places.
Finally I was stuck with a bug which gives absolutly no clue on why
this bug.
the bug :
node.js:134
throw e; // process.nextTick error, or 'error' event on first
tick
^
TypeError: Object function (id){
var uri = resolveUri(currentId, id, getPackage(currentId).mappings);
if(moduleExports[uri]){
modules[uri].dependents[currentId] = true;
return moduleExports[uri];
}
if(factories[uri]){
try{
var exports = moduleExports[uri] = {},
module = currentModule = modules[uri] = modules[uri] || new
Module(uri),
currentFile = cachePath(uri),
factory = factories[uri],
originalExports = module.exports = exports,
nextRequire = currentRequire = makeRequire(uri);
module.dependents[currentId] = true;
exports = factory.call(exports, nextRequire, exports, module,
define,
currentFile, currentFile.replace(/\/[^\/]*$/,''))
|| exports;
if(factory != factories[uri]){
// if a module was wrapped with the transport/D than the factory
will get replaced
exports = factories[uri].call(exports, nextRequire, exports,
module, define,
currentFile, currentFile.replace(/\/[^\/]*$/,''))
|| exportMBPGCOSX:wiki_10 gillescoomans$
And nothing more....
Now, after all your really recents changes (I've followed all of
them) : when I sart a fresh gited wiki example, and start it with node
(0.4.12) and nodules (0.2.4)
- there is no more references problems
- but nodules still downloading "old" version of libs (no 0.3.x) : the
package.json does not reference them
- and I get directly the esoteric bug.
So, after all those defeat ;), I decide to not use nodules for now,
before you fix it to be usable directly (maybe with nodejs 0.6.1 as
you where talking about. It would be awesome.).
But I really believe in nodules forces, so I hope I could get all
workable soon. ;)
Then, as npm does not know any recent version of persvr libs, I've
tryied to install the libs by hand.
I've followed this tuto (others don't work) :
http://www.bennadel.com/blog/2169-Where-Does-Node-js-And-Require-Look-For-Modules-.htm
and made a directory called node_modules, at same level (in the fs)
than the wiki folder (or my own demo).
There was fews errors left (as path which contains /lib/ or not. e.g
transporter modules which always contains files in lib/ but other libs
try to get them directly) easy to fix.
Now, I could run the wiki and my own demo on nodejs 0.4.12.
But I still have the transporter which fails, because it uses nodules
as loader.
As I do not use nodules as main loader (when I start the app), It does
not download any sources (in /downloaded_modules/), and so, It does
not find the transporter in the ../node_modules/ (which is the node's
path).
A strange things, is that the files under /lib (my own javascrit files
in my demo (root level of server)) are served by transporter (ok it's
the default lookup path for transporter) : but if I put the
transporter lib itself in the /lib (and also in ../node_modules) : it
does not seems to be there by nodules.
And if a omit to specify a loader (to use the default's one), and
trying to set paths option in transporter instanciation in the jsgi
stack, it never succeed.
No more chance with trying to create by hand a downloaded_modules
folder with transporter lib directly in it.
I've also tryied with adding a jsgi Static app in the jsgi stack which
serve ../node_modules/ files, but it also fails.
So... :)
Maybe Kris, or others, could save me and my mind... :)
Any idea, suggestion, on how structuring last sources and my own libs
(from a nodejs point of vue) to make all this cleanly workable are
obviously welcome... ;)
For the documentations that I'm working on,
I've start different things, as a full table of jsgi app presents in
differents persvr packages, or schemas that explain visually the
architecture of persvr.
But I think that first of all, we need a fresh, complete out-of-the-
box-installation tutorial. ;)
Help me, and I'll do it... ;)
Cheers,
Gilles Coomans
when I use this package.json for wiki example :
{
"name": "persevere-example-wiki",
"author": "",
"version": "0.0.3",
"contributors": [],
"mappings":{
"websocket-server": "jar:http://github.com/miksago/node-websocket-
server/zipball/master!/lib/ws/server.js",
"perstore": "jar:http://github.com/kriszyp/perstore/zipball/
master!/",
"pintura": "jar:http://github.com/kriszyp/pintura/zipball/master!/",
"formidable": "jar:http://github.com/felixge/node-formidable/zipball/
master!/",
"promised-io": "jar:http://github.com/kriszyp/promised-io/zipball/
master!/",
"templify": "jar:http://github.com/dmachi/templify/zipball/master!/
lib/",
"patr": "jar:http://github.com/kriszyp/patr/zipball/master!/",
"rql": "jar:http://github.com/kriszyp/rql/zipball/master!/",
"persevere-client": "jar:http://github.com/kriszyp/persevere/zipball/
master!/public/",
"wiky": "jar:http://github.com/kriskowal/wiky/zipball/master!/",
"narwhal": "http://github.com/kriszyp/narwhal/zipball/master",
"jack": "jar:http://github.com/kriszyp/jack/zipball/master!/",
"transporter": "jar:http://github.com/kriszyp/transporter/zipball/
master!/",
"jsgi-node": "jar:http://github.com/kriszyp/jsgi-node/zipball/
master!/",
"multi-node": "jar:http://github.com/kriszyp/multi-node/zipball/
master!/",
"tunguska": "jar:http://github.com/kriszyp/tunguska/zipball/
master!/",
"json-schema" : "jar:https://github.com/kriszyp/json-schema/zipball/
master!/",
"commonjs-utils" : "jar:https://github.com/kriszyp/commonjs-utils/
zipball/master!/"
},
"maintainers": [
{
"name": "Kris Zyp",
"email": "kri...@gmail.com"
}
],
"dependencies": {
"pintura": ">=0.3.0",
"perstore": ">=0.3.0",
"promised-io": ">=0.3.0",
"requirejs": ">=1.0.0",
"rql": ">=0.3.1",
"tunguska": ">=0.3.0",
"wiky": ">=0.95.1"
}
}
Then, replace "require("templify/lib/templify")" by "require("templify/
templify")" in pintura/media/html.js
i.e. :
- ...\pintura\zipball\master\media\html.js:9: characters 30-42 :
resolver = require("templify/lib/templify").Resolver,
- …\pintura\zipball\master\media\html.js:13: characters 40-52 : var
templateEngine = require('templify/lib/
templify').TemplateEngine({resolver: resolver, store: filesystem});
Then, replace "require("jsgi-node")" by "require("jsgi-node/jsgi-
node")" in pintura/start-node.js
i.e. : …\pintura\zipball\master\start-node.js:8: characters 12-21 :
require("jsgi-node").Listener(jsgiApp)
Then, remove two lines from wiki-example/index.js which is not any
more relevant
i.e. :
line 20 : Static({urls:["/packages"], root: require.resolve("pintura/
pintura").replace(/pintura[\\\/]pintura.js$/,''), directoryListing:
true}),
line 33 : false&&require("persevere-client/explorer/explorer.js");
Everything work out of the box (wiki or my own custom demo) with
nodules (0.2.4) and nodes (0.4.12).
Even the transporter.
Maybe I could put this package.json and index change on wiki example
git.
And also put the changes to pintura git?
Maybe it request further changes to be sure to keep compatibility.
G.
Gilles Coomans