These are chat archives for opal/opal

24th
Nov 2015
Mitch VanDuyn
@catmando
Nov 24 2015 03:09
@fkchang - so I am ready to test this update to require_js... its a little unclear how to build the app / what to do.. any hints?
Mitch VanDuyn
@catmando
Nov 24 2015 03:20
@fkchang nvm - think I got it...
Mitch VanDuyn
@catmando
Nov 24 2015 03:54
@/all I NEVER CAN GET THIS RIGHT... what do I require to get access to every and after methods?
Forrest Chang
@fkchang
Nov 24 2015 17:41
@catmando require 'browser/interval' and 'browser/delay'
Mitch VanDuyn
@catmando
Nov 24 2015 17:43
i tried and tried... in the end I figured you would want to keep dependencies to a minimum so I just called setTimer directly
CJ Lazell
@cj
Nov 24 2015 17:59
what would be the best way to add opal sprockets along side this? https://github.com/cj/roda-sprocket_assets/blob/master/lib/roda/plugins/sprocket_assets.rb
Martin Becker
@Thermatix
Nov 24 2015 18:01
if were still talking about loading a library I use the following function:
  def load_library &block
        raise 'no provider_url present' unless @provider_url
        %x'
            url = #{@provider_url}
            var script = document.createElement("script");
            script.type = "text/javascript";

            if (script.readyState){  //IE
                script.onreadystatechange = function(){
                    if (script.readyState == "loaded" ||
                            script.readyState == "complete"){
                        script.onreadystatechange = null;
                        #{block.call}
                    };
                };
            } else {  //Others
                script.onload = function(){
                    #{block.call};
                };
            }

            script.src = url;
            document.getElementsByTagName("head")[0].appendChild(script);
        '
      end
doesn't use any jquery either
CJ Lazell
@cj
Nov 24 2015 18:08
I’m looking at https://github.com/opal/opal-rails/blob/master/lib/opal/rails/engine.rb but I don’t see where you tell rails sprockets about the opal builder
ah its in the files you are requiring
Max Rozenoer
@gtmax
Nov 24 2015 19:10
just did a presentation building "isomorphic" server/client ruby via opal: http://bit.ly/gett_isomorphic
Elia Schito
@elia
Nov 24 2015 19:27
Great presentation!
@gtmax and an interesting story too :)
@gtmax do you have a Twit that I can retweet?
Forrest Chang
@fkchang
Nov 24 2015 19:35
@gtmax good story
Mitch VanDuyn
@catmando
Nov 24 2015 20:49
@/all just updated the landing page at http://reactive-ruby.github.io/ I think you will find its worth a look.
Mitch VanDuyn
@catmando
Nov 24 2015 20:59
Huge :clap: to the opal team, for making this possible. In the end I literally changed about 10 lines of code in the react.js playground (to call the Opal.Compiler) added a rake task to build the compiled JS file for opal+react, and presto it just worked.
Elia Schito
@elia
Nov 24 2015 21:00
wooo, really cool stuff!