These are chat archives for opal/opal

2nd
Jul 2015
Jamie Gaskins
@jgaskins
Jul 02 2015 03:14

@fkchang Re: "Lissio's way (doesn't have to be lissio, but no other framework does it) of combining markup, style and behavior into 1 coherent ruby class" — Clearwater does it pretty similarly to React: https://gist.github.com/jgaskins/746f65ccbf267dca36a6

Notice { style: style } in some of the attribute hashes.

It's pretty awesome. It makes components completely self-contained, which makes it possible to extract your components to gems without having to add stylesheets for them.
Jikku Jose
@JikkuJose
Jul 02 2015 05:20
@catmando thanks for taking a look; I was going mad about why that wasn't working! Did you mean to say super method cannot be trusted to work as it should be?
Other than that; I don't see any problem with this: http://tinyurl.com/opal-box-class
@fkchang great work with Opal playground; perhaps a short url generating system can be built to share the links easily
Forrest Chang
@fkchang
Jul 02 2015 06:59
@jgaskins cool, I will have to get around to checking it out
@JikkuJose thx, maybe a bit.ly or similar interface or something
Jikku Jose
@JikkuJose
Jul 02 2015 07:21
@fkchang yes! It will make copying a breeze
Elia Schito
@elia
Jul 02 2015 07:27
@fkchang @JikkuJose I suggest https://git.io
CJ Lazell
@cj
Jul 02 2015 14:30
@elia so is the reason it’s not getting passed because it’s not in a white list. similar to roda assets? can’t we just remove the self for now so that it works?
Elia Schito
@elia
Jul 02 2015 14:32
@cj self it's a sprockets thing so it's not a choice. The code you posted uses sprockets or it's something based on roda or custom?
CJ Lazell
@cj
Jul 02 2015 14:33
It’s using the code you gave me before. but it can’t get past this line https://github.com/opal/opal/blob/master/lib/opal/sprockets/source_map_server.rb#L85
the .map file exists, because if I remove .self it will work
that line in the opal code would never pass as the regex is looking for some_file.self.map
but the file is just some_file.map
Elia Schito
@elia
Jul 02 2015 14:38
What I don't get is why the files are there without the .self extension
CJ Lazell
@cj
Jul 02 2015 14:39
@elia so are they supposed to be some_file.self.map?
because the file it’s looking for and adds to the js is some_file.map
Elia Schito
@elia
Jul 02 2015 14:50
@cj yes, they're supposed to have that .self, is your sprockets environment using debug mode?
Elia Schito
@elia
Jul 02 2015 14:53
@cj maybe you're calling assets without the ?body=1 param
CJ Lazell
@cj
Jul 02 2015 14:53
@elia ye I’m not doing that, didn’t know you had too lol…. is that another hack?
wow… adding that makes it work… random
Elia Schito
@elia
Jul 02 2015 14:56
no, it's how sprockets expect assets to be called for debugging, works out of the box in rails so I didn't thoght about it before
remove any sprockets cache you may have
CJ Lazell
@cj
Jul 02 2015 14:58
@elia thank you again. we should have docs for wedge soon. it’s pretty awesome :)
Elia Schito
@elia
Jul 02 2015 14:58
:+1: happy to help
CJ Lazell
@cj
Jul 02 2015 15:07
those links work btw
@elia so another random issue when doing http://local.sh/assets/wedge/wedge.js?body=1 it doesn’t include opal, going to http://local.sh/assets/wedge/wedge.js does
Elia Schito
@elia
Jul 02 2015 15:08
yes because you're supposed to have a script[src] tag for each body=1 script
you can checkout the sprockets-rails helper.rb to see how it's done in rails
but more or less should be something like sprockets_env['wedge.js'].to_a
for each entry you need a script tag
CJ Lazell
@cj
Jul 02 2015 15:10
that seems terrible https://github.com/wedgeio/wedge/blob/master/lib/wedge.rb#L1-L21, I now see why that other person was suggesting being able to group them up
Elia Schito
@elia
Jul 02 2015 15:11
yep, I tried to merge maps together in 0.7 but they were broken and I wasnt' able to debug the problem
so in opal 0.8 we've gone back to separated assets
lol
Elia Schito
@elia
Jul 02 2015 15:14
lol
@cj try this impl
CJ Lazell
@cj
Jul 02 2015 15:15
I guess I’ll just add that in for now then, damn sprockets! that’s why I use roda assets :)
ha… that’s what I was going to do… that’s fine for the main .js file. but the files you are requring via ajax I guess all need to be split up if they require other files right?
Elia Schito
@elia
Jul 02 2015 15:17
I guess so
CJ Lazell
@cj
Jul 02 2015 15:17
so basically if a rb file requires another file I have to make that a seperate file request, right?
Elia Schito
@elia
Jul 02 2015 15:17
yep
CJ Lazell
@cj
Jul 02 2015 15:18
I think I just threw up a little
Elia Schito
@elia
Jul 02 2015 15:19
if you find a good way to merge sourcemaps when concatenating assets I'll add it immediately (so to speak)
Jared White
@jaredcwhite
Jul 02 2015 15:20
@elia BTW, that latest require_self patch you did fixed all my sprockets problems. Sooo excited for the final 0.8 release!!!
Elia Schito
@elia
Jul 02 2015 15:20
@jaredcwhite the one in the PR?
CJ Lazell
@cj
Jul 02 2015 15:20
@jaredcwhite what sprocket problems were you having?
Jared White
@jaredcwhite
Jul 02 2015 15:20
I mean require_tree
Elia Schito
@elia
Jul 02 2015 15:20
yeah, I'll backport it to the 0-8-stable branch
maybe it's time to release after all cc @meh @adambeynon
Jared White
@jaredcwhite
Jul 02 2015 15:22
@cj I had a require_tree '.' In my application.js.rb file and that wasn't working. But it's now with Elia's PR
Elia Schito
@elia
Jul 02 2015 15:22
@cj good point, that's to bootstrap the main file since letting sprockets manage single files makes them all compile as "requireable"
so the main file needs to be required (as in Opal.require('wedge'))
the code you linked also takes care of stubbed and non opal files
CJ Lazell
@cj
Jul 02 2015 15:23
interesting… thank you
CJ Lazell
@cj
Jul 02 2015 16:41
@elia something just pushed to opal has broken opal-rspec it gives this error TypeError: 'undefined' is not a function (evaluating 'lhs['$-'](rhs)')
figuring out which commit broke it right now
Elia Schito
@elia
Jul 02 2015 16:41
thanks, that's useful work
CJ Lazell
@cj
Jul 02 2015 16:46
I think it’s the new time stuff… going to take me some time to pinpoint the commit, there are a lot! lol
Elia Schito
@elia
Jul 02 2015 16:48
@cj even a simple snippet that demonstrates the error would be great
CJ Lazell
@cj
Jul 02 2015 16:48
I’m just getting it when I run opal-rspec
with the latest opal
opal/master that is
CJ Lazell
@cj
Jul 02 2015 16:54
@elia ok, it’s this commit that broke it opal/opal@c55b41b
Elia Schito
@elia
Jul 02 2015 16:56
I guess @vais will have some fun with it when he comes back online :birthday:
@cj can you open an issue on GH?
CJ Lazell
@cj
Jul 02 2015 16:57
yee, trying to think of an easy re-create
Elia Schito
@elia
Jul 02 2015 17:01
:+1:
CJ Lazell
@cj
Jul 02 2015 17:03
@elia @vais opal/opal#972
I’m a bug magent lol
ylluminate
@ylluminate
Jul 02 2015 18:32
we're still looking for some input on this: opal/opal#965
been about 6 days... :)
Forrest Chang
@fkchang
Jul 02 2015 18:46
@ylluminate :point_up: June 26, 2015 9:09 AM
Gabriel Rios
@gabrielrios
Jul 02 2015 18:51
@fkchang I got that, but what I’m wondering is why can’t opal take cara of that
Gabriel Rios
@gabrielrios
Jul 02 2015 18:57
And I sure that ‘toll free bridge’ classes might not be something common, someone coming from ruby would expect the #initialize method to work, instead of having to overriding .new
ylluminate
@ylluminate
Jul 02 2015 19:04
@fkchang thus why we're hoping that @adambeynon @elia @meh or someone can chime in with some clarification on that front... :fire:
Forrest Chang
@fkchang
Jul 02 2015 20:28
hmm, would documenting that suffice?
because I can see in Ruby-fying a toll free bridged class, you might change what you pass in vs automatically assuming they match 1 to 1
so you wouldn't necessarily auto generate a new function
Gabriel Rios
@gabrielrios
Jul 02 2015 20:36
Yes, that was exactly my point on the issue. I’m trying to clarify this so we can at least add documentation for this, as wrapping JS libraries as so important for opal and deserves some docs
ylluminate
@ylluminate
Jul 02 2015 21:11
Right, it is critically important for Opal to have an exceptionally well documented and authoritative wrapping tutorial / document.
Forrest Chang
@fkchang
Jul 02 2015 23:46
It's my intent to document wrapping and other stuff in a series of blog posts, possibly that'll be the basis of the official docs?