These are chat archives for opal/opal

22nd
Mar 2017
Elia Schito
@elia
Mar 22 2017 00:23

@catmando I have a file named opal-collapsed.js.erb with this content:

//= depend_on opal
<%= Rails.application.assets['opal'].to_s %>

which does just that and it respects any configuration you might have set on Opal::Config.

Mitch VanDuyn
@catmando
Mar 22 2017 00:23
woah... so where would I stick that in a gem?
okay
so if in my gem I have a file like hyperloop-collapsed.js.erb
Elia Schito
@elia
Mar 22 2017 00:24
wouldn't solve the problem of the very first compilation, if you do precompile simething to js be sure to warn users on which configuration you're using
Mitch VanDuyn
@catmando
Mar 22 2017 00:24
<%= Rails.application.assets['...
%>
Elia Schito
@elia
Mar 22 2017 00:25
@catmando that works in a Rails app, possibly can be adapted to a sprockets app of course
btw I pondered many times the possibility of shipping precompiled js of the core + single files for the stdlib with precompiled maps but always feared possible configuration conflicts
Mitch VanDuyn
@catmando
Mar 22 2017 00:26
okay... so I am figuring a rake task of some sort that you would run before releasing them gem
Elia Schito
@elia
Mar 22 2017 00:27
that would do
we have rake dist in the opal repo for producing CDN files
Mitch VanDuyn
@catmando
Mar 22 2017 00:28
yes. Same idea but you would before release of a gem...
I'll have a look at that. Thanks!
Elia Schito
@elia
Mar 22 2017 00:29
👍🏼