These are chat archives for opal/opal

6th
Jun 2016
Jared White
@jaredcwhite
Jun 06 2016 05:57
Hey all, I've been meaning to ask -- I thought at some point I had heard chatter about being able to choose to load a much smaller subset of Opal/stdlib/corelib, but I can't seem to find any docs about how to do that. Not sure if that ever actually got off the ground. I'm looking at creating an official JS library for a tool I'm building (nothing specifically related to Opal), and my current code is mostly Opal-based. I might try the crazy route of actually releasing it as a compiled Ruby-to-JS file if it could include only a small subset of the Opal runtime. Otherwise I'm just going to rewrite it in JS (probably ES6 + Babel).
Elia Schito
@elia
Jun 06 2016 11:53
@jaredcwhite require 'opal/mini' instead of opal should do the trick, not sure if it's suitable for a general purpose library tho
Jamie Gaskins
@jgaskins
Jun 06 2016 14:31
@elia Well, for a library, it's a good idea not to load Opal at all (on the front end, at least). ;-) The app using the library should decide how to load Opal. If an app loads it from a CDN but a lib loads it from the gem, you load the runtime twice.
Elia Schito
@elia
Jun 06 2016 14:35
indeed that's my general opinion too, but then you have stuff like asciidoctor.js and looks like a legit use case :D
Vais Salikhov
@vais
Jun 06 2016 15:09
@catmando in reference to opal/opal#1474 I have no objections to the PR as it stands at https://github.com/opal/opal/pull/1474/commits/ad833a3e86ed95e6ac640f6ba7d63cd249db4a1a. I have been out of the loop for a while, so counting on @elia to merge :wink:
Mitch VanDuyn
@catmando
Jun 06 2016 15:10
@vais - @adamcreekroad did that PR :-)
Jamie Gaskins
@jgaskins
Jun 06 2016 15:11
The PR seems to break a lot of specs related to keyword args.
Brady Wied
@wied03
Jun 06 2016 16:19
@jaredcwhite - When one of us gets around to it, the intent was to create a common NPM package that opal-webpack and the asciidoctor stuff can use - cj/opal-webpack#33
Forrest Chang
@fkchang
Jun 06 2016 16:19
@vais welcome back, hadn't seen u in a while (or at least that's my recollection)
Mitch VanDuyn
@catmando
Jun 06 2016 18:07
@elia - latest opal-rails-rspec doesn't have the nice list of spec links so you can rerun tests by clicking a link... any way to turn it back on in a config or something?
@jgaskins which pr were you referring to?
Jamie Gaskins
@jgaskins
Jun 06 2016 20:29
@catmando #1474 Looks like it was unrelated breakage. I thought the change to allow null had broken specs for kwargs (since kwargs are implemented with hashes), but @elia said it was caused by an incompatibility with mspec. So, never mind. :-)
Jared White
@jaredcwhite
Jun 06 2016 23:22
@elia Sweet! I'll definitely check that out. @jgaskins I could probably provide a variant of the library not including any of the Opal code itself, if the app wanted to load Opal separately. Yes?
Also, FWIW, I added my 2c in that Reddit thread on Opal. :clap: