duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

gnode and Transpilers #445

Closed jupl closed 9 years ago

jupl commented 9 years ago

I am currently using Babel and was looking to try Duo in JS due to more options/flexibility compared to the command line. Unfortunately whenever I require/import Duo things fall apart because it is loading gnode. It still gets loaded in other places (duo-package and duo-pack do it and fall under Duo's dependency tree) after trying to go around it by trying to load duo/lib/duo. I can see this easily happening in other places with other transpilers. It would be nice if duo offered a way around that as an alternative to altering existing code structure to always accept gnode for handling generators.

dominicbarnes commented 9 years ago

Hmm, unfortunately we are using gnode in order to get compatibility for node 0.10. Is it absolutely necessary to run your duo build script using babel? I'm not clear on why you're using babel while also running duo, it would be helpful to have a little more information on what you're doing and where it fails.

jupl commented 9 years ago

It's not a huge priority. As I said, I was playing around and see if/how would Duo integrate into something existing. I can run it separately in its own script if I wanted to, but I was trying to integrate it into part of something larger where Babel and generators are already existing. I can make changes to get Duo to work if I was dead-set on having Duo as I desire, but I wanted to reach out and see if Duo offered something to make things easier.

Strictly personal opinion, I would argue that the user should be adding gnode or something similar instead of Duo doing it automatically. That's what co does.

I will close for now.

dominicbarnes commented 9 years ago

Yeah, I think that's probably a much wiser approach, and definitely something for us to consider doing as we move forward to supporting node 0.11+ and iojs. (which is definitely on the road-map at least in my mind) I'm thinking it won't be too long before we drop node 0.10, since node 0.12 is out and stable. (but that's not my call to make)