Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Created November 9, 2013 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bcardarella/7384208 to your computer and use it in GitHub Desktop.
Save bcardarella/7384208 to your computer and use it in GitHub Desktop.

I have been working with Peter Wagenet from Tilde on getting support for Ember Appkit on Heroku with a Rails app. First some background:

Ember Appkit will Transpile ES6 modules for use as AMDs. To that end I wrote the es6_module_transpiler-rails gem which uses Node and Square's es6-module-transpiler package. That package makes use of Esprima for the parsing. There is an issue of a reserved keyword in older JavaScript runtimes not being quoted properly: https://code.google.com/p/esprima/issues/detail?id=469

On our local machines everything works OK and the transpiling does not bomb out because our versions of Node are recent. However, when we deploy to Heroku and Rails attempts to pre-compile its assets the version of Node that Heroku uses is out of date. Based upon some research it appears by default Heroku is using Node v0.4.7 which is from April 2011. It is easy enough to force Heroku to use a more up to date version of Node: https://devcenter.heroku.com/articles/nodejs-support#versions however it is currently unclear if this will run side-by-side with a Rails app for pre-compilation. Furthermore, I do not think it is reasonable to ask Rails developers to include Node configuration code for Heroku in the apps.

I respectfully request that the default version of Node for Rails's asset compilation get bumped up to a more recent version.

@justin808
Copy link

Brian, has this been resolved yet?

@schneems
Copy link

Hi, we support integration through node by using multi buildpack and by defining a package.json in your application. Here's the PR heroku/heroku-buildpack-ruby#245

Make sure nodejs comes first in the .buildpacks file then you can get any version of Node you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment