<denysonique>
Is it possible to use Opal with an existing js library?
<denysonique>
such as Backbone or moment.js?
e_dub has quit [Ping timeout: 264 seconds]
e_dub has joined #opal
<e_dub>
denysonique, yes. HOW that is done is in flux at the moment though, and so I'm not sure what the current way to do it is
<e_dub>
for a while we had a bridge where "$global" in Opal was equal to "window" or "global" in the js env
<e_dub>
dunno if that is still working though
<e_dub>
so, in that case, if you wanted to call, say jQuery, you would do, say $global.jQuery('div').css(blahblahblah)
<denysonique>
e_dub: thanks
<denysonique>
but thins like $global.Backbone.View won't work
<denysonique>
things
<denysonique>
I cannot access the View property of Backbone
<denysonique>
even if I try $global.Backbone::View
<e_dub>
hmm i dont know if thats because they have already started removing that to change it, or if its because its flaky (which is part of why its being removed)... lemme see if i can figure out
<meh`>
adambeynon, we need a wiki page where we say what common gems work out of the box
elia has quit [Quit: (IRC Client: textualapp.com)]
elia has joined #opal
<adambeynon>
meh`: that parser bug is going to take a lot longer than I thought
<adambeynon>
we are going to totally need a numeric parsing code
<meh`>
oh snap
<meh`>
my dreams shattered
<adambeynon>
it needs to be fixed
<adambeynon>
but its also going to take many hours + lots of coffee
<fkchang>
adambeynon: re: embeddable in any app. What I think I was going to do in that regard was something along the following steps
<fkchang>
1) have a method that creates the html elements to attach opal-irb to - something that shows up from the bottom and is open/closeable, right now you pass it the id of a div to run in
<meh`>
adambeynon, I understand
<meh`>
I'll try with master parslet
<meh`>
I think I saw that line was changed
<fkchang>
2) take the inline css and make it a separate file. I was could put that in a file and include it, but I sort of like the idea of the creation method installing that into the dom, so the interface is something like OpalIrbJqconsole.createAtBottom(); which does all the js and css magic
<meh`>
adambeynon, lol
<meh`>
adambeynon, a different parser bug
<meh`>
this one should be easy to fix tho
<fkchang>
I'd want sort of the equivalent of Template["blah"].render, but like Css["blah"].render, so I could have a separate css file that my editor can give me css support on, but not have to include it in the html directly
<fkchang>
curious to look at it. I've been able to build opal-inspector w/o any frameworks thus far - partly coz ruby in the browser is awesome, partly coz I haven't needed framework features, partly coz I haven't been able to figure out how vienna works
<fkchang>
was thinking I might do something like FB's react lib for the View part - http://facebook.github.io/react/index.html, it seems to take a similar approach to what I've stared to do
<fkchang>
meh`: looks like u pushed 4 days ago
<meh`>
fkchang, yeah, I'm just writing what I need for my stuff
<meh`>
adambeynon, sorry to bother, what are you working on now?
<adambeynon>
bit of everything. working on a "technical demo" of opal for some potential collaborators
<adambeynon>
whatever "technical demo" means
<adambeynon>
why? whats up?
<meh`>
adambeynon, the new parser bug I linked you above
<meh`>
that shouldn't take much to fix
<adambeynon>
ok, will get it fixed in a bit
<meh`>
ok, thanks
<meh`>
adambeynon, parser bugs everywhere :(
<meh`>
found another inside parslet
<meh`>
adambeynon, I think I'll open few issues
<meh`>
or just one
<adambeynon>
meh`: if they are unrelated, open 1 for each
GitHub173 has joined #opal
<GitHub173>
opal/master 617461b Adam Beynon: Fix constant lookups on metaclass of objects
<GitHub173>
[opal] adambeynon pushed 1 new commit to master: http://git.io/QS14PQ
GitHub173 has left #opal [#opal]
<adambeynon>
easier to keep track of what needs doing then
<meh`>
adambeynon, I was keeping them together because they're all related to getting parslet running
elia has quit [Ping timeout: 260 seconds]
<meh`>
adambeynon, we don't have nested argument splats, do we?
<fkchang>
adambeynon: what would the easiest way to export opal-irb for something to you to embed? Do I need to make some library that you add as <script src="blah"> on top of the doing the same for opal and opal-jquery - not certain what the non opal-sprockets option is, or just make the classes and assume u will use opal-sprockets and just include the right stuff?
<fkchang>
adambeynon: the other thing I was hoping to figure out how to resolve was the other libs I depend on, codemirror and my fork of jqconsole
<fkchang>
ideally, if I could have opal-irb smartly determine if they are present to not include them, that would work, or we make the embedder include those things
adambeynon has quit [Ping timeout: 240 seconds]
adambeynon has joined #opal
elia has joined #opal
<fkchang>
adambeynon: catch my embeddable questions?
<adambeynon>
fkchang: yep, thanks for that. the CSS is an interesting one - some way to embed css like we do wtih erb templates is a thought
GitHub26 has joined #opal
<GitHub26>
opal/master d19a7ec Adam Beynon: Fix bug for parsing operators before \n in command calls (#334)
GitHub26 has left #opal [#opal]
<GitHub26>
[opal] adambeynon pushed 1 new commit to master: http://git.io/v9N7dQ
<adambeynon>
meh`: that should fix one of the bugs (for parsing >> before a new line)
<fkchang>
adambeynon: I think I had a 2nd round of questions for you a 1/2 hour ago that might've been missed coz it looks like your irc connection fell asleep, did you get that? It's basically, how do I package opal-irb best for you (or anyone). I'm thinking on counting on opal-sprockets is a lower effort way
travis-ci has joined #opal
<travis-ci>
[travis-ci] opal/opal#777 (master - d19a7ec : Adam Beynon): The build passed.
<adambeynon>
which would add that content to some CSS object, as you suggested
<fkchang>
I'm making an embedded example, I will extract the css file as single file and add the methods to create the collapsable panel, which I think u should be able to use
<adambeynon>
similar to the way we have Template[] for erb stuff
<adambeynon>
or even, just overload require
<adambeynon>
require "my_file.css"
<adambeynon>
require "my_template.erb"
elia has joined #opal
<adambeynon>
then custom gems, e.g. a haml compiler, can just register how opal should handle it
GitHub102 has joined #opal
<GitHub102>
opal/master b05d6d2 Adam Beynon: Add some missing singleton class specs
GitHub102 has left #opal [#opal]
<GitHub102>
[opal] adambeynon pushed 1 new commit to master: http://git.io/-Ywraw
travis-ci has joined #opal
<travis-ci>
[travis-ci] opal/opal#778 (master - b05d6d2 : Adam Beynon): The build passed.
<adambeynon>
I think the specs depended upon the mri implementation of it
<meh`>
oh
<meh`>
okay then
<adambeynon>
im not sure
<adambeynon>
again
<adambeynon>
it depends on how many mri specs we aim to pass
<adambeynon>
we wont pass them all as im sure there would be a spec for the mutex stuff
<fkchang>
adambeynon: I just pushed an embeddable example to opal-irb, hopefully that's enough for you to embed it in your app
<adambeynon>
fkchang: awesome, will check it out
<fkchang>
index-embeddable.html and examples/app-embeddable.rb
<adambeynon>
nice!
<meh`>
fkchang, cool stuff
<meh`>
adambeynon, oh right, now that I remember
<meh`>
I've been having some issues with that spec helper you gave me
<fkchang>
thx, if the markup wasn't such a mess I should push opal-inspector to github w/a similar embedded example , though there's a lot to do before I could do that, it's all 1 rb file at the moment
<meh`>
I have to change the IDs I use in every spec or so because it's somehow slow in updating the DOM
<meh`>
so I get failed tests because it's using the old elements
<meh`>
nothing major, but a pain in the ass nontheless
<adambeynon>
strange, I havent experienced that
<meh`>
I'm using a 5 years old laptop :P
<adambeynon>
oh right, sorry, I see what you mean now
<adambeynon>
yeah, it does mean ripping the dom out on each spec
<meh`>
if there was a way to wait or something it would be enough I think
<meh`>
some way to have async before/after
<meh`>
and god, these new HTML5 events are awful
<meh`>
I have the feeling opal-browser will be the first library to handle events properly
<adambeynon>
hope so! :D
<meh`>
I saw jQuery's event handling
<meh`>
it's awful
<meh`>
the creationg/triggering is all wrong
<meh`>
probably done for the sake of compatibility
<meh`>
but with opal we have a way nicer way to handle that
<meh`>
having browser specific files that monkeypatch everything to work
<meh`>
so we can default to standards
<meh`>
and add fixes incrementally
<meh`>
without polluting the logic
DrShoggoth has joined #opal
<adambeynon>
yeah, sounds good
vwoo has joined #opal
vwoo has quit [Client Quit]
vwoo has joined #opal
vwoo has quit [Client Quit]
vwoo has joined #opal
vwoo has quit [Client Quit]
vwoo has joined #opal
GitHub124 has joined #opal
<GitHub124>
opal/master aa4f272 Adam Beynon: Parse operator calls as normal method calls
GitHub124 has left #opal [#opal]
<GitHub124>
[opal] adambeynon pushed 1 new commit to master: http://git.io/Qt582A
<fkchang>
what do you guys think about adding jsfiddle type features to opal-inspector or as a standalone?
<e_dub>
fkchang, like, as a way to save and share small snippets and whatnot with others? sounds pretty awesome. we'll certainly eventually need somewhere for that sort of thing, since its unlikely existing solutions will make it available until opal grows more widespread
<fkchang>
save and share snipped we can do already via opal-irb, which I feel is interesting in that I think of that feature as something like a live gist, you can mess/the code in irb, re edit the original, while persisting objects, which is something that none of the jsfiddle type apps can do. I was thinking the ability to mess w/share css and markup too would just level up the experience
<fkchang>
opal-inspector inherits the existing capability from opal-irb
_whitelogger has joined #opal
<e_dub>
fkchang, yeah ? that's awesome. i agree though, that making it easy to get into the css and markup is a good idea
meh` has quit [Ping timeout: 245 seconds]
elia has quit [Read error: Connection reset by peer]
elia has joined #opal
elia has quit [Read error: Connection reset by peer]
elia has joined #opal
vwoo has quit [Quit: Computer has gone to sleep.]
elia has quit [Quit: (IRC Client: textualapp.com)]