These are chat archives for ractivejs/ractive

7th
Nov 2017
Cerem Cem ASLAN
@ceremcem
Nov 07 2017 11:47
you welcome :)
@evs-chris what do you think about #1583?
Joseph
@fskreuz
Nov 07 2017 13:11

Any reason not to convert the component definition from an exported object to a constructor? i.e.

<script>
  export default {...}
  // or
  component.exports = {...}
</script>

vs

<script>
  import Ractive from 'ractive'
  export default Ractive.extend({ ... })
</script>
First impression, the old spec makes the definition very loose. No assumptions on framework, environment, syntax, etc.
The latter approach is requires less source-mangling/guessing, makes it explicit that it's returning a constructor, depends on Ractive.
Also forwards constructor creation to the developer. I remember an old issue where you can't do inheritance/multi-object extend with the component syntax. The latter would allow that.
Chris Reeves
@evs-chris
Nov 07 2017 14:31
I'm not super familiar with rcu, but I'd say drop the import requirement and just inject Ractive. I think that would make the only mangle be too look for exports and adjust them, well in the script block anyway.
@ceremcem I have a computed branch that I'm playing with, but it's not a small change. It's also gonna be breaking because dotted computed keypaths don't currently require escaping, and they will after this is implemented.
Cerem Cem ASLAN
@ceremcem
Nov 07 2017 14:35
okay, so it's on its way
Chris Reeves
@evs-chris
Nov 07 2017 14:36
It also raises some interesting questions that I'll put in the pr when that branch is more viable, like if you define a wildcard computed, should it shadow normal data then or not be considered?
Chris Reeves
@evs-chris
Nov 07 2017 15:49
so... #3127... what do you do with a splice on a computed? My brain doesn't seem to even want to consider it at the moment.
Cerem Cem ASLAN
@ceremcem
Nov 07 2017 17:40
hmm. so it waits for the design decisions
...mostly?
Chris Reeves
@evs-chris
Nov 07 2017 18:28
well, if you splice a computed, it's weird because you're splicing something that is ephemeral. When recomputing, your changes would just be overwritten. I suppose the computed model needs a special path for that that calls its setter with the splice result or errors if there's no setter.
Cerem Cem ASLAN
@ceremcem
Nov 07 2017 22:28
image.png
@evs-chris @fskreuz
Chris Reeves
@evs-chris
Nov 07 2017 22:35
hmmmm... Rich may have axed it while troubleshooting other dns issues
Chris Reeves
@evs-chris
Nov 07 2017 23:09
ah! Looks like it expired.
Cerem Cem ASLAN
@ceremcem
Nov 07 2017 23:09
what? ractivejs.org? no way!
Chris Reeves
@evs-chris
Nov 07 2017 23:20
it happens 😁
Chris Reeves
@evs-chris
Nov 07 2017 23:26
I think everything has been transitioned to ractive.js.org, so I'm not even sure that I want to bother @Rich-Harris about it.