These are chat archives for opal/opal

13th
Jan 2016
Jared White
@jaredcwhite
Jan 13 2016 01:01
@elia @meh I've been meaning to ask you about blog updates on the Opal website. Seems like (how to put this nicely) it could use some love, at least in regards to major gem releases (like v0.8, now v0.9, etc.). I'd be willing to help out in this endeavor, or better yet coordinate with any other volunteers for the blog.
George Plymale II
@ylluminarious
Jan 13 2016 02:34
@drewhamlett re: that article on web development, glad to see that some folks like yourself are appreciating opal as a respectable web development technology :D. yeah, i have to agree that it's kind of sad to see people abandon tried and true tools just to be like the cool kids, so to speak. it's kind of odd that that sort of thing has fallen into the domain of javascript, since it used to not be so insanely popular. i think that there is too much politics and not enough pragmatism going on in people's toolkits these days. that's just my 2ยข, though.
btw, are you the one that wrote that article? cause i see your name at the top of the page, but i'm not sure if you just reposted that article from somewhere else.
George Plymale II
@ylluminarious
Jan 13 2016 03:55
oh wait, never mind. just saw the bottom of the article and saw your signature there :P
Elia Schito
@elia
Jan 13 2016 07:50
@jaredcwhite triple ๐Ÿ‘๐Ÿผ tell me more good luck
Martin Becker
@Thermatix
Jan 13 2016 10:12
random question, which online regex checker do you use? I tend to use rubular.com
Elia Schito
@elia
Jan 13 2016 10:13
TextMate 2 :^)
Martin Becker
@Thermatix
Jan 13 2016 10:27
hmm , question, when you add a global variable using $ in sinatra, is this information sent to the front end somehow? or is it only when there's an error or somthing?
Elia Schito
@elia
Jan 13 2016 10:28
it's not sent to the frontend
finisco una cosa e arrivo
Martin Becker
@Thermatix
Jan 13 2016 10:29
cool, thanks for the response, especially as it's kind of off-topic
I know it's not but it feels like this is a chat room for stuff related to opal other stuff
:D
Any way, I've managed to now have separate front end interface components in seprate folders
so I can now have all my contexts seperated
wooo
... huh that's what I should have called it, contexts not interface... silly me
Elia Schito
@elia
Jan 13 2016 10:33
ouch, wrong chat
Martin Becker
@Thermatix
Jan 13 2016 10:42
umm does require_tree include sub-folders?
Elia Schito
@elia
Jan 13 2016 11:02
keeps the same behavior as the require_tree directive in sprockets (which I don't remember but you can look it up)
Martin Becker
@Thermatix
Jan 13 2016 11:06
it say's it loads files recursively so I'm guessing this means it loads all sub folders as well
Elia Schito
@elia
Jan 13 2016 11:06
yes it should then
Martin Becker
@Thermatix
Jan 13 2016 11:06
oh umm btw I'm getting a Uncaught ReferenceError: Opal is not defined error
Elia Schito
@elia
Jan 13 2016 11:07
you need to require 'opal'
Martin Becker
@Thermatix
Jan 13 2016 11:07
AH
right.. silly me! had a derp moment
Martin Becker
@Thermatix
Jan 13 2016 11:26
I might have an encountered a bug...
Ilya Bylich
@iliabylich
Jan 13 2016 11:27
@elia Why ivars in Opal are just properties? I mean, why ivars are not prefixed with anything like $ or $$ (well, these are reserved, but $$$ is still free :smile: )? I'm asking it because there are conflicts with constants and array indexes (which are also properties)
Martin Becker
@Thermatix
Jan 13 2016 11:27
when I do require './example' the code in file example.rb doesn't seem to execute but if i do require_relative './example' it does, or have I missed somthing?
Elia Schito
@elia
Jan 13 2016 11:30
@iliabylich I think the initial rationale is that they map nicely and make debug straightforward, we could think of switching the bare name with $$ and make internal properties be unprefixed, but that should be discussed in depth cc @meh
@Thermatix please open an issue so the info isn't lost : ) (but it lack of documentation or a very bug)
Ilya Bylich
@iliabylich
Jan 13 2016 11:34
Year, I understand that, it seems that nobody uses stuff like instance_variables :smile: . I'm getting very strange behavior like
[1,2,3].instance_variables
# => ["@0", "@1", "@2"]
Martin Becker
@Thermatix
Jan 13 2016 11:34
@elia ok, done
Elia Schito
@elia
Jan 13 2016 11:34
I think numeric ivars are invalid tho
@Thermatix thanks
Martin Becker
@Thermatix
Jan 13 2016 11:34
issue #1286
Ilya Bylich
@iliabylich
Jan 13 2016 11:38
I know, there's a code that checks for a property to not be a reserved object property (like proto or constructor). But it looks unsafe, some day new version of "browser N" may get some extra property (which is not blacklisted in Opal explicitly) and instance_variables may return it
Elia Schito
@elia
Jan 13 2016 11:39
that's true
Ilya Bylich
@iliabylich
Jan 13 2016 11:40
What do you think about $$$ivar? :smile:
Elia Schito
@elia
Jan 13 2016 11:40
too expensive :D
:money_with_wings:
As said I'd rather switch internal properties and ivars, giving ivars the $$ prefix
Martin Becker
@Thermatix
Jan 13 2016 13:39
does opal have a problem parsing procs that have return values?
Elia Schito
@elia
Jan 13 2016 13:43
return in a procs is tricky to implement, I think there's still a bunch of cases which are unsupported
Martin Becker
@Thermatix
Jan 13 2016 13:44
I don't mean return in proc, I mean.. I think return is the wrong word
I mean passing args to a proc, sorry
I'm doing :
-> { |some_value|
 puts some_value
}
and I get a parsing error
Elia Schito
@elia
Jan 13 2016 13:45
because it's not valid ruby! :D
Martin Becker
@Thermatix
Jan 13 2016 13:45
removing |some_value| removes the parsing error
Elia Schito
@elia
Jan 13 2016 13:45
-> some_value { โ€ฆ } is the right syntax
Martin Becker
@Thermatix
Jan 13 2016 13:45
OH
right
Jared White
@jaredcwhite
Jan 13 2016 15:21
@elia cool about the :+1: on blog updates...how should I approach it? Submit a PR for a new post in the opal.github.io project (source branch)?
Elia Schito
@elia
Jan 13 2016 15:22
@jaredcwhite that would be perfect
Jared White
@jaredcwhite
Jan 13 2016 15:22
@elia :shipit:
Jared White
@jaredcwhite
Jan 13 2016 15:33
saw this in the changelog: "Now you can bridge a native class to a Ruby class that inherits from another Ruby class" sounds interesting but not sure exactly what that's for (code example?)
meh.
@meh
Jan 13 2016 15:35
jaredcwhite, Number < Numeric
meh.
@meh
Jan 13 2016 15:35
where Number is bridged to the JS Number
Elia Schito
@elia
Jan 13 2016 15:36
Jared White
@jaredcwhite
Jan 13 2016 15:36
@meh oh OK, using Opal.bridge - so is this mainly to help with Opal internals or could it be useful to the average developer?
meh.
@meh
Jan 13 2016 15:38
elia, I'd rather keep them unprefixed
jaredcwhite, it technically could be useful when writing wrappers for other libraries if you want a common ancestor or something
Jared White
@jaredcwhite
Jan 13 2016 15:39
@meh cool. will have to look at what Opal.bridge does further
Ilya Bylich
@iliabylich
Jan 13 2016 15:45
@meh Then how could we resolve these issues like the one with array? Filtering them explicitly for each class? Like super.reject { ... }?
meh.
@meh
Jan 13 2016 15:51
iliabylich, yeah I'd prefer that
Jared White
@jaredcwhite
Jan 13 2016 16:19
@elia Here you go! opal/opal.github.io#34
Elia Schito
@elia
Jan 13 2016 16:22
Thanks! Reading it now :eyeglasses:
Jared White
@jaredcwhite
Jan 13 2016 16:23
feel free to make changes, suggest improvements, etc.
Elia Schito
@elia
Jan 13 2016 16:23
First thing is updating docs with 0.9.2
which I'm doing now :)
Jared White
@jaredcwhite
Jan 13 2016 16:24
oh ok -- then we can update the links in the blog post
Elia Schito
@elia
Jan 13 2016 16:25
indeed, the other thing I'd like to do before posting it is to update the changelog to use the http://keepachangelog.com (even if not strictly)
Jared White
@jaredcwhite
Jan 13 2016 16:31
@elia Seems like a good idea
Elia Schito
@elia
Jan 13 2016 16:32
Already experimented with it on opal-rails and looks good: https://github.com/opal/opal-rails/blob/master/CHANGELOG.md#090---unreleased
Jared White
@jaredcwhite
Jan 13 2016 16:32
:+1:
Elia Schito
@elia
Jan 13 2016 16:34
@jaredcwhite you had any plan to write something for 0.8 too?
Jared White
@jaredcwhite
Jan 13 2016 16:35
@elia I wasn't planning to - I know there was a lot of good stuff in that release too. But I wanted to help out going forward, in part so there's something good to link to from release announcements in Opalist as well
Elia Schito
@elia
Jan 13 2016 16:36
@jaredcwhite maybe a mention in the 0.9 post could be added, just to signal that there's more from the last blog post that can be read in the changelog
wdyt?
Jared White
@jaredcwhite
Jan 13 2016 16:36
@elia Sounds good. I'll commit an update
done
Jared White
@jaredcwhite
Jan 13 2016 17:38
@elia OK, I updated links accordingly.
@elia And...sigh...renamed the file so it says 2016, not 2015 :neutral_face:
Elia Schito
@elia
Jan 13 2016 17:43
Merged
don't know if the latest fix made into it,
if it didn't I'll update it before publishing
(which I need to later tonight)
Jared White
@jaredcwhite
Jan 13 2016 18:19
looks like it did :+1: