Open ghost opened 11 years ago
Doesn't Sprockets do this automatically?
It seems to be doing it for everything but faye.js
, so, either sprockets is trolling me or it's assuming that it's already done for builtin libraries.
It's not just you :(
curl -s http://localhost:3000/assets/faye.js | head -1 | cut -c 1-100
'use strict';var Faye={VERSION:'0.8.9',BAYEUX_VERSION:'1.0',ID_LENGTH:160,JSONP_CALLBACK:'jsonpcallb
Can you try using version 1.0.10 and get back to me?
It still seems to be broken for me, but I'm going to play around with it and make sure that it's not a problem on my side. The file is wrapped in the closure, so, it should work.
Okay, so, update: for whatever reason, faye-rails 1.0.10 breaks everything, but I've separated faye from the assets and loaded version 1.0.8 separately and it works (this doesn't work for v1.0.10).
So, this is still broken, but for now, this should at least be posted as a workaround.
Okay, I've updated the closure to pass in this
in e859e56. How did that go?
I still seem to be getting a TypeError: this is undefined
. Although, I'm having trouble determining where the this
is because the source map is missing. I think that it's in Faye
.
faye.js
and other related files should be enclosed in(function(){
})();
blocks to avoid leaking this definition into other scripts when sprockets concatenates the files.