These are chat archives for ractivejs/ractive

15th
Mar 2018
Chris Reeves
@evs-chris
Mar 15 2018 00:07
now that you mention it, I think there may be a way to avoid requiring the alias
I'll put it on the list to investigate for 0.10
Juan C. Andreu
@andreujuanc
Mar 15 2018 10:43
Thanks!!! it'd be a nice addition
damn ireally want to get some free time from work and "life" so i can check Ractive source code
Paul Maly
@PaulMaly_twitter
Mar 15 2018 12:49
oops, I got it
Cerem Cem ASLAN
@ceremcem
Mar 15 2018 15:11

macros can't have events, no

@evs-chris if "no", how can we implement a namespace macro that hooks the "*.init" events?

Juan C. Andreu
@andreujuanc
Mar 15 2018 16:17
Macros dont have docs right?
is it hidden sorcery for now ?
Chris Reeves
@evs-chris
Mar 15 2018 17:00
you can subscribe to instance events in the macro lifecycle, which may not be what you're looking for
you can also have components that automatically map data during construction without requiring an attr, but that's tight coupling
macros are still mostly undocumented, but they will get docs for 0.10 where they'll still be labeled experimental
Cerem Cem ASLAN
@ceremcem
Mar 15 2018 17:53
Chris, would I break any design decision if I would change component event bubbling mechanism as "YIELDER should capture events from childs", thus make this form of usage possible, so it would behave like this
Cerem Cem ASLAN
@ceremcem
Mar 15 2018 18:00
(I'm not sure if I could manage to do so, but I want to give it a shot)
Anatoli Radulov
@avoto
Mar 15 2018 19:59
Hi all, I've tried doing Ractive.getContext(document.getElementById("t4892_div")).fire('dataRequested', false, 25) but fire() is not a function in context. Then I did the same but using a hack instead by doing - document.getElementById("t4892_div").children[0]._ractive.proxy.ractive.fire('dataRequested', false, 25);
The question is, how reliable is _ractive.proxy.ractive and are there any plans for it to change.
Joseph
@fskreuz
Mar 15 2018 20:25
document.getElementById("t4892_div").children[0] - So a child is in an instance but not the parent, yes?
If so, getContext should be targetted on document.getElementById("t4892_div").children[0] and not document.getElementById("t4892_div")
Chris Reeves
@evs-chris
Mar 15 2018 20:47
you'll want context.ractive.fire
the context doesn't have its own version of fire because fire is not context sensitive
@ceremcem we gotten requests to make the eventing system more flexible before
I'm certainly not opposed to it, but the danger is adding a bunch of overhead, I think
for instance, we should probably add a way to disable bubbling on events
Capri
Capture would probably make that process even more expensive (processing bubbled events)
but it would also be a nice addition if you need an event bus in an app
Cerem Cem ASLAN
@ceremcem
Mar 15 2018 20:56
okay. so the best thing to do is to give it a shot, right? :)
Anatoli Radulov
@avoto
Mar 15 2018 22:07
Thanks guys, Ractive.getContext(document.getElementById("t4892_div")).ractive.fire() did the trick!