These are chat archives for opal/opal

2nd
Apr 2016
Bernhard Weichel
@bwl21
Apr 02 2016 12:22
does someone have a hint, how I can prevent user from leaving the page by back-key?
Elia Schito
@elia
Apr 02 2016 14:51
@bwl21 try googling for the onunload event
Bernhard Weichel
@bwl21
Apr 02 2016 14:52
yea did this, but It did not fire. Now I decided to permanently save the status of my app such that leaving the page is no longer a harm :-)
Elia Schito
@elia
Apr 02 2016 14:55
:+1: - yes I think that event has benn a bit abused
Elia Schito
@elia
Apr 02 2016 17:25

@/all feedback request: gonna push a change to the sprockets pipeline that will require any root asset to have the .opal_main extention, e.g. in a rails app application.js.rbapplication.js.opal_main.rb. In addition I'm thinking about adding a list of paths that will be intrinsically marked as "main assets", something like: Opal::Config.main_paths << 'application'in rails could be prefilled with the precompiler paths.

If anyone has better ext name to propose or see any drawback please let me know.
(this btw will greatly simplify the support for sprockets 4)

Mitch VanDuyn
@catmando
Apr 02 2016 17:27
opal_root if that is what it is???
I mean you start describing it as a root asset, so why not stick with that?
Elia Schito
@elia
Apr 02 2016 17:28
I started with root as the ext name too, but than thought about Opal::Server that has server.main = 'app'
Mitch VanDuyn
@catmando
Apr 02 2016 19:25
@elia but is slightly different isn't it? in some cases you might have a couple of roots, but not necessarily more than one main? Is that right?
Elia Schito
@elia
Apr 02 2016 21:55
@catmando that's right, tbh I don't like a name that long, but couldn't come up with anything shorter, don't have strong feelings for either of them, if it were an opal-only env, .main would have made more sense
Martin Becker
@Thermatix
Apr 02 2016 22:19
btw I wanted to ask, to differentiate opal files and normal ruby files, why didn't you use .orb as the file extension?
Mitch VanDuyn
@catmando
Apr 02 2016 22:21
@elia why not just root then
foo.root.rb . .
The opal is redundant
Elia Schito
@elia
Apr 02 2016 22:26
That would be the same as .main but the problem with that is that the extension must be registered to sprockets and root/main are just to specific, but maybe I can register it as a single ext… need to check
Martin Becker
@Thermatix
Apr 02 2016 22:27
then do root.orb
:D
problem solved
kind of
Elia Schito
@elia
Apr 02 2016 22:29
@Thermatix if you want something different from .rb you can use .opal which is still supported, personally I like .js.rb to differentiate frontend files
Martin Becker
@Thermatix
Apr 02 2016 22:29
it's not that just, .orb looks better and could be read as 'opal ruby'
an 'opal ruby' file
and it reads a orb
:P
Mitch VanDuyn
@catmando
Apr 02 2016 22:37
@Thermatix I think u told me once but why is it important to u to to distinguish between Ruby files and well other Ruby files?
Martin Becker
@Thermatix
Apr 02 2016 22:42
becuase it makes it more obvious, if someone has a gem for example that has both server side and front end code they could easily see which was which, it just makes a better mental disconnection between code that sits on the front end and code that sits on the back end.
plus
opal ruby isn't 100% ruby code
for example
you strings arn't mutable
and there is no functional difference between strings and symbols
and a few other things
so by doing .orb were saying that this is OPAL ruby, not standard ruby
but it's still ruby
doing .opal might make people wrongly assume that it's a different programing language altogether
so similar file extension, similar language
also
.orb looks nicer than .opal imho
Martin Becker
@Thermatix
Apr 02 2016 22:52
btw, can I ask, has any one used my Ruta library? just curios
Mitch VanDuyn
@catmando
Apr 02 2016 22:59
@loicboutet started. I have not had s new project that need a router yet
Martin Becker
@Thermatix
Apr 02 2016 23:00
just wonder, i've had no feedback so beyond my own ideas I don't really know where to go for improvements