These are chat archives for opal/opal

25th
Nov 2015
Elia Schito
@elia
Nov 25 2015 01:01
Sprockets wasn't busting the assets cache between opal versions, resulting in weird errors
CJ Lazell
@cj
Nov 25 2015 01:02
@elia ah ok, I’ll add that to my gem then :)
Elia Schito
@elia
Nov 25 2015 01:04
What gem?
Elia Schito
@elia
Nov 25 2015 07:51
:+1:
Max Rozenoer
@gtmax
Nov 25 2015 11:53
@elia no, i ended up retwitting your twit :)
Mitch VanDuyn
@catmando
Nov 25 2015 13:57
Binding?? Not implemented? Workarounds?
Elia Schito
@elia
Nov 25 2015 13:59
I don't think it's possible without implementing a VM
Mitch VanDuyn
@catmando
Nov 25 2015 14:22
Im thinking js this must have a lot of the info
Martin Becker
@Thermatix
Nov 25 2015 14:37
I have a problem on stack, it's not related to opal but I'm posting a link here because so far all I've gotten are people who don't read the question , so I'm thinking that the people here will be more intelligent http://stackoverflow.com/questions/33917622/ruby-create-types-for-dsl-without-polluting-global-namespace
Mitch VanDuyn
@catmando
Nov 25 2015 18:45
@Thermatix - when you get an answer let me know... I could not figure it out either, and react.rb and reactive-record do a lot of this kind of thing. Also be careful because Opal strings and arrays are mapped to the underlying js types, you will find that some meta-programming does not quite work as expected.
Mitch VanDuyn
@catmando
Nov 25 2015 18:52
@Thermatix - have you tried snippets of your code in standard ruby IRB? It could be that its specific to the String class (see my comment above)
Martin Becker
@Thermatix
Nov 25 2015 19:11
@catmando sorry, should have said something, I managed to come up with a solution that results in better code.
on the back end now, each type will self register and generate a snake_cased method based on the name of the type that acts a method based reference to the type
so TextInput becomes text_input
so it goes:
This message was deleted

From this:

field "user name", TextInput, {less_than: 20, greater_than: 9, required: true}

To this:

field "user name", text_input, {less_than: 20, greater_than: 9, required: true}

slight difference, but I also think it's an improvement as it's now more DSL like as now no constants are used.

Martin Becker
@Thermatix
Nov 25 2015 19:18
@all does browser/storage need to be required or does it automatically required?
Mitch VanDuyn
@catmando
Nov 25 2015 19:28
I don't believe any of the browser stuff is automatically required. Reason being it would kill isomorphism, since browser does not exist on server.
Martin Becker
@Thermatix
Nov 25 2015 19:30
ah, ok, cool!