glslify / babel-plugin-glslify

:tropical_fish: Babel transform for glslify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Does not work under Node 0.10 due to missing execSync API

ibgreen opened this issue · comments

@mikolalysenko
Found this thing: https://www.npmjs.com/package/sync-exec, looks like it could be worth a try.

Perhaps just check process.version and fall back to this module on older versions of node?

Or if this works, but is a little too ugly to add as a dependency on master, maybe we could make a node-0.10-support branch where we replace execSync with this function. We could publish that branch as a named release, e.g. 1.0.0-node0.10-support.

@mikolalysenko
Since sync-exec didn't work under Node 0.10, would be good to add an error message to avoid "mystery failure" for people that use this module on machines with 0.10 or lower as default install. Perhaps something like:

babel-plugin-glslify needs to run under Node.js 0.12 or higher. Your current version is ... . Consider using a node version manager such as nvm (https://www.npmjs.com/package/nvm).

@chrisirhc In response to your request for details on why it didn't work.

@mikolalysenko looked into this and reported: I just checked out using sync-exec, but the package doesn't work on my mac laptop with 0.10 (it hangs in an infinite loop reading the output fifo before the subprocess even launches). This may be different on Linux so I'd need to check to confirm. More recent node versions 0.12 and up work fine with the module, so if you like I could just publish it using this dependency and then we could see if it solves the issue on Linux.

I decided against continuing this track.

Alright, I added a check to the package.json to warn against installing on 0.10:

https://github.com/stackgl/babel-plugin-glslify/blob/master/package.json#L9-L11

If this is still a blocking issue I can try to find some other mechanism for running glslify synchronously using some more egregious hack.