These are chat archives for opal/opal

May 2016
Mitch VanDuyn
May 26 2016 01:30
@elia any clever way to conditionally require something that is in a gem
I tried
require 'sources/react' unless defined? NOREACTJS

and then previous to the require of the gem I did a


did not work... any other way to do this?

Jamie Gaskins
May 26 2016 05:05
Conditional requires are awkward because a require is done at compile time. I think a workaround was tried, but I don't think it did well.
Bernhard Weichel
May 26 2016 11:42
Is the digest module available in opal?
Forrest Chang
May 26 2016 16:05
@jgaskins hmm, how about some kind of dynamic_require that goes back to the app's server and pulls the file as appropriate
Brady Wied
May 26 2016 16:17
@jgaskins @elia - Maybe Travis isn't being honest about timing but some of these dup things would appear to have dramatically improved opal-rspec runtime. As in 13 min to 4 min. -
Brady Wied
May 26 2016 16:31
@bwl21 - Not yet. the stdlibs that are there are @
Jamie Gaskins
May 26 2016 23:03
@fkchang I've wondered about that, too, but making it work async is probably tricky.

For example, what would happen in this scenario:

dynamic_require 'foo'

f =

Making dynamic_require work async would mean that the following line is most likely executed before the request returns. Making it work synchronously means it locks the UI. :-\

Forrest Chang
May 26 2016 23:55
how about
dynamic_require 'foo' do
  f =
then promisify it
still could have issues in sequencing, but at least some sort of way to wait for the load