Skip to content
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

Node's compatibility for v0.8.0 #9

Closed
biamontidv opened this issue Dec 19, 2011 · 10 comments
Closed

Node's compatibility for v0.8.0 #9

biamontidv opened this issue Dec 19, 2011 · 10 comments
Labels
Milestone

Comments

@biamontidv
Copy link

Hi,

first of all great job putting this module together, it really does open up lots of cool scenarios and possibilities.
I was wondering if you could suggest what is your idea for integrating wire.js to be run within Node.js. Do you plan on using the requirejs for Node?
It would be awesome to be able to use wire.js in node!

Thanks

@briancavalier
Copy link
Member

Hey @biamontidv,

Thanks! We agree that using wire.js in node will be really powerful :)

Although I haven't tried it, it's likely that wire.js v0.7.3 would work in node if you use RequireJS. I'm guessing that getting the requirejs config right would be the trick. Have you tried it? If so, I'd be very interested to hear your experience!

At a high level, our plan for wire.js has always been to allow it to use whatever loader is provided by the environment. Since we come from the browser world, that originally meant any AMD loader. Wire already has some internal abstractions for dealing with differences (namely DomReady) between AMD loaders in the browser, so our plan is to expand those abstractions to also handle node's built in require().

Basically what that will mean is that developers won't need to do anything special to use wire.js in node. It'll just work :) And yep, we're targeting v0.8.

If you have any other thoughts about using wire in node, please feel free to add them to this thread!

@biamontidv
Copy link
Author

Hi @briancavalier,

fantastic! The idea I had was to start an enterprise integration patterns module (maybe you've heard of Apache Camel and wire.js is similar to Spring) for node (called donkey or node-donkey), but of course there were a number of challenges at several layers (and I was not 100% satisfied how the solution turned out) and now that I've heard of wire.js, I definitely think it can help.

Yes, I tried to run wire.js with requirejs on node with just the most basic config. Even though I could load other libraries (e.g. your when.js, sitting in the node_modules folder) by themselves, when trying to load wire.js I got an error saying:
Calling node's require("wire") failed with error: TypeError: Cannot read property 'defer' of undefined

mmh, an error passed through by requirejs, it has something to do with how when.js is loaded in wire.js?
I haven't tried anything else so far.

Any idea of a possible release date? Oh, and plans for including wire.js in npm?

Thanks :)

@briancavalier
Copy link
Member

Bummer! I was kinda hoping it would just work :) Thanks for trying it, and for the info about the error, though. I'm sure it will come in handy soon, since we're getting close to starting on node compatibility.

Your idea sounds very interesting. I'm familiar with Camel (I used it at a previous job a few years ago, with Spring), and I'd be interested to see your approach for bringing something similar to JS. It could make for some really cool patterns that are easy to implement via wire plugins! We've done some similar things with wire at my current client (LifeIMAGE), but we haven't abstract our patterns it into something quite as comprehensive as Camel. We have learned, though, that codifying patterns via wire plugins is quite powerful.

As for a timeline, it's hard to be specific with the holidays, but mid-late January seems like it could happen. I don't see any reason not to get wire into npm :)

@briancavalier
Copy link
Member

@biamontidv,

It's still early, but just wanted to let you know that we got wire loading in node today in a quick test. There's still plenty of work to do, especially for all the bundles wire plugins (followed by plenty of testing!), but it was easier than I thought it would be to take this initial step. I guess our abstractions are paying off :)

I'll leave this issue open to track progress.

Brian

@briancavalier
Copy link
Member

We just hit another milestone for node compatibility! We've converted all the non-browser-specific wire plugins to work in node, and wired a small test app that uses them.

@biamontidv
Copy link
Author

Fantastic!
keep up to good work!

@briancavalier
Copy link
Member

If you want to live on the bleeding edge, or just want to try it out in node, feel free to pull the dev-080 branch. It works with both RequireJS and Node. There is a paths problem that prevents it from working with curl.js in the latest commit, but we'll have that working again soon as well.

@briancavalier
Copy link
Member

Thanks to some late night heroics by @unscriptable, the dev-080 branch now runs in curl.js, RequireJS, and node! Be sure to update submodules if you want to run the unit tests. They run in both curl and requirejs, and we're working on unit tests for node as well.

@briancavalier
Copy link
Member

Today we merged the dev-080 branch back into dev. That means the dev branch now runs in node and AMD. The node support seems solid, so feel free to play with the dev branch in node. We're just working on pulling together other things and shooting for a release within the next couple weeks.

@briancavalier
Copy link
Member

v0.8.0 just landed with Node and RingoJS support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants