These are chat archives for ractivejs/ractive

19th
Feb 2018
Paul Maly
@PaulMaly_twitter
Feb 19 2018 08:40
@evs-chris cool! When these changes will be available in Edge? Do we have something like Ractive.helpers ?
Chris Reeves
@evs-chris
Feb 19 2018 15:25
should be there now, and yes, unless I missed setting up the prop...
Chris Reeves
@evs-chris
Feb 19 2018 21:31
does anyone have any thoughts on the difference between Ractive.components and Ractive.defaults.components?
the defaults one doesn't exist, but others do
like data
helpers is currently available on defaults, and it looks like both do the same thing e.g. are the prototype for instance registries
Paul Maly
@PaulMaly_twitter
Feb 19 2018 21:34
but ‘’defaults == prototype’’ isn’t it?
Chris Reeves
@evs-chris
Feb 19 2018 21:34
yes
but components is also available on instances, and the object inherits in the same way
Paul Maly
@PaulMaly_twitter
Feb 19 2018 21:38
But if you’ll extend components for the instance seems prototype value will be lost?
I mean Ractive.prototype.components
‘’Ractive.prototype.components = { foo: ...}’’
Ractive.extend({components: {bar: ...}});
Foo will be lost or not?
Sorry, mobile
Joseph
@fskreuz
Feb 19 2018 22:13
iirc, the registries are static. I think this was to avoid prototype "shadowing" (i.e. define a property in child and parent, chain resolves to child's, you have no visibility on the parent's). iirc, constructors have a Parent reference, and it's how it gets around shadowing - it does the climbing manually.
Prototypes are the one thing that I still get wrong in Ractive :grin: It's sometimes prototype-y but sometimes it's not.
Joseph
@fskreuz
Feb 19 2018 22:30
This is one avenue where TS, fixed classes, and docs can really help. Adhoc/on-the-fly props that exist in one scenario and not in another is really confusing (adaptors is one such culprit :grin: )