-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support AMD loaders that provide a Node.js based server-side component #19
Conversation
function startZazl(zazloptimizer, app) { | ||
var testsdir = fs.realpathSync(path.join(__dirname, "../../tests")); | ||
var optimizer = zazloptimizer.createConnectOptimizer(testsdir, false); | ||
app.use("/_javascript", optimizer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit. Should we ask installers to put their requested directories into some kind of namespace like /zazl/_javascripts
this way other implementors don't accidentally clobber each others express routes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. I've updated the Zazl impl to include a prefix
Thanks for adding these commits. Just a few questions:
|
|
Can disregard. My biggest concern was making sure |
Support AMD loaders that provide a Node.js based server-side component
The build for the merge still hit the timeout issue https://travis-ci.org/amdjs/amdjs-tests/builds/6180493 but then I triggered another build via the amdjs-tests travis page and it worked fine https://travis-ci.org/amdjs/amdjs-tests/builds/6182323 Ideally we would want the launch of phantom-server.js to wait for some notification that the server has completed starting. @jakobo any thoughts ? |
I have a few ideas. The most refined is this:
Think that'll work? I may have some time to code an example today, but it kind of depends on my afternoon's meetings. |
Yes, I think that should do the trick. I'll take a stab and put together a new pull request. |
I have an AMD loader that provides a server-side component (Node.js based). I would like to add the loader to the set of implementations.
To do this I have modified the test framework to support manifest entries providing installers. A manifest can contain the module id of an installer module. e.g
When the test framework server is started it will scan the manifests for installer properties. If any are found the installer module is loaded and an expected install function called.
The express "app" object is passed to the installer along with a reference to an installerCallback function the the installer calls to indicate it is complete. The callback function starts the framework once all discovered installers have completed.
If no installers are discovered then the server is started directly.
An additional change in this pull request is to add npm as a dev dependency to the package.json. This allows installers to use npm to programmatically install what they need.
An example installer look like this :