Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Forrest Chang
@fkchang
@/all released opal_hot_reloader 0.1.5 gem with the 0.11 support
Elia Schito
@elia
:tada:
G. Gibson
@mistergibson
@fkchang : cool idea
Billy.Zheng
@zw963
@fkchang , Cool
Billy.Zheng
@zw963
@/all, I extract opal/opal gitter chat history into one text file, if you want search something , please visit https://zw963.github.io and download chat file.
G. Gibson
@mistergibson
I'm having issues getting an xml parser into Opal. Is there a recommended one I should be using instead of REXML?
Elthariel
@elthariel
@mistergibson, Join us on the hyperloop gitter, we're nice :)
G. Gibson
@mistergibson
@elthariel : I'm there - lurking and learning :)
Frederic ZINGG
@fzingg

@elia Hi Elia,
I'm trying to work with D3 and Opal.
I found your article (written in 2014): https://dev.mikamai.com/2014/06/04/learning-d3js-basics-with-ruby-and-opal/
And I also found a library: https://github.com/taw/opal-d3

What is your opinion and your advice in order to get Opal and D3 working well ? Tx.

Billy.Zheng
@zw963
hi, @fkchang , I search out a old study project, which bascially just try to reproduce this blog created by you. but i found it not worked now when run rake http, following is error message:
Building http
        running
module.js:471
    throw err;
    ^

Error: Cannot find module 'glob'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at singleton_class_alloc.$$node_require [as $node_require] (/home/public/Dropbox/others/Project/opal/0.11/opal-node/http.js:22699:63)
    at /home/public/Dropbox/others/Project/opal/0.11/opal-node/http.js:23016:26
    at Opal.modules.nodejs/dir (/home/public/Dropbox/others/Project/opal/0.11/opal-node/http.js:23057:5)
    at Object.Opal.load (/home/public/Dropbox/others/Project/opal/0.11/opal-node/http.js:2192:7)
    at Object_alloc.Opal.require [as $require] (/home/public/Dropbox/others/Project/opal/0.11/opal-node/http.js:2216:17)
    at Opal.modules.nodejs (/home/public/Dropbox/others/Project/opal/0.11/opal-node/http.js:23214:8)
Billy.Zheng
@zw963
@/all, Hi, here have a awesome tutorial for opal by @elia, with slide, youtube video. i think maybe some one interest in it.
And, BONUS: we can seem a talk by @elia in video. :smile:
Forrest Chang
@fkchang
@zw963 did you have the glob module installed? i.e. npm install --save glob
Elia Schito
@elia
@fzingg I never went beyond the article that basically that D3.js says it's kinda hard to wrap, but I think @taw did a great job with opal-d3 and the only thing missing is something more in the readme, like examples etc. That's probably the easiest contribution from anyone approaching the project (HINT HINT! :smile:). Also as a sidenote method_missing should work properly on bridged classes (classes defined in JS outside of Opal).
Frederic ZINGG
@fzingg
@elia @taw Yes, I tried his opal-d3 and it looks great and works well. The only thing is that it works with OPAL 0.10 and because I combine everything with Hyperloop last version which works only with Opal 0.11, I would need to update the opal-d3. I will see with @taw .
Billy.Zheng
@zw963
@fkchang , after add glob node module, it worked now, thanks!
G. Gibson
@mistergibson
lol
JavaScript is just a hobbled language - no match for the elegance of Ruby IMO
Forrest Chang
@fkchang
@mistergibson yes, I never think those thoughts about Ruby
Mitch VanDuyn
@catmando
its not javascripts fault. Really. The problem is that JS had to freeze much faster than ruby so had no chance to evolve. In a perfect world instead of JS we would have gone directly to a WASM like VM, with a JS on top letting alternative languages flow from day 1.
G. Gibson
@mistergibson
true enough
maybe it will evolve into a WASM world at some point
I'd dig that - then we could do any language on top of that.
Tomasz Wegrzanowski
@taw
hi guys
so back to my opal-d3 library, I use opal-rspec for testing it, but that doesn't support opal 0.11
what are my other testing options?
Frederic ZINGG
@fzingg
@taw I'm sure you will get some help about that in this Chat room, but I will ask also in the ruby-hyperloop chat room.
Elia Schito
@elia
@taw opal-rspec @ elia/master kinda works (still WIP tho)
Frederic ZINGG
@fzingg
@taw According to my Hyperloop team collegues you can also use the last version of HYPER-SPEC, which works well for testing OPAL 0.11 also.
source 'https://gems.ruby-hyperloop.org'
gem 'hyper-spec', '1.0.0-lap18'
Torsten Rüger
@rubydesign
Hi all. I'm trying to write a 3d tool. Currently looking at seen.js as best contender. Has anyone seen a better small library (ie not three or babylon with Mb footprints)
Tomasz Wegrzanowski
@taw
thanks, I'll take a look at these options
Billy.Zheng
@zw963
@elia , I update your's awesome tetris app to use opal 0.11, and create a PR here
The next step is: i want deploy this game into my home page, with only one app.min.js and one index.html, awesome!
Elia Schito
@elia
@zw963 thanks! great! :smile:
Mitch VanDuyn
@catmando
@elia so what does #$! do? Is the other weird syntax like that?
Jamie Gaskins
@jgaskins
@catmando Inside strings and backticks, ivars and globals don't need a full #{} and can just use #, and since $! is the current exception within a rescue block, throw $#! between backticks is a re-raise of the currently rescued exception.
Mitch VanDuyn
@catmando
Huh! There u go. Tx @jgaskins
Billy.Zheng
@zw963
@all, http://game.zw963.online, online tetris game, original write by @elia for a opal talk, I just bundle into app.min.js and index.html, and threw it into my site. how to bundle inspire by @barriehadfield another project.
Sebastian Fiedlschuster
@fiedl
Hi all, I’m trying to integrate opal successively into an existing project. But I’m struggling with a basic concept: How can I export a class in opal such that I can use it from a typescript file?
# foo.rb

class Foo
  def bar
    "barbar!"
  end
end
// otherfile.ts

import { Foo } from './foo'
console.log((new Foo).bar());
Elia Schito
@elia
@fiedl all Opal classes are defined on Opal, which is a property of window, e.g. window.Opal.Array, that is the same as what MRI does because essentially every ruby constant is also a global
so the TS code would something like this: console.log(Opal.Foo.$new().$bar()); but I'm guessing, I don't know TS
Sebastian Fiedlschuster
@fiedl
Thanks @elia. Trying this I get TS2304: Cannot find name 'Opal‘.
Elia Schito
@elia
maybe, assuming you have an opal.js somewhere you need to add import { Opal } from 'opal'
@fiedl is there a way to require js stuff that doesn't use modules?
Sebastian Fiedlschuster
@fiedl
I’m not sure, but I’ve seen something like this: import * as showdown from 'showdown‘; instead of const showdown = require(‚showdown‘).
Elia Schito
@elia
then probably require('opal') will suffice
Sebastian Fiedlschuster
@fiedl
I think, it’s import * as Opal from 'opal‘;. This reduced the amount of errors significantly :)
Elia Schito
@elia
:smile: