These are chat archives for opal/opal

Aug 2015
Francesco 'makevoid' Canessa
Aug 06 2015 13:20
Hi all
finally had some time to play with opal
I wanted to try react.rb - but I don't like sprockets at all, it's kind of slow
it's only opal and opal-browser
I vendored them both directly into js files
and I'm just using the builder to recompile the js when I save my clientside rb file
this way it's very fast, I don't have to wait like 2 seconds for sprockets to recompile all the assets
I couldn't get an already compiled (js) version of react.rb thou, do you know an easy way to generate one? Or a sprocket rule / some code to get one bundled file of every asset of the app?
Gabriel Rios
Aug 06 2015 13:39
@makevoid you can try to use the rake tasks used on opal-jquery
Francesco 'makevoid' Canessa
Aug 06 2015 13:40
opal is really cool, I've read some bits of source code and now I want to build something with it soon :)
I'll try against react-rb and see if I can get a version built, thanks for the hint @gabrielrios
Aug 06 2015 16:25
@elia ping
Elia Schito
Aug 06 2015 16:26
Aug 06 2015 16:26
I'm reconsidering #1044
Elia Schito
Aug 06 2015 16:27
Aug 06 2015 16:33
sempre bello l'internet italiano
I was saying
there is Native::Array
so it could be the right thing to do, if it uses Native::Array
but I don't remember its API so I have to check that
yeah, I don't think it would work, there would be an inconsistency between #alias_native and #native_accessor and friends
in the case of alias it would look something like
alias_native :series do |s| Series::new(s) end
alias_native :mime_types, :mimeTypes, get: :item, named: :namedItem do |m| end
looks like shit
Aug 06 2015 16:38
Elia Schito
Aug 06 2015 16:52
Colin Gunn
Aug 06 2015 23:47

@meh and @elia I much appreciate you taking the time to consider #1044. My timezone is +10, so out of sync with your conversation.

I understand your concern to keep the API clean and consistent, but I’ll probably keep my little patch going as it saves a lot of repetitive and comparatively untidy code.

Since #alias_native already provides an :as option to provide type conversion from the native object, having the additional option :as_array_of seems to me semantically and functionally consistent with the intent of the method, and is very handy and concise to boot. Leave it with you. :satisfied: