coffee-script icon indicating copy to clipboard operation
coffee-script copied to clipboard

New rubygems release

Open CyborgMaster opened this issue 12 years ago • 22 comments

I love IcedCoffeeScript! Thanks so much for putting it together. Brilliant stuff.

I'm using it in my rails project, using the iced-rails gem, which depends on the iced-coffee-script gem (the ruby-coffee-script repo), which depends on the iced-coffee-script-source gem (which I am pretty sure is this repo).

The current version of the iced-coffee-script-source gem on rubygems is 1.2.0o and it looks like you've made some great progress since them (the latest version appears to be 1.6.3-g). Would it be possible to get another release pushed out to ruby gems?

Disclaimer: I'm not sure I'm asking in the right place because this repo doesn't appear to have a .gemspec file in it, so I'm not sure that this is the actual source of the rubygem, but I believe the owner of this repo is the owner of the gem, and the homepage on rubygems points here. I apologize if my assumptions are wrong.

CyborgMaster avatar Nov 15 '13 15:11 CyborgMaster

Thanks! You know I recently tried to do this and failed a little while ago. I will try again. The build process in the jashkenas trunk changed a bunch and that thwarted me. I'll try to get around to fixing it. Thanks.

maxtaco avatar Nov 15 '13 20:11 maxtaco

Just thought I would bump this again. I would love to be able to start using iced-coffee-script in my rails project again, but I need some of the features of the new version. Any luck with the build process? Anything I can do to help? Or maybe a suggestion for a workaround?

CyborgMaster avatar Sep 23 '14 18:09 CyborgMaster

I just ran into another great place I could used iced coffee script. I might start poking into this myself if you don't have time.

CyborgMaster avatar Oct 13 '14 21:10 CyborgMaster

Sorry @CyborgMaster! I've been slammed on other stuff. Urg. Can I hand this project off to you or to someone else? It's been so long since I made the gem, I've forgotten what's involved. I'm not much of a ruby user. I'm happy to adjust perms on rubyforge. Thanks

maxtaco avatar Oct 13 '14 22:10 maxtaco

As long as the "this" in "hand off this project," means only the gem release and not all of IcedCoffeeScript, I'd be happy to help. :wink: Give me until Wednesday (I'm swamped until then myself), then I'll look into what has to happen to allow me to publish the gem.

CyborgMaster avatar Oct 13 '14 22:10 CyborgMaster

Exactly, just the gem. Thanks!

maxtaco avatar Oct 13 '14 22:10 maxtaco

I'm going to try and figure this out now, let me know if you have any tips.

CyborgMaster avatar Nov 19 '14 20:11 CyborgMaster

How did you use to do it? I'm not finding anything that looks like it...

CyborgMaster avatar Nov 19 '14 21:11 CyborgMaster

I opened up an issue over at jashkenas/coffeescript#3732 to ask how they do it. We'll see what they say.

CyborgMaster avatar Nov 19 '14 21:11 CyborgMaster

Awesome, thanks for your help. I think they've been moving away from Rake and toward self-coffee-hosting. That might have something to do with it.

maxtaco avatar Nov 19 '14 22:11 maxtaco

Right. I see the commits where they do that. It's a great idea, but they still must be doing something to package the gem, as it is still getting update in the coffee-script-source gem.

CyborgMaster avatar Nov 19 '14 22:11 CyborgMaster

So I think I might have got the gem building, but now I'm getting an error when I try to compile with it:

Cannot set property 'CoffeeScript' of undefined

I'm still digging, any ideas?

CyborgMaster avatar Nov 19 '14 23:11 CyborgMaster

It might have to do with the fact that its running inside ExecJS (V8) inside of a Rails project. Are there different build versions?

CyborgMaster avatar Nov 19 '14 23:11 CyborgMaster

I'm going to have to give up for now. I do think I've got the gem packaging correctly, but I can't get it to run in my environment. It appears to have to do with the way CoffeeScript is trying to define it's global.

I think its crashing right at the top of iced-coffee-script-1.8.0-a.js, here:

f.CoffeeScript=e()

Which appears to be something to do with AMD or requireJS.

Vanilla CoffeeScript does this differently. It's global registration seems to be at the bottom of the file and looks like this:

root.CoffeeScript=CoffeeScript

Any ideas?

CyborgMaster avatar Nov 20 '14 00:11 CyborgMaster

As a last thought, it may be worth noting. If I use the coffee-script.js file from the extras folder instead of iced-coffee-script-1.8.0-a.js, things work just fine (as long as I don't use any iced features of course).

This makes me think that it is not my gem packaging that is causing the problem. I'll have to lean on your expertise here for next steps.

CyborgMaster avatar Nov 20 '14 00:11 CyborgMaster

A little more info (I couldn't help myself from digging more).

Turns out if I use version 1.6.3-j, it works like a charm. So something big changed since then.

CyborgMaster avatar Nov 20 '14 01:11 CyborgMaster

Thanks for working on this. At some point, the runtime was factored out into a separate package for security reasons. That might be causing the problem. How do I reproduce the issue myself?

maxtaco avatar Nov 20 '14 01:11 maxtaco

That might be it, although I have a feeling it has something to do with browserify.

Hmm... reproduce. That's a little tough, maybe you can help. I've got a rails project that I'm using now. I'm using iced-rails to compile iced-coffee-script. When I replace the source file with the latest version (using a new version of iced-coffee-script-source), it crashes when I try to compile any .iced files.

This would probably happen in any project that uses the iced-coffee-script gem to compile iced files in ruby, or maybe anything that ran the iced compiler using V8.

Is that enough to go on? If not, I can try and help you set up a rails project that mimics mine.

CyborgMaster avatar Nov 20 '14 01:11 CyborgMaster

Hi CyborgMaster, I'm really sorry for everyone here, I'm new to github and have absolutely no clue how to contact someone directly. So i just gonna leave a comment here for Cyborg. I'm really intereset in your FTB Monster Gregtech config, and got a few questions, is there a way to get in direct contact with you?

regards

NocturnalScream avatar Nov 20 '14 14:11 NocturnalScream

@maxtaco any ideas? (I know it can get crazy around the holidays, so no pressure)

CyborgMaster avatar Dec 04 '14 22:12 CyborgMaster

I'm experiencing the same problem, but in a completely different environment. It used to work fine with an older Iced CoffeeScript version (1.7.1-b I believe) but now I get the exact same errors as CyborgMaster.

As mentioned the environment is very different; I run this on Windows in a bare instance of MS Chakra JS engine (as COM object, not within a browser, so there is no "window" object etc.).

I think that the assertion is no longer valid: "The core compiler however [...] can be run in any JavaScript environment" - it seems to rely on either a browser with a window object (where events are attached) or a node.js-style module system. When run in a bare JS environment as in the case of CyborgMaster and me it fails and due to the minimized/obfuscated wrapper around the compiler source I find it very difficult to pinpoint the exact issue.

Edit: I've played around some more and have come to the following code which works in my environment, adding CoffeeScript as global object. As starting point I took the non-minified file from the extras and replaced the beginning and end as follows, effectively removing the original code which does the detection of the available environment (everything in between the one overlap line remains identical):

CoffeeScript = (function(repository) {
        var modules = {};
        function process(id) {
            if (!modules[id]) {
                var module = modules[id] = { exports: {} };
                repository[id][0].call(module.exports, function(depName) {
                    return process(repository[id][1][depName]);
                }, module, module.exports);
            }
            return modules[id].exports;
        }
        return process(2); // ID of main compiler in repository
    })(
//----MODULES START----
{1:[function(_dereq_,module,exports){

and

},{"./const":17,"FWaASH":14}]}
//----MODULES END----
);

While this is certainly not a universal fix it may get @CyborgMaster on track as well.

avonwyss avatar Mar 01 '15 01:03 avonwyss

I just ran into another sad encounter where I wished I had iced coffee script. Anyone have any updates here?

CyborgMaster avatar Nov 26 '15 07:11 CyborgMaster