These are chat archives for opal/opal

27th
Aug 2015
Rick Carlino
@RickCarlino
Aug 27 2015 02:26
Just bought my RubyConf tickets. Hope to see you there!
Jamie Gaskins
@jgaskins
Aug 27 2015 02:58
@Qqwy Try replacing console.log with pp (also require 'pp').
Qqwy / Wiebe-Marten
@Qqwy
Aug 27 2015 06:13

@jgaskins: Good catch, although in my environment (nwjs), console.log is set up properly, also as an Opal function. Replacing it with prettyprint does not solve the problem.
Nor does something like

Native.call(radium, 'on', 'radiation') do |ray|
      pp ray
end

change the outcome.

Elia Schito
@elia
Aug 27 2015 12:54
@elia i think documentation improvements are good, but opalrb.org is where people are most likely to land, i would start by improving that
@dancinglightning the plan is to embed/link all docs guides into it, the difference would be they'd be available for different versions (similarly to what happens for rails)
Bernhard Weichel
@bwl21
Aug 27 2015 14:19
@Qqwy in my APP i use a Static compilation of the opal code. I guess it is possible to include and run an Opal Server which resolves the requires. But i do not know.
ingemar
@ingemar
Aug 27 2015 14:57

Hello! I would deeply appreciate if someone could give me some pointer on how to use Browser::DOM::MutationObserver. I thought this would work:

    begin
    puts "supported? #{Browser::DOM::MutationObserver.supported?}"

    options = { children: true, tree: true, attributes: true }

    observer = Browser::DOM::MutationObserver.new do |*args|
      puts args.inspect
      puts "  ==> change was observed <=="
    end

    element = Element['ul']
    observer.observe element, options
    element.add_class('foo')

    rescue => error
      puts error
    end

Output:

# supported? true
# Failed to execute 'observe' on 'MutationObserver': The provided node was null.
meh.
@meh
Aug 27 2015 15:00
where is Element coming from?
ingemar
@ingemar
Aug 27 2015 15:11
meh: I'm picking ut up from the page DOM. It's there if I do a puts on element
meh.
@meh
Aug 27 2015 15:11
ingemar, no I mean, is it coming from opal-jquery or what?
ingemar
@ingemar
Aug 27 2015 15:11
yes, opal-jquery
meh.
@meh
Aug 27 2015 15:12
yeah, that's not gonna work
you have to get element with opal-browser as well
ingemar
@ingemar
Aug 27 2015 15:12
aha
meh.
@meh
Aug 27 2015 15:12
it will work if you give it the native DOM element
but you're giving it a jquery object
ingemar
@ingemar
Aug 27 2015 15:16
meh: Alright, I'll try that!
meh: Hmm.. how do I do that? #to_n?
meh.
@meh
Aug 27 2015 15:20
ingemar, I don't know, never used opal-jquery
ingemar
@ingemar
Aug 27 2015 15:25
meh: haha, OK. thanks.
This works:
element = Element['ul']
observer.observe element.get(0), options
element.add_class('foo')
meh: Thanks for holding my hand.
meh.
@meh
Aug 27 2015 15:28
:)
ingemar, but yeah, using opal-jquery and opal-browser at the same time is kind of pointless :P
they do the same thing
ingemar
@ingemar
Aug 27 2015 15:31
JLMRMA
Just Let Me Refactor My App
meh.
@meh
Aug 27 2015 15:31
lol
Qqwy / Wiebe-Marten
@Qqwy
Aug 27 2015 15:49
I will remember the JLMRMA acronym. Seems like a nice 'hangman' word to bug my colleagues with.
Ryan Stout
@ryanstout
Aug 27 2015 17:14
hey, how is everyone? Just curious how 0.9 is going and expected release time. (No rush, just trying to plan for the future)
Joiey Seeley
@bigtunacan
Aug 27 2015 20:59
@dfyx Is your opal-electron stuff available to try out anywhere?
meh.
@meh
Aug 27 2015 21:45
ryanstout, no clue, it's pretty much just @elia doing release stuff
ryanstout, but, lots of fixes and additions by me :^)
ryanstout, now Numeric, Rational and Complex are mostly fully compliant with Ruby
although nobody will care
ryanstout, also fixed a bunch of Module/Class/Object/Kernel stuff
ryanstout, oh, also /(singleton)?method(added|removed|undefined)/ now work
meh.
@meh
Aug 27 2015 21:54
so yeah, there will be a lot of stuff nobody will ever use :D
Ryan Stout
@ryanstout
Aug 27 2015 22:59
@meh I'll probably use singleton_added/removed :-) And the bug fixes. Thanks for the hard work. Also, I was pretty excited about the opal/mini :-)