These are chat archives for opal/opal

9th
Jun 2016
Mitch VanDuyn
@catmando
Jun 09 2016 13:05
@elia do u know if there r any barriers to getting opal-rails on master running with opal 0.8? If not I will give it a whirl
Elia Schito
@elia
Jun 09 2016 13:42
@catmando it's possible that some APIs changed

@elia - latest opal-rails-rspec doesn't have the nice list of spec links so you can rerun tests by clicking a link... any way to turn it back on in a config or something?

@catmando it's still WIP, except for the Progress :D

Mitch VanDuyn
@catmando
Jun 09 2016 14:25
@elia - looks like you just did a commit to explicitly make opal-rspec-rails depend on 0.9 ???
Brady Wied
@wied03
Jun 09 2016 14:26
@catmando - I probably should stay out of this and I know you're trying to ensure compatibility since you have a lib, but I think it's OK to track opal aggressively until it hits 1.0ish stage
@elia - you did mention needing some help w/ opal-rspec-rails, I can if you can document some of what you want done in an issue
Elia Schito
@elia
Jun 09 2016 14:30
@catmando yes, I started working on it before releasing 0.9, definitely need to update the gemspec
@wied03 thanks very much, I'll try to do that tonight
(~7h)
Mitch VanDuyn
@catmando
Jun 09 2016 14:31
@elia - I dont' udnerstand.... you just updated the gem spec to lock it 0.9
@wied03 there are changes in 0.9 that while being bug fixes, they are also breaking changes, so I think its important to allow the reactrb gems to work with 0.8 and 0.9
I mean this is a real pain, so i would love to be persuaded I don't need to worry about it.
Elia Schito
@elia
Jun 09 2016 14:33
@catmando "just" means days ago right?
Mitch VanDuyn
@catmando
Jun 09 2016 14:33
11 days ago I think
Elia Schito
@elia
Jun 09 2016 14:34
yeah, probably didn't want to support 0.8 on the new version because of API changes
Mitch VanDuyn
@catmando
Jun 09 2016 14:34
well I see the commit was actually Jan 18, but it got pushed 11 days ago
Elia Schito
@elia
Jun 09 2016 14:36
ah ok, I guess 11 days ago I realized I had accumulated stuff local to my machine :)
Mitch VanDuyn
@catmando
Jun 09 2016 14:36
okay well I am going to try pulling back to 0.8 and see what happens
Elia Schito
@elia
Jun 09 2016 14:36
👍🏼
Mitch VanDuyn
@catmando
Jun 09 2016 15:47
@elia / @wied03 got things sort of working with opal-rspec-rails and opal 0.8. The problem is it runs all the specs, then loops back and begins running them all again... any clues as to why?
Brady Wied
@wied03
Jun 09 2016 15:48
infinite or just twice ?
Mitch VanDuyn
@catmando
Jun 09 2016 15:53
@elia / @wied03 - its specific to opal-rspec-rails... there is a monkey patch that looks like this:
# Patch the RSpec runner to work with Kernel.exit
RSpec::Core::Runner.class_eval do
  def self.autorun
    at_exit do
      # see NoCarriageReturnIO source for why this is being done (not on Node though)
      err, out = get_opal_closed_tty_io
      # Have to do this in 2 places. This will ensure the default formatter gets the right IO, but need to do this in config for custom formatters
      # that will be constructed BEFORE this runs, see rspec.rb
      run(ARGV, err, out).then do |status|
        exit 0
      end
    end
  end

  def self.exit_with_code(code)
    exit(code)
  end
end
no idea what exit, at_exit, and exit_with_code are all about...
removing that patch fixes the problem
Brady Wied
@wied03
Jun 09 2016 15:56
@elia - As you know, I was never a fan of the at_exit stuff. Now that opal-rspec-rails is separate anyways, can a more stock (as in out of the box opal-rspec) approach be used?
Mitch VanDuyn
@catmando
Jun 09 2016 15:58
what is this supposed to do anyway?
Brady Wied
@wied03
Jun 09 2016 15:59
@catmando - these are various techniques for running specs and getting the results back without having to litter spec files/spec helpers with rspec code
opal-rspec out of the box basically includes all your specs first and then the last line tells RSpec to run them
Mitch VanDuyn
@catmando
Jun 09 2016 16:00
right
Brady Wied
@wied03
Jun 09 2016 16:00
a different way of doing it is to put at_exit anywhere in the code such that Kernel#exit will run it last without having to guarantee code placement
Mitch VanDuyn
@catmando
Jun 09 2016 16:04
so this is providing a feature so that you can call RSpec::Core::Runner.exit_with_code ?
Brady Wied
@wied03
Jun 09 2016 16:04
sort of. out of the box, the opal-rspec rake task does that for you
for a while opal-rails was providing its own task, etc.
meeting, bbbl
Elia Schito
@elia
Jun 09 2016 16:10

@elia - As you know, I was never a fan of the at_exit stuff. Now that opal-rspec-rails is separate anyways, can a more stock (as in out of the box opal-rspec) approach be used?

I'm fine with it, the main requirement for opal-rspec-rails is that it uses the Rails sprockets env instance because of paths and processors. An other important feature is running in the browser and possibly a CLI as in bin/opal-rails.

Mitch VanDuyn
@catmando
Jun 09 2016 16:25
so i'm going to do a PR removing the 0.9 restriction, and I will pull out the exit_with_code patch okay?
I notice the tests are not all passing, so I will also try to get them fixed if I can...
FYI all reactive-record specs (which uses opal-rspec-rails) are passing with opal 0.8 as well.
Mitch VanDuyn
@catmando
Jun 09 2016 16:31
also I had to remove the require to stdlib console and platform, I can but rescues around them, but they don't seem to be used....
Forrest Chang
@fkchang
Jun 09 2016 21:24
I really like this, think I should base a code of conduct off of this https://twitter.com/fkchang2000/status/741013016242573312