These are chat archives for ractivejs/ractive

7th
Jul 2017
Chris Reeves
@evs-chris
Jul 07 2017 20:27
should we default resolveInstanceMembers to false for 1.0? It seems to be tripping more people up than it is helping
there was much wailing and gnashing of teeth around the move to event expressions, and I think I may have gone a bit overboard trying to address the pain when time was probably a more appropriate solution
Juan C. Andreu
@andreujuanc
Jul 07 2017 20:29
From the changelog "Note that if the resolved function will only be bound to the instance if it contains a this reference, which can be a little strange if you're debugging."
probably not so well written ?
Im migrating from 0.8 to latest just for resolveInstanceMembers
to have it available
In my case I do lots of template stuff, and lots of events mean lots of @this
I get that {{ something }} is in data context. But, it's not so hard to understand that with resolveInstanceMembers true then just all evaluated js context is @this by default.
IMO it's the way should have been :)
Joseph
@fskreuz
Jul 07 2017 20:37
I'm in favor of making it false by default. Explicit is better than implicit. :D
Juan C. Andreu
@andreujuanc
Jul 07 2017 20:49
:gun: pew pew
Joseph
@fskreuz
Jul 07 2017 20:50
:fire: :dragon_face:
Ractive.defaults.resolveInstanceMembers = true - The usual solution when we toggle something, just use Ractive.defaults. :D
Juan C. Andreu
@andreujuanc
Jul 07 2017 21:12
Agree!
Chris Reeves
@evs-chris
Jul 07 2017 21:39
I usually just use @.something in events, as it's short and explicit
either way, the flag will still be there
my concern is just for surprising results for newbies
paulie4
@paulie4
Jul 07 2017 21:52
I vote for explicit, especially since "@." is very short.
Juan C. Andreu
@andreujuanc
Jul 07 2017 21:53
It's short, but when you have 50 @. without that just looks a bit cleaner
D:
but, thats what the flag's for xD
paulie4
@paulie4
Jul 07 2017 21:54
Heh, yup.