These are chat archives for opal/opal

24th
Apr 2015
Forrest Chang
@fkchang
Apr 24 2015 00:34
@elia @adambeynon so what's in 0.7.2?
Elia Schito
@elia
Apr 24 2015 00:37
Basically just fixed ENGINE_VERSION inside Opal
opal/opal#806
Penn Su
@pencilcheck
Apr 24 2015 05:48
so opal is rubyfire?
Adam Beynon
@adambeynon
Apr 24 2015 06:08
@pencilcheck rubyfire is a MVC style library that uses Opal. It is being extracted from a production app, but isn’t yet ready (taking longer than expected/not enough time to finish getting it ready)
it is similar to vienna, which is on github already
Penn Su
@pencilcheck
Apr 24 2015 06:10
Ah I see
Jared White
@jaredcwhite
Apr 24 2015 15:29
@adambeynon @meh Hmm, this feels like a bug to me. For example, using jQuery directly this works as I would expect:
$.get('/fooling/jsontest').done(function() {
  alert('$.get done!');
}).fail(function() {
  alert('$.get failed!');
}).always(function() {
  alert( "$.get finished" );
});
There, the code in the always callback is run whether or not the promise was resolved or rejected
meh.
@meh
Apr 24 2015 15:34
@jaredcwhite makes sense, I'll give it a shot.
Forrest Chang
@fkchang
Apr 24 2015 17:33
@meh get a chance to check the paggio project?
meh.
@meh
Apr 24 2015 17:33
@fkchang not yet, I'll do it after the Promise stuff
Forrest Chang
@fkchang
Apr 24 2015 17:34
ok, cool
Jared White
@jaredcwhite
Apr 24 2015 20:21
@meh Cool, thanks
ylluminate @ylluminate applauds @AstonJ & @elia for Twitter crusade.
Ryan Stout
@ryanstout
Apr 24 2015 21:27
did 0.7.2 go back to sprockets, or is that waiting for 0.8?
ylluminate
@ylluminate
Apr 24 2015 21:27
I thought I saw .8
AstonJ
@AstonJ
Apr 24 2015 21:36
Thanks @ylluminate - I’m glad that conversation happened, because I will feel less guilty about supporting, promoting and helping Volt now; nobody can say we didn’t try our hardest to try and get DHH to adopt Opal/full stack Ruby.
Elia Schito
@elia
Apr 24 2015 21:38
@ryanstout 0.7.2 just fixes RUBY_ENGINE_VERSION
unless I messed up very badly :fearful:
Ryan Stout
@ryanstout
Apr 24 2015 21:39
@AstonJ DHH has a vested interest to keep things the same. (imho)
@elia no, I was just curious
Elia Schito
@elia
Apr 24 2015 21:42
I think opal should be a good rails citizen, and rails & volt can be friends too :)
I don't like confrontational style very much as it yields very few results
Ryan Stout
@ryanstout
Apr 24 2015 21:42
true :-)
yea, I like DHH actually :-)
just saying he has more incentive to move slowly, because too many changes and he'll lose people
which is very understandable
AstonJ
@AstonJ
Apr 24 2015 22:06
I like DHH as well, I have a huge amount of respect for him both in relation to Ruby related stuff and personal stuff. I like that he stands up for what he believes in (often for the underdogs or those who are persecuted - something that I think takes guts) and of course I love Rails. But I love Ruby more. I think, like @ryanstout, that Rails has stagnated. It is 10 years old, and although they have done an amazing job to remain relevant, apps (note I don't say 'the web') is a very different place now. I think MVVm is more relevant, I think isomorphic Ruby is nicer (which should equate to better productivity), I think scalability is no longer an option and I think bags of old code and functionality that nobody uses anymore is a hinderance. This is why I am so excited about Volt - it is fresh, and has that certain something, that pizazz, that I think can capture the imagination of the next generation of developers/development.
I also think there is only so much you can achieve by being nice @elia, we've tried to get DHH to consider Opal for a while now, you and Adam even went to the trouble of giving him Active Support when that was his main criticism! I think we just have to accept that we have to make our own path. And I think it's totally fine that there will be inroads back to us (developers leaving Rails, Ember, etc) ...and that is only down to them, for not recognising that people wanted a pure (ish) Ruby option and all the other things that Volt and Opal is offering us.
Elia Schito
@elia
Apr 24 2015 22:11
I have no need to convince dhh to adopt opal, nicely or otherwise, having people that care and build awesome stuff is enough and in the long run all other players will notice. Rails had plenty of criticism, but I guess by now is quite established tech
I'd rather see energy spent making opal docs and improving the experience for newcomers
another example: RSpec prospers even if dhh kinda hates it
also the small part of activesupport I implemented was for me :P
AstonJ
@AstonJ
Apr 24 2015 22:16
It is the logical choice imo. Rails is Ruby, and most Rubyists love Ruby and want to write Ruby not JS. But yeah I agree with you, docs are severely lacking for Opal - we need some newbie guides. I keep toying with the idea of doing screen casts at Metaruby.com - just can’t fidn the time.
meh.
@meh
Apr 24 2015 22:18
I don't care either way, I just wanted Ruby in the browser :D
Elia Schito
@elia
Apr 24 2015 22:19
that's how we roll
lol
AstonJ
@AstonJ
Apr 24 2015 22:20
Me too @meh! I don’t like JS (nor most other lamguages tbh - think I have a mental block!) give me Ruby any day of the week :grinning:
Elia Schito
@elia
Apr 24 2015 22:21
@meh switching gears, I'm trying to port optparse, and had to "implement" throw/catch, wdyt?
  def catch(name)
    $__throwables__ ||= {}
    throwable_class = ($__throwables__[name] ||= Class.new(ArgumentError) { attr :object })
    begin
      yield
    rescue throwable_class => throwable
      throwable.object
    end
  end

  def throw(name, object = nil)
    $__throwables__ ||= {}
    throwable_class = ($__throwables__[name] ||= Class.new(ArgumentError) { attr :object })
    throwable = throwable_class.new
    throwable.object = object
    raise throwable
  end
in Kernel
meh.
@meh
Apr 24 2015 22:23
wait, we don't have throw/catch?
Elia Schito
@elia
Apr 24 2015 22:23
doesn't seem so
meh.
@meh
Apr 24 2015 22:23
I think you should make Throwable class
or something
Elia Schito
@elia
Apr 24 2015 22:23
you were using it to implement Promise#always? ;)
meh.
@meh
Apr 24 2015 22:23
instead of feeding off ArgumentError
nope
I just designed that part in a retarded way
Elia Schito
@elia
Apr 24 2015 22:24
jk
meh.
@meh
Apr 24 2015 22:24
I didn't consider always would have to act that way
Elia Schito
@elia
Apr 24 2015 22:26
btw optparse implementation (by nobu + another guy) is really a mess
or at least not easily readable
Ryan Stout
@ryanstout
Apr 24 2015 22:28
@elia I've tried to read through optparse, its rough :-)
I think it's really really old though
Elia Schito
@elia
Apr 24 2015 22:29
yea, there are blobs of code that look a lot like C
Ryan Stout
@ryanstout
Apr 24 2015 22:30
@elia or @adambeynon any idea why require '...' wouldn't actually include code when using Opal.compile
or am I missing something obvious
Elia Schito
@elia
Apr 24 2015 22:32
Opal.compile == Opal::Compiler.new(…).compile irrc
I suggest using: compiler = Opal::Compiler.new(…); compiler.compile; compiler.requires which gives you the list of requires from a compiled file
Opal::Compiler is low level, Opal::Builder takes care of fetching requires
@ryanstout when requirable: true is passed to Opal::Compiler it will compile inside Opal.module (js)
then you'll be able to require the file in opal-land with Kernel#require (opal)
inception, as always
Ryan Stout
@ryanstout
Apr 24 2015 22:35
so maybe I should be using Opal::Builder. The problem is right now I have to start with a string of code. Would that still work?
or is Opal::Builder for working with files?
Elia Schito
@elia
Apr 24 2015 22:35
Use Opal::Builder#build_str
alas you have no other option than checking the source to see docs, params, etc.
Ryan Stout
@ryanstout
Apr 24 2015 22:36
no worries, I can read through the source :-)
cool, that might have answered another question I had
Elia Schito
@elia
Apr 24 2015 22:37
feel free to add documentation! :P
Ryan Stout
@ryanstout
Apr 24 2015 22:43
is Opal::Builder going away in 0.8?
Elia Schito
@elia
Apr 24 2015 22:47
no, but I think it will stick with current 0.7 implementation, that kinda reinvents the sprockets wheel